Sync from quickmods
This commit is contained in:
@ -20,29 +20,16 @@ Task::Task(QObject *parent) : ProgressProvider(parent)
|
||||
{
|
||||
}
|
||||
|
||||
QString Task::getStatus() const
|
||||
{
|
||||
return m_statusString;
|
||||
}
|
||||
|
||||
void Task::setStatus(const QString &new_status)
|
||||
{
|
||||
m_statusString = new_status;
|
||||
emit status(new_status);
|
||||
}
|
||||
|
||||
void Task::setProgress(int new_progress)
|
||||
{
|
||||
m_progress = new_progress;
|
||||
emit progress(new_progress, 100);
|
||||
}
|
||||
|
||||
void Task::getProgress(qint64 ¤t, qint64 &total)
|
||||
{
|
||||
current = m_progress;
|
||||
total = 100;
|
||||
}
|
||||
|
||||
void Task::start()
|
||||
{
|
||||
m_running = true;
|
||||
@ -61,6 +48,7 @@ void Task::emitFailed(QString reason)
|
||||
|
||||
void Task::emitSucceeded()
|
||||
{
|
||||
if (!m_running) { return; } // Don't succeed twice.
|
||||
m_running = false;
|
||||
m_succeeded = true;
|
||||
QLOG_INFO() << "Task succeeded";
|
||||
|
Reference in New Issue
Block a user