diff options
-rw-r--r-- | CHANGELOG.md | 4 | ||||
-rw-r--r-- | src/mainwindow.cpp | 2 | ||||
-rw-r--r-- | src/pass.cpp | 66 | ||||
-rw-r--r-- | src/pass.h | 5 |
4 files changed, 41 insertions, 36 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 30fd22b2..3aba27c4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,10 @@ - Compiling for Linux Mint 18 Ubuntu 16 [\#357](https://github.com/IJHack/QtPass/issues/357) - \[OS X\] Password input dialog suddenly stopped popping up [\#191](https://github.com/IJHack/QtPass/issues/191) +**Merged pull requests:** + +- \#390 make box cheched when opening a folder users panel [\#403](https://github.com/IJHack/QtPass/pull/403) ([kenji21](https://github.com/kenji21)) + ## [v1.2.3](https://github.com/IJHack/QtPass/tree/v1.2.3) (2018-06-04) [Full Changelog](https://github.com/IJHack/QtPass/compare/v1.2.2...v1.2.3) diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 8cf39908..14f14038 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -1007,7 +1007,7 @@ void MainWindow::onUsers() { users.append(i); } } - } + } UsersDialog d(this); d.setUsers(&users); if (!d.exec()) { diff --git a/src/pass.cpp b/src/pass.cpp index 2586b252..397d0e37 100644 --- a/src/pass.cpp +++ b/src/pass.cpp @@ -118,41 +118,41 @@ void Pass::GenerateGPGKeys(QString batch) { * @return QList<UserInfo> users */ QList<UserInfo> Pass::listKeys(QStringList keystrings, bool secret) { - QList<UserInfo> users; - QStringList args = {"--no-tty", "--with-colons"}; - args.append(secret ? "--list-secret-keys" : "--list-keys"); + QList<UserInfo> users; + QStringList args = {"--no-tty", "--with-colons"}; + args.append(secret ? "--list-secret-keys" : "--list-keys"); - foreach (QString keystring, keystrings) { - if(!keystring.isEmpty()) { - args.append(keystring); - } + foreach (QString keystring, keystrings) { + if (!keystring.isEmpty()) { + args.append(keystring); } - QString p_out; - if (exec.executeBlocking(QtPassSettings::getGpgExecutable(), args, &p_out) != - 0) - return users; - QStringList keys = p_out.split(QRegExp("[\r\n]"), QString::SkipEmptyParts); - UserInfo current_user; - foreach (QString key, keys) { - QStringList props = key.split(':'); - if (props.size() < 10) - continue; - if (props[0] == (secret ? "sec" : "pub")) { - if (!current_user.key_id.isEmpty()) - users.append(current_user); - current_user = UserInfo(); - current_user.key_id = props[4]; - current_user.name = props[9].toUtf8(); - current_user.validity = props[1][0].toLatin1(); - current_user.created.setTime_t(props[5].toUInt()); - current_user.expiry.setTime_t(props[6].toUInt()); - } else if (current_user.name.isEmpty() && props[0] == "uid") { - current_user.name = props[9]; - } - } - if (!current_user.key_id.isEmpty()) - users.append(current_user); + } + QString p_out; + if (exec.executeBlocking(QtPassSettings::getGpgExecutable(), args, &p_out) != + 0) return users; + QStringList keys = p_out.split(QRegExp("[\r\n]"), QString::SkipEmptyParts); + UserInfo current_user; + foreach (QString key, keys) { + QStringList props = key.split(':'); + if (props.size() < 10) + continue; + if (props[0] == (secret ? "sec" : "pub")) { + if (!current_user.key_id.isEmpty()) + users.append(current_user); + current_user = UserInfo(); + current_user.key_id = props[4]; + current_user.name = props[9].toUtf8(); + current_user.validity = props[1][0].toLatin1(); + current_user.created.setTime_t(props[5].toUInt()); + current_user.expiry.setTime_t(props[6].toUInt()); + } else if (current_user.name.isEmpty() && props[0] == "uid") { + current_user.name = props[9]; + } + } + if (!current_user.key_id.isEmpty()) + users.append(current_user); + return users; } /** @@ -281,7 +281,7 @@ QStringList Pass::getRecipientList(QString for_file) { * @return recepient string */ QStringList Pass::getRecipientString(QString for_file, QString separator, - int *count) { + int *count) { return Pass::getRecipientList(for_file); } @@ -59,8 +59,9 @@ public: void updateEnv(); static QStringList getRecipientList(QString for_file); // TODO(bezet): getRecipientString is useless, refactor - static QStringList getRecipientString(QString for_file, QString separator = " ", - int *count = NULL); + static QStringList getRecipientString(QString for_file, + QString separator = " ", + int *count = NULL); protected: void executeWrapper(PROCESS id, const QString &app, const QStringList &args, |