Propagate task warnings
Signed-off-by: TheKodeToad <TheKodeToad@proton.me>
This commit is contained in:
@@ -212,6 +212,7 @@ void InstanceImportTask::processZipPack()
|
|||||||
progressStep->status = status;
|
progressStep->status = status;
|
||||||
stepProgress(*progressStep);
|
stepProgress(*progressStep);
|
||||||
});
|
});
|
||||||
|
connect(zipTask.get(), &Task::warningLogged, this, [this](const QString& line) { m_Warnings.append(line); });
|
||||||
m_task.reset(zipTask);
|
m_task.reset(zipTask);
|
||||||
zipTask->start();
|
zipTask->start();
|
||||||
}
|
}
|
||||||
@@ -308,6 +309,8 @@ void InstanceImportTask::processFlame()
|
|||||||
connect(inst_creation_task.get(), &Task::aborted, this, &Task::abort);
|
connect(inst_creation_task.get(), &Task::aborted, this, &Task::abort);
|
||||||
connect(inst_creation_task.get(), &Task::abortStatusChanged, this, &Task::setAbortable);
|
connect(inst_creation_task.get(), &Task::abortStatusChanged, this, &Task::setAbortable);
|
||||||
|
|
||||||
|
connect(inst_creation_task.get(), &Task::warningLogged, this, [this](const QString& line) { m_Warnings.append(line); });
|
||||||
|
|
||||||
m_task.reset(inst_creation_task);
|
m_task.reset(inst_creation_task);
|
||||||
setAbortable(true);
|
setAbortable(true);
|
||||||
m_task->start();
|
m_task->start();
|
||||||
@@ -407,6 +410,8 @@ void InstanceImportTask::processModrinth()
|
|||||||
connect(inst_creation_task.get(), &Task::aborted, this, &Task::abort);
|
connect(inst_creation_task.get(), &Task::aborted, this, &Task::abort);
|
||||||
connect(inst_creation_task.get(), &Task::abortStatusChanged, this, &Task::setAbortable);
|
connect(inst_creation_task.get(), &Task::abortStatusChanged, this, &Task::setAbortable);
|
||||||
|
|
||||||
|
connect(inst_creation_task.get(), &Task::warningLogged, this, [this](const QString& line) { m_Warnings.append(line); });
|
||||||
|
|
||||||
m_task.reset(inst_creation_task);
|
m_task.reset(inst_creation_task);
|
||||||
setAbortable(true);
|
setAbortable(true);
|
||||||
m_task->start();
|
m_task->start();
|
||||||
|
|||||||
@@ -196,6 +196,8 @@ void Task::logWarning(const QString& line)
|
|||||||
{
|
{
|
||||||
qWarning() << line;
|
qWarning() << line;
|
||||||
m_Warnings.append(line);
|
m_Warnings.append(line);
|
||||||
|
|
||||||
|
emit warningLogged(line);
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList Task::warnings() const
|
QStringList Task::warnings() const
|
||||||
|
|||||||
@@ -145,6 +145,7 @@ class Task : public QObject, public QRunnable {
|
|||||||
void failed(QString reason);
|
void failed(QString reason);
|
||||||
void status(QString status);
|
void status(QString status);
|
||||||
void details(QString details);
|
void details(QString details);
|
||||||
|
void warningLogged(const QString& warning);
|
||||||
void stepProgress(TaskStepProgress const& task_progress);
|
void stepProgress(TaskStepProgress const& task_progress);
|
||||||
|
|
||||||
//! Emitted when the canAbort() status has changed. */
|
//! Emitted when the canAbort() status has changed. */
|
||||||
|
|||||||
Reference in New Issue
Block a user