From 3b9c58558c019088b8aafe9de255a797e5694f01 Mon Sep 17 00:00:00 2001 From: nils Date: Wed, 16 Nov 2011 20:57:51 +0000 Subject: bugfix in striking out revoked keys in keyserverimport git-svn-id: http://cpunk.de/svn/src/gpg4usb/branches/0.3.1@622 34ebc366-c3a9-4b3c-9f84-69acf7962910 --- keyserverimportdialog.cpp | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/keyserverimportdialog.cpp b/keyserverimportdialog.cpp index b545e1b..d37ec32 100644 --- a/keyserverimportdialog.cpp +++ b/keyserverimportdialog.cpp @@ -176,33 +176,41 @@ void KeyServerImportDialog::searchFinished() } else { int row = 0; char buff[1024]; - QList 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); -- cgit v1.2.3