Fix AsyncTaskDialog::interruptOnClose initialization

This commit is contained in:
Florian Märkl 2018-06-26 22:11:26 +02:00
parent dd7a5f4eb6
commit a076b2ef7b
2 changed files with 5 additions and 1 deletions

View File

@ -21,6 +21,9 @@ public:
AsyncTaskDialog(AsyncTask::Ptr task, QWidget *parent = nullptr); AsyncTaskDialog(AsyncTask::Ptr task, QWidget *parent = nullptr);
~AsyncTaskDialog(); ~AsyncTaskDialog();
void setInterruptOnClose(bool v) { interruptOnClose = v; }
bool getInterruptOnClose() { return interruptOnClose; }
public slots: public slots:
void reject() override; void reject() override;
@ -36,7 +39,7 @@ private:
AsyncTask::Ptr task; AsyncTask::Ptr task;
QTimer timer; QTimer timer;
bool interruptOnClose; bool interruptOnClose = false;
}; };
#endif //ASYNCTASKDIALOG_H #endif //ASYNCTASKDIALOG_H

View File

@ -245,6 +245,7 @@ void OptionsDialog::setupAndStartAnalysis(int level, QList<QString> advanced)
Core()->getAsyncTaskManager()->start(analTaskPtr); Core()->getAsyncTaskManager()->start(analTaskPtr);
AsyncTaskDialog *taskDialog = new AsyncTaskDialog(analTaskPtr); AsyncTaskDialog *taskDialog = new AsyncTaskDialog(analTaskPtr);
taskDialog->setInterruptOnClose(true);
taskDialog->setAttribute(Qt::WA_DeleteOnClose); taskDialog->setAttribute(Qt::WA_DeleteOnClose);
taskDialog->show(); taskDialog->show();