NOISSUE fix build
This commit is contained in:
parent
0c861db7a2
commit
c2c56a2f6c
@ -347,8 +347,8 @@ void ScreenshotsPage::on_actionUpload_triggered()
|
|||||||
auto albumTask = NetJobPtr(new NetJob("Imgur Album Creation"));
|
auto albumTask = NetJobPtr(new NetJob("Imgur Album Creation"));
|
||||||
auto imgurAlbum = ImgurAlbumCreation::make(uploaded);
|
auto imgurAlbum = ImgurAlbumCreation::make(uploaded);
|
||||||
albumTask->addNetAction(imgurAlbum);
|
albumTask->addNetAction(imgurAlbum);
|
||||||
task.addTask(job.unwrap());
|
task.addTask(job);
|
||||||
task.addTask(albumTask.unwrap());
|
task.addTask(albumTask);
|
||||||
m_uploadActive = true;
|
m_uploadActive = true;
|
||||||
ProgressDialog prog(this);
|
ProgressDialog prog(this);
|
||||||
if (prog.execWithTask(&task) != QDialog::Accepted)
|
if (prog.execWithTask(&task) != QDialog::Accepted)
|
||||||
|
@ -4,7 +4,7 @@ SequentialTask::SequentialTask(QObject *parent) : Task(parent), m_currentIndex(-
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void SequentialTask::addTask(std::shared_ptr<Task> task)
|
void SequentialTask::addTask(shared_qobject_ptr<Task> task)
|
||||||
{
|
{
|
||||||
m_queue.append(task);
|
m_queue.append(task);
|
||||||
}
|
}
|
||||||
@ -19,7 +19,7 @@ void SequentialTask::startNext()
|
|||||||
{
|
{
|
||||||
if (m_currentIndex != -1)
|
if (m_currentIndex != -1)
|
||||||
{
|
{
|
||||||
std::shared_ptr<Task> previous = m_queue[m_currentIndex];
|
shared_qobject_ptr<Task> previous = m_queue[m_currentIndex];
|
||||||
disconnect(previous.get(), 0, this, 0);
|
disconnect(previous.get(), 0, this, 0);
|
||||||
}
|
}
|
||||||
m_currentIndex++;
|
m_currentIndex++;
|
||||||
@ -28,7 +28,7 @@ void SequentialTask::startNext()
|
|||||||
emitSucceeded();
|
emitSucceeded();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
std::shared_ptr<Task> next = m_queue[m_currentIndex];
|
shared_qobject_ptr<Task> next = m_queue[m_currentIndex];
|
||||||
connect(next.get(), SIGNAL(failed(QString)), this, SLOT(subTaskFailed(QString)));
|
connect(next.get(), SIGNAL(failed(QString)), this, SLOT(subTaskFailed(QString)));
|
||||||
connect(next.get(), SIGNAL(status(QString)), this, SLOT(subTaskStatus(QString)));
|
connect(next.get(), SIGNAL(status(QString)), this, SLOT(subTaskStatus(QString)));
|
||||||
connect(next.get(), SIGNAL(progress(qint64, qint64)), this, SLOT(subTaskProgress(qint64, qint64)));
|
connect(next.get(), SIGNAL(progress(qint64, qint64)), this, SLOT(subTaskProgress(qint64, qint64)));
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "Task.h"
|
#include "Task.h"
|
||||||
|
#include "QObjectPtr.h"
|
||||||
|
|
||||||
#include <QQueue>
|
#include <QQueue>
|
||||||
#include <memory>
|
|
||||||
|
|
||||||
class SequentialTask : public Task
|
class SequentialTask : public Task
|
||||||
{
|
{
|
||||||
@ -12,7 +12,7 @@ public:
|
|||||||
explicit SequentialTask(QObject *parent = 0);
|
explicit SequentialTask(QObject *parent = 0);
|
||||||
virtual ~SequentialTask() {};
|
virtual ~SequentialTask() {};
|
||||||
|
|
||||||
void addTask(std::shared_ptr<Task> task);
|
void addTask(shared_qobject_ptr<Task> task);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void executeTask();
|
void executeTask();
|
||||||
@ -25,6 +25,6 @@ slots:
|
|||||||
void subTaskProgress(qint64 current, qint64 total);
|
void subTaskProgress(qint64 current, qint64 total);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QQueue<std::shared_ptr<Task> > m_queue;
|
QQueue<shared_qobject_ptr<Task> > m_queue;
|
||||||
int m_currentIndex;
|
int m_currentIndex;
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user