diff --git a/src/dialogs/AsyncTaskDialog.cpp b/src/dialogs/AsyncTaskDialog.cpp index 56240515..d34556d0 100644 --- a/src/dialogs/AsyncTaskDialog.cpp +++ b/src/dialogs/AsyncTaskDialog.cpp @@ -43,7 +43,7 @@ void AsyncTaskDialog::updateLog(const QString &log) void AsyncTaskDialog::updateProgressTimer() { - int secondsElapsed = (task->getTimer().elapsed() + 500) / 1000; + int secondsElapsed = (task->getElapsedTime() + 500) / 1000; int minutesElapsed = secondsElapsed / 60; int hoursElapsed = minutesElapsed / 60; @@ -57,6 +57,7 @@ void AsyncTaskDialog::updateProgressTimer() label += " "; } label += tr("%n seconds", "%n second", secondsElapsed % 60); + printf("setText %s\n", label.toLocal8Bit().constData()); ui->timeLabel->setText(label); } diff --git a/src/dialogs/OptionsDialog.cpp b/src/dialogs/OptionsDialog.cpp index 90d69a86..8987b33e 100644 --- a/src/dialogs/OptionsDialog.cpp +++ b/src/dialogs/OptionsDialog.cpp @@ -242,13 +242,13 @@ void OptionsDialog::setupAndStartAnalysis(int level, QList advanced) AsyncTask::Ptr analTaskPtr(analTask); - Core()->getAsyncTaskManager()->start(analTaskPtr); - AsyncTaskDialog *taskDialog = new AsyncTaskDialog(analTaskPtr); taskDialog->setInterruptOnClose(true); taskDialog->setAttribute(Qt::WA_DeleteOnClose); taskDialog->show(); + Core()->getAsyncTaskManager()->start(analTaskPtr); + done(0); } diff --git a/src/utils/AsyncTask.h b/src/utils/AsyncTask.h index d405f91c..306c1d50 100644 --- a/src/utils/AsyncTask.h +++ b/src/utils/AsyncTask.h @@ -33,6 +33,7 @@ public: const QString &getLog() { return logBuffer; } const QElapsedTimer &getTimer() { return timer; } + qint64 getElapsedTime() { return timer.isValid() ? timer.elapsed() : 0; } virtual QString getTitle() { return QString(); }