diff options
author | tezeb <tezeb+github@outoftheblue.pl> | 2017-01-11 00:04:46 +0100 |
---|---|---|
committer | tezeb <tezeb+github@outoftheblue.pl> | 2017-01-11 00:04:46 +0100 |
commit | f457b6fbfe1e55f0cd9a2db615e5583cdd6259fa (patch) | |
tree | cf9c4b5cd5a955d947a1fc413207a6290dcd7b55 /src | |
parent | d12d945631ce76bf90bfc7a6c1efd1db498c65d4 (diff) |
automate GitPush & minor fixes
Diffstat (limited to 'src')
-rw-r--r-- | src/imitatepass.cpp | 9 | ||||
-rw-r--r-- | src/mainwindow.cpp | 16 | ||||
-rw-r--r-- | src/mainwindow.h | 3 |
3 files changed, 5 insertions, 23 deletions
diff --git a/src/imitatepass.cpp b/src/imitatepass.cpp index adf367a2..9a9b7e6f 100644 --- a/src/imitatepass.cpp +++ b/src/imitatepass.cpp @@ -295,6 +295,7 @@ void ImitatePass::reencryptPath(QString dir) { } if (QtPassSettings::isAutoPush()) { emit statusMsg(tr("Updating password-store"), 2000); + // TODO(bezet): this is non-blocking and shall be done outside GitPush(); } emit endReencryptPath(); @@ -317,10 +318,6 @@ void ImitatePass::Move(const QString src, const QString dest, QString message = QString("moved from %1 to %2 using QTPass."); message = message.arg(src).arg(dest); GitCommit("", message); - if (QtPassSettings::isAutoPush()) { - GitPush(); - } - } else { QDir qDir; QFileInfo srcFileInfo(src); @@ -359,10 +356,6 @@ void ImitatePass::Copy(const QString src, const QString dest, QString message = QString("copied from %1 to %2 using QTPass."); message = message.arg(src).arg(dest); GitCommit("", message); - if (QtPassSettings::isAutoPush()) { - GitPush(); - } - } else { QDir qDir; if (force) { diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 06232102..0ffe643b 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -541,9 +541,8 @@ void MainWindow::on_updateButton_clicked(bool block) { * @brief MainWindow::on_pushButton_clicked do a git push */ void MainWindow::on_pushButton_clicked() { - if (QtPassSettings::isUseGit() && QtPassSettings::isAutoPush()) { + if (QtPassSettings::isUseGit()) { ui->statusBar->showMessage(tr("Updating password-store"), 2000); - currentAction = GIT; QtPassSettings::getPass()->GitPush(); } } @@ -956,8 +955,6 @@ void MainWindow::setPassword(QString file, bool isNew) { newValue += "\n"; QtPassSettings::getPass()->Insert(file, newValue, !isNew); - - on_pushButton_clicked(); } /** @@ -966,8 +963,8 @@ void MainWindow::setPassword(QString file, bool isNew) { */ void MainWindow::on_addButton_clicked() { bool ok; - QString dir = Util::getDir(ui->treeView->currentIndex(), - QtPassSettings::isUsePass(), model, proxyModel); + QString dir = + Util::getDir(ui->treeView->currentIndex(), true, model, proxyModel); QString file = QInputDialog::getText( this, tr("New file"), tr("New password file: \n(Will be placed in %1 )") .arg(QtPassSettings::getPassStore() + @@ -993,8 +990,7 @@ void MainWindow::on_deleteButton_clicked() { if (fileOrFolder.isFile()) { file = getFile(ui->treeView->currentIndex(), true); } else { - file = Util::getDir(ui->treeView->currentIndex(), - QtPassSettings::isUsePass(), model, proxyModel); + file = Util::getDir(ui->treeView->currentIndex(), true, model, proxyModel); isDir = true; } @@ -1007,8 +1003,6 @@ void MainWindow::on_deleteButton_clicked() { return; QtPassSettings::getPass()->Remove(file, isDir); - - on_pushButton_clicked(); } /** @@ -1085,8 +1079,6 @@ void MainWindow::on_usersButton_clicked() { d.setUsers(NULL); QtPassSettings::getPass()->Init(dir, users); - - on_pushButton_clicked(); } /** diff --git a/src/mainwindow.h b/src/mainwindow.h index 7122a5b3..9d3434f7 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -42,8 +42,6 @@ class MainWindow; class MainWindow : public QMainWindow { Q_OBJECT - enum actionType { GPG, GIT, EDIT, REMOVE, GPG_INTERNAL, PWGEN }; - public: explicit MainWindow(QWidget *parent = 0); ~MainWindow(); @@ -124,7 +122,6 @@ private: QString clippedText; QTimer clearPanelTimer; QTimer clearClipboardTimer; - actionType currentAction; bool freshStart; QDialog *keygen; QString currentDir; |