Skip to content

Commit

Permalink
reset the timer, should I (needlessly) do this for the clipboard too?
Browse files Browse the repository at this point in the history
  • Loading branch information
annejan committed Nov 17, 2015
1 parent 76dacca commit 1fa596d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 10 additions & 1 deletion mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ MainWindow::MainWindow(QWidget *parent) :
QApplication::quit();
}
QtPass = NULL;
autoclearTimer = NULL;
QTimer::singleShot(10, this, SLOT(focusInput()));

}
Expand Down Expand Up @@ -718,7 +719,15 @@ void MainWindow::readyRead(bool finished = false) {
}
if (useAutoclearPanel) {
autoclearPass = output;
QTimer::singleShot(1000*autoclearPanelSeconds, this, SLOT(clearPanel()));
if (autoclearTimer != NULL) {
autoclearTimer->stop();

}
autoclearTimer = new QTimer(this);
autoclearTimer->setSingleShot(true);
autoclearTimer->setInterval(1000*autoclearPanelSeconds);
connect(autoclearTimer, SIGNAL(timeout()), this, SLOT(clearPanel()));
autoclearTimer->start();
}
}
output.replace(QRegExp("<"), "&lt;");
Expand Down
2 changes: 2 additions & 0 deletions mainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include <QProcess>
#include <QQueue>
#include <QSettings>
#include <QTimer>
#include "storemodel.h"
#include "trayicon.h"
#if SINGLE_APP
Expand Down Expand Up @@ -107,6 +108,7 @@ private slots:
QProcess fusedav;
QString clippedPass;
QString autoclearPass;
QTimer *autoclearTimer;
actionType currentAction;
QString lastDecrypt;
bool wrapperRunning;
Expand Down

0 comments on commit 1fa596d

Please sign in to comment.