Sync from quickmods

This commit is contained in:
Petr Mrázek
2014-09-06 18:16:56 +02:00
parent 36efcf8d3c
commit 20cb97a35a
57 changed files with 569 additions and 326 deletions

View File

@ -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 &current, 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";