Skip to content

Commit 76dacca

Browse files
author
Anne Jan Brouwer
committed
Autoclear doesn't need clipboard
1 parent 2f9c6f7 commit 76dacca

File tree

2 files changed

+13
-11
lines changed

2 files changed

+13
-11
lines changed

mainwindow.cpp

+12-11
Original file line numberDiff line numberDiff line change
@@ -658,10 +658,6 @@ void MainWindow::readyRead(bool finished = false) {
658658
clippedPass = tokens[0];
659659
QTimer::singleShot(1000*autoclearSeconds, this, SLOT(clearClipboard()));
660660
}
661-
if (useAutoclearPanel) {
662-
QTimer::singleShot(1000*autoclearPanelSeconds, this, SLOT(clearPanel()));
663-
}
664-
665661
if (hidePassword && !useTemplate) {
666662
tokens[0] = "***" + tr("Password hidden") + "***";
667663
output = tokens.join("\n");
@@ -720,6 +716,10 @@ void MainWindow::readyRead(bool finished = false) {
720716
}
721717
ui->verticalLayoutPassword->setSpacing(0);
722718
}
719+
if (useAutoclearPanel) {
720+
autoclearPass = output;
721+
QTimer::singleShot(1000*autoclearPanelSeconds, this, SLOT(clearPanel()));
722+
}
723723
}
724724
output.replace(QRegExp("<"), "&lt;");
725725
output.replace(QRegExp(">"), "&gt;");
@@ -753,7 +753,6 @@ void MainWindow::readyRead(bool finished = false) {
753753

754754
/**
755755
* @brief MainWindow::clearClipboard
756-
* @TODO check clipboard content (only clear if contains the password)
757756
*/
758757
void MainWindow::clearClipboard()
759758
{
@@ -772,13 +771,15 @@ void MainWindow::clearClipboard()
772771
*/
773772
void MainWindow::clearPanel()
774773
{
775-
while(ui->formLayout->count() > 0){
776-
QLayoutItem *item = ui->formLayout->takeAt(0);
777-
delete item->widget();
778-
delete item;
774+
if (true) { // TODO when ??
775+
while(ui->formLayout->count() > 0){
776+
QLayoutItem *item = ui->formLayout->takeAt(0);
777+
delete item->widget();
778+
delete item;
779+
}
780+
QString output = "***" + tr("Password and Content hidden") + "***";
781+
ui->textBrowser->setHtml(output);
779782
}
780-
QString output = "***" + tr("Password and Content hidden") + "***";
781-
ui->textBrowser->setHtml(output);
782783
}
783784

784785
/**

mainwindow.h

+1
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ private slots:
106106
QString webDavPassword;
107107
QProcess fusedav;
108108
QString clippedPass;
109+
QString autoclearPass;
109110
actionType currentAction;
110111
QString lastDecrypt;
111112
bool wrapperRunning;

0 commit comments

Comments
 (0)