aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorubbo <ubbo@34ebc366-c3a9-4b3c-9f84-69acf7962910>2012-11-05 20:57:19 +0000
committerubbo <ubbo@34ebc366-c3a9-4b3c-9f84-69acf7962910>2012-11-05 20:57:19 +0000
commit315de722598a624e96d7288ac9ec67344b4faa5c (patch)
tree9b9192069558688f3da8a350f29eb2b9f16bf949
parenti18nc() has opposite order of strings than tr() (diff)
downloadgpg4usb-315de722598a624e96d7288ac9ec67344b4faa5c.tar.gz
gpg4usb-315de722598a624e96d7288ac9ec67344b4faa5c.zip
keysize & date in detailsdialog
git-svn-id: http://cpunk.de/svn/src/gpg4usb/trunk@1002 34ebc366-c3a9-4b3c-9f84-69acf7962910
-rw-r--r--keydetailsdialog.cpp23
-rw-r--r--kgpg/core/convert.cpp4
2 files changed, 5 insertions, 22 deletions
diff --git a/keydetailsdialog.cpp b/keydetailsdialog.cpp
index bf6cb5f..badb6c7 100644
--- a/keydetailsdialog.cpp
+++ b/keydetailsdialog.cpp
@@ -51,31 +51,16 @@ KeyDetailsDialog::KeyDetailsDialog(GpgME::GpgContext* ctx, KgpgCore::KgpgKey key
if (key.expirationDate().isNull()) {
keyExpireVal = tr("Never");
} else {
- keyExpireVal = key.expirationDate().toString("dd. MMM. yyyy");
+ keyExpireVal = KgpgCore::Convert::toString(key.expirationDate().date());
}
- //keyAlgoVal = key.algorithm();
- // TODO: algorithm
keyAlgoVal = KgpgCore::Convert::toString(key.algorithm()) + QLatin1String( " / " ) + KgpgCore::Convert::toString(key.encryptionAlgorithm());
+ keyCreatedVal = KgpgCore::Convert::toString(key.creationDate().date());
- qDebug() << key.algorithm();
- keyCreatedVal = key.creationDate().toString("dd. MMM. yyyy");
-
- // have el-gamal key?
- /*if (key->subkeys->next) {
- keySizeVal.sprintf("%d / %d", int(key->subkeys->length), int(key->subkeys->next->length));
- if (key->subkeys->next->expires == 0) {
- keyExpireVal += tr(" / Never");
- } else {
- keyExpireVal += " / " + QDateTime::fromTime_t(key->subkeys->next->expires).toString("dd. MMM. yyyy");
- }
- keyAlgoVal.append(" / ").append(gpgme_pubkey_algo_name(key->subkeys->next->pubkey_algo));
- keyCreatedVal += " / " + QDateTime::fromTime_t(key->subkeys->next->timestamp).toString("dd. MMM. yyyy");
- } else {
- keySizeVal.setNum(int(key->subkeys->length));
- }*/
+ keySizeVal = QString::number(key.size()) + "/" + QString::number(key.encryptionSize());
keySizeVarLabel = new QLabel(keySizeVal);
+ keySizeVarLabel->setWhatsThis(tr("<qt>The left part is the algorithm used by the <b>signature</b> key. The right part is the algorithm used by the <b>encryption</b> key.</qt>"));
expireVarLabel = new QLabel(keyExpireVal);
createdVarLabel = new QLabel(keyCreatedVal);
algorithmVarLabel = new QLabel(keyAlgoVal);
diff --git a/kgpg/core/convert.cpp b/kgpg/core/convert.cpp
index d27850c..8658b67 100644
--- a/kgpg/core/convert.cpp
+++ b/kgpg/core/convert.cpp
@@ -98,9 +98,7 @@ QColor Convert::toColor(const KgpgKeyTrust trust)
QString Convert::toString(const QDate &date)
{
- // TODO
- //return KGlobal::locale()->formatDate(date, KLocale::ShortDate);
- return "TODO";
+ return date.toString("dd. MMM. yyyy");
}
KgpgKeyAlgo Convert::toAlgo(const uint v)