Permalink
Browse files

Stop timer when new task starts

  • Loading branch information...
annejan committed Nov 17, 2015
1 parent 4e7ac13 commit a8fa7b2cfa8157522966966cef6d41939737771a
Showing with 8 additions and 4 deletions.
  1. +8 −4 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);

0 comments on commit a8fa7b2

Please sign in to comment.