diff options
author | Anne Jan Brouwer <brouwer@annejan.com> | 2016-06-11 02:35:41 +0200 |
---|---|---|
committer | Anne Jan Brouwer <brouwer@annejan.com> | 2016-06-11 02:35:41 +0200 |
commit | 6463d83d20ac164b0cc808829e71f02052060513 (patch) | |
tree | 36a45d24a9e5a11b153dcdbf0f661575f8fa5718 | |
parent | f079f317c323e5e8b330cdd8d069f7d886a0e074 (diff) |
Cleanup
-rw-r--r-- | mainwindow.cpp | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/mainwindow.cpp b/mainwindow.cpp index 231e9c1b..d64771d7 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -1904,18 +1904,8 @@ void MainWindow::reencryptPath(QString dir) { while (gpgFiles.hasNext()) { QString fileName = gpgFiles.next(); if (gpgFiles.fileInfo().path() != currentDir.path()) { - QFile file(gpgFiles.fileInfo().path() + "/.gpg-id"); - if (file.open(QIODevice::ReadOnly | QIODevice::Text)) { - gpgId.clear(); - QTextStream in(&file); - while (!in.atEnd()) { - gpgId << in.readLine(); - } - gpgId.sort(); - currentDir.setPath(gpgFiles.fileInfo().path()); - qDebug() << "folder changed to " + currentDir.path(); - } - // @TODO(annejan) recursive down if not found instead? + gpgId = getRecipientList(fileName); + gpgId.sort(); } currentAction = GPG_INTERNAL; process->waitForFinished(); @@ -1937,8 +1927,8 @@ void MainWindow::reencryptPath(QString dir) { } actualKeys.sort(); if (actualKeys != gpgId) { - qDebug() << actualKeys << gpgId << getRecipientList(fileName); - //qDebug() << "reencrypt " << fileName << " for " << gpgId; + //qDebug() << actualKeys << gpgId << getRecipientList(fileName); + qDebug() << "reencrypt " << fileName << " for " << gpgId; lastDecrypt = "Could not decrypt"; currentAction = GPG_INTERNAL; executeWrapper(gpgExecutable, @@ -1961,15 +1951,17 @@ void MainWindow::reencryptPath(QString dir) { currentAction = EDIT; executeWrapper(gpgExecutable, "--yes --batch -eq --output \"" + fileName + "\" " + recipients + " -", lastDecrypt); + process->waitForFinished(3000); + if (!useWebDav && useGit) { - process->waitForFinished(3000); executeWrapper(gitExecutable, "add \"" + fileName + '"'); QString path = QDir(passStore).relativeFilePath(fileName); path.replace(QRegExp("\\.gpg$"), ""); executeWrapper(gitExecutable, "commit \"" + fileName + "\" -m \"" + "Edit for " + path + " using QtPass.\""); + process->waitForFinished(3000); } - process->waitForFinished(3000); + } else { qDebug() << "Decrypt error on re-encrypt"; } |