diff options
author | Anne Jan Brouwer <annejan@noprotocol.com> | 2015-11-17 23:29:29 +0100 |
---|---|---|
committer | Anne Jan Brouwer <annejan@noprotocol.com> | 2015-11-17 23:29:29 +0100 |
commit | a8fa7b2cfa8157522966966cef6d41939737771a (patch) | |
tree | af60b6f2b1cf6f9d630b920cdfbf4e68efce99e0 | |
parent | 4e7ac13c629a3f7484f93b15686120fcdc370bf2 (diff) |
Stop timer when new task starts
-rw-r--r-- | mainwindow.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/mainwindow.cpp b/mainwindow.cpp index 90b18f4d..2847acfc 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -589,6 +589,9 @@ void MainWindow::executePass(QString args, QString input) { executeWrapper(passExecutable, args, input); } +/** + * @brief MainWindow::executePassGitInit + */ void MainWindow::executePassGitInit() { qDebug() << "Pass git init called"; if (usePass) { @@ -631,6 +634,11 @@ void MainWindow::executeWrapper(QString app, QString args, QString input) { ui->textBrowser->clear(); ui->textBrowser->setTextColor(Qt::black); enableUiElements(false); + if (autoclearTimer != NULL) { + autoclearTimer->stop(); + delete autoclearTimer; + autoclearTimer = NULL; + } process->start('"' + app + "\" " + args); if (!input.isEmpty()) { process->write(input.toUtf8()); @@ -715,10 +723,6 @@ void MainWindow::readyRead(bool finished = false) { } if (useAutoclearPanel) { autoclearPass = output; - if (autoclearTimer != NULL) { - autoclearTimer->stop(); - - } autoclearTimer = new QTimer(this); autoclearTimer->setSingleShot(true); autoclearTimer->setInterval(1000*autoclearPanelSeconds); |