diff options
-rw-r--r-- | mainwindow.cpp | 9 | ||||
-rw-r--r-- | qtpass.iss | 2 | ||||
-rw-r--r-- | qtpass.pro | 2 | ||||
-rw-r--r-- | usersdialog.cpp | 14 | ||||
-rw-r--r-- | usersdialog.h | 3 |
5 files changed, 21 insertions, 9 deletions
diff --git a/mainwindow.cpp b/mainwindow.cpp index 9e719643..715702d2 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -740,12 +740,7 @@ void MainWindow::setGitExecutable(QString path) { } /** - * @briefUsersDialog d(this); - d.setUsers(&users); - if (!d.exec()) { - d.setUsers(NULL); - return; - } MainWindow::setGpgExecutable + * @brief MainWindow::setGpgExecutable * @param path */ void MainWindow::setGpgExecutable(QString path) { @@ -1079,6 +1074,8 @@ QList<UserInfo> MainWindow::listKeys(QString keystring, bool secret) current_user.key_id = props[4]; current_user.name = props[9]; current_user.validity = props[8][0].toLatin1(); + current_user.created.setTime_t(props[5].toInt()); + current_user.expiry.setTime_t(props[6].toInt()); } else if (current_user.name.isEmpty() && props[0] == "uid") { current_user.name = props[9]; } @@ -2,7 +2,7 @@ ; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
#define MyAppName "QtPass"
-#define MyAppVersion "0.9.1"
+#define MyAppVersion "0.9.2"
#define MyAppPublisher "IJhack"
#define MyAppURL "http://qtpass.org/"
#define MyAppExeName "qtpass.exe"
@@ -18,7 +18,7 @@ macx { } TEMPLATE = app -VERSION = 0.9.1 +VERSION = 0.9.2 SOURCES += main.cpp\ mainwindow.cpp \ diff --git a/usersdialog.cpp b/usersdialog.cpp index 59d21b50..ed826fa0 100644 --- a/usersdialog.cpp +++ b/usersdialog.cpp @@ -1,6 +1,7 @@ #include "usersdialog.h" #include "ui_usersdialog.h" #include <QRegExp> +#include <QDebug> UsersDialog::UsersDialog(QWidget *parent) : QDialog(parent), @@ -47,7 +48,18 @@ void UsersDialog::populateList(const QString &filter) if (user.validity == '-' && !ui->checkBox->isChecked()) { continue; } - QListWidgetItem *item = new QListWidgetItem(user.name + "\n" + user.key_id, ui->listWidget); + if (user.expiry.toTime_t() > 0 && user.expiry.daysTo(QDateTime::currentDateTime()) > 0 && !ui->checkBox->isChecked()) { + continue; + } + QString userText = user.name + "\n" + user.key_id; + if (user.created.toTime_t() > 0) { + userText += " " + tr("created") + " " + user.created.toString(Qt::SystemLocaleShortDate); + + } + if (user.expiry.toTime_t() > 0) { + userText += " " + tr("expires") + " " + user.expiry.toString(Qt::SystemLocaleShortDate); + } + QListWidgetItem *item = new QListWidgetItem(userText, ui->listWidget); item->setCheckState(user.enabled ? Qt::Checked : Qt::Unchecked); item->setData(Qt::UserRole, QVariant::fromValue(&user)); if (user.have_secret) { diff --git a/usersdialog.h b/usersdialog.h index ab3c8233..5f3793be 100644 --- a/usersdialog.h +++ b/usersdialog.h @@ -5,6 +5,7 @@ #include <QList> #include <QStandardItemModel> #include <QCloseEvent> +#include <QDateTime> namespace Ui { class UsersDialog; @@ -19,6 +20,8 @@ struct UserInfo { char validity; bool have_secret; bool enabled; + QDateTime expiry; + QDateTime created; }; class UsersDialog : public QDialog |