diff options
author | nils <nils@34ebc366-c3a9-4b3c-9f84-69acf7962910> | 2011-11-15 21:34:26 +0000 |
---|---|---|
committer | nils <nils@34ebc366-c3a9-4b3c-9f84-69acf7962910> | 2011-11-15 21:34:26 +0000 |
commit | 3f17b46e96252d875b530168d19be2120b684a16 (patch) | |
tree | bc62b060dcf8705d48651cdcdae4fbff341e8d31 | |
parent | also show warning in keydetail dialog, if key is revoked (diff) | |
download | gpg4usb-3f17b46e96252d875b530168d19be2120b684a16.tar.gz gpg4usb-3f17b46e96252d875b530168d19be2120b684a16.zip |
bugfix in striking out revoked keys in keyserverimport and little bigfix in keydetailsdialog
git-svn-id: http://cpunk.de/svn/src/gpg4usb/trunk@620 34ebc366-c3a9-4b3c-9f84-69acf7962910
-rw-r--r-- | keydetailsdialog.cpp | 5 | ||||
-rw-r--r-- | keyserverimportdialog.cpp | 25 |
2 files changed, 22 insertions, 8 deletions
diff --git a/keydetailsdialog.cpp b/keydetailsdialog.cpp index 5fd01f2..c2de5e4 100644 --- a/keydetailsdialog.cpp +++ b/keydetailsdialog.cpp @@ -133,12 +133,13 @@ KeyDetailsDialog::KeyDetailsDialog(GpgME::GpgContext* ctx, gpgme_key_t key, QWid QIcon icon = QIcon::fromTheme("dialog-warning"); QPixmap pixmap = icon.pixmap(QSize(32,32),QIcon::Normal,QIcon::On); + QLabel *expLabel; QLabel *iconLabel = new QLabel(); if (key->expired) { - QLabel *expLabel = new QLabel(tr("Warning: Key expired")); + expLabel = new QLabel(tr("Warning: Key expired")); } if (key->revoked) { - QLabel *expLabel = new QLabel(tr("Warning: Key revoked")); + expLabel = new QLabel(tr("Warning: Key revoked")); } iconLabel->setPixmap(pixmap); diff --git a/keyserverimportdialog.cpp b/keyserverimportdialog.cpp index 1e85e69..28db768 100644 --- a/keyserverimportdialog.cpp +++ b/keyserverimportdialog.cpp @@ -176,33 +176,41 @@ void KeyServerImportDialog::searchFinished() } else { int row = 0; char buff[1024]; - QList <QTreeWidgetItem*> items; + bool strikeout=false; while (reply->readLine(buff,sizeof(buff)) !=-1) { QStringList line= QString(buff).split(":"); + //TODO: have a look at two following pub lines if (line[0] == "pub") { + strikeout=false; + QString flags = line[line.size()-1]; // flags can be "d" for disabled, "r" for revoked // or "e" for expired if (flags.contains("r")) { - qDebug() << "revoked"; + strikeout=true; } keysTable->setRowCount(row+1); QStringList line2 = QString(reply->readLine()).split(":"); + QTableWidgetItem *uid; if (line2.size() > 1) { - QTableWidgetItem *uid = new QTableWidgetItem(line2[1]); + uid = new QTableWidgetItem(line2[1]); keysTable->setItem(row, 0, uid); - QFont strike = uid->font(); - strike.setStrikeOut(true); - uid->setFont(strike); } QTableWidgetItem *creationdate = new QTableWidgetItem(QDateTime::fromTime_t(line[4].toInt()).toString("dd. MMM. yyyy")); keysTable->setItem(row, 1, creationdate); QTableWidgetItem *keyid = new QTableWidgetItem(line[1]); keysTable->setItem(row, 2, keyid); + if (strikeout) { + QFont strike = uid->font(); + strike.setStrikeOut(true); + uid->setFont(strike); + creationdate->setFont(strike); + keyid->setFont(strike); + } row++; } else { if (line[0] == "uid") { @@ -213,6 +221,11 @@ void KeyServerImportDialog::searchFinished() tmp.append(QString("\n")+line[1]); QTableWidgetItem *tmp1 = new QTableWidgetItem(tmp); keysTable->setItem(row-1,0,tmp1); + if (strikeout) { + QFont strike = tmp1->font(); + strike.setStrikeOut(true); + tmp1->setFont(strike); + } } } setMessage(tr("%1 keys found. Doubleclick a key to import it.").arg(row),false); |