NOISSUE some safe refactors and changes of the task subsystem

Possibly also some bug fixes.
This commit is contained in:
Petr Mrázek
2017-06-26 01:14:32 +02:00
parent 2973b11d3e
commit 89d3a66658
18 changed files with 94 additions and 167 deletions

View File

@ -33,7 +33,7 @@ QString GuiUtil::uploadPaste(const QString &text, QWidget *parentWidget)
}
dialog.execWithTask(paste.get());
if (!paste->successful())
if (!paste->wasSuccessful())
{
CustomMessageBox::selectable(parentWidget, QObject::tr("Upload failed"),
paste->failReason(), QMessageBox::Critical)->exec();

View File

@ -103,7 +103,7 @@ void LaunchController::login()
progDialog.setSkipButton(true, tr("Play Offline"));
}
progDialog.execWithTask(task.get());
if (!task->successful())
if (!task->wasSuccessful())
{
auto failReasonNew = task->failReason();
if(failReasonNew == "Invalid token.")

View File

@ -116,7 +116,7 @@ bool ProgressDialog::handleImmediateResult(QDialog::DialogCode &result)
{
if(task->isFinished())
{
if(task->successful())
if(task->wasSuccessful())
{
result = QDialog::Accepted;
}

View File

@ -48,12 +48,12 @@ bool ProgressWidget::exec(std::shared_ptr<Task> task)
{
loop.exec();
}
return task->successful();
return task->wasSuccessful();
}
void ProgressWidget::handleTaskFinish()
{
if (!m_task->successful())
if (!m_task->wasSuccessful())
{
m_label->setText(m_task->failReason());
}