aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorubbo <ubbo@34ebc366-c3a9-4b3c-9f84-69acf7962910>2011-12-28 16:08:11 +0000
committerubbo <ubbo@34ebc366-c3a9-4b3c-9f84-69acf7962910>2011-12-28 16:08:11 +0000
commitd58f33414bf3d66a36313682ee61708bed17d7fc (patch)
tree532306adb5dc658252527712a2a4bf71bc55bc8c
parentreturn empty key if nothing found (diff)
downloadgpg4usb-d58f33414bf3d66a36313682ee61708bed17d7fc.tar.gz
gpg4usb-d58f33414bf3d66a36313682ee61708bed17d7fc.zip
use getKeyByXXX from gpgcontext now, drop methods from keylist
git-svn-id: http://cpunk.de/svn/src/gpg4usb/trunk@711 34ebc366-c3a9-4b3c-9f84-69acf7962910
-rw-r--r--keylist.cpp35
-rw-r--r--keylist.h2
-rw-r--r--verifykeydetailbox.cpp4
-rw-r--r--verifynotification.cpp4
4 files changed, 4 insertions, 41 deletions
diff --git a/keylist.cpp b/keylist.cpp
index 37e948e..49dcab6 100644
--- a/keylist.cpp
+++ b/keylist.cpp
@@ -114,41 +114,6 @@ void KeyList::refresh()
setChecked(keyList);
}
-/**
- * note: privkey status is not returned
- */
-GpgKey KeyList::getKeyByFpr(QString fpr) {
- GpgKey key;
- for (int i = 0; i < mKeyList->rowCount(); i++) {
- if (mKeyList->item(i, 5)->text() == fpr) {
- //key.privkey = mKeyList->item(i,1)->text();
- key.id = mKeyList->item(i,4)->text();
- key.name = mKeyList->item(i,2)->text();
- key.email = mKeyList->item(i,3)->text();
- key.fpr = fpr;
- }
- }
- return key;
-}
-
-
-/**
- * note: privkey status is not returned
- */
-GpgKey KeyList::getKeyById(QString id) {
- GpgKey key;
- for (int i = 0; i < mKeyList->rowCount(); i++) {
- if (mKeyList->item(i, 4)->text() == id) {
- //key.privkey = mKeyList->item(i,1)->text();
- key.id = mKeyList->item(i,4)->text();
- key.name = mKeyList->item(i,2)->text();
- key.email = mKeyList->item(i,3)->text();
- key.fpr = mKeyList->item(i,5)->text();
- }
- }
- return key;
-}
-
QStringList *KeyList::getChecked()
{
QStringList *ret = new QStringList();
diff --git a/keylist.h b/keylist.h
index 0df007a..6bac7d3 100644
--- a/keylist.h
+++ b/keylist.h
@@ -43,8 +43,6 @@ public:
QStringList *getChecked();
QStringList *getPrivateChecked();
- GpgKey getKeyByFpr(QString fpr);
- GpgKey getKeyById(QString id);
void setChecked(QStringList *keyIds);
//QStringList *getPrivateChecked();
diff --git a/verifykeydetailbox.cpp b/verifykeydetailbox.cpp
index 44265cc..d94915c 100644
--- a/verifykeydetailbox.cpp
+++ b/verifykeydetailbox.cpp
@@ -48,7 +48,7 @@ VerifyKeyDetailBox::VerifyKeyDetailBox(QWidget *parent, GpgME::GpgContext* ctx,
}
case GPG_ERR_NO_ERROR:
{
- GpgKey key = mKeyList->getKeyByFpr(signature->fpr);
+ GpgKey key = mCtx->getKeyByFpr(signature->fpr);
this->setTitle(key.name);
grid->addWidget(new QLabel(tr("Name:")), 0, 0);
@@ -65,7 +65,7 @@ VerifyKeyDetailBox::VerifyKeyDetailBox(QWidget *parent, GpgME::GpgContext* ctx,
}
default:
{
- GpgKey key = mKeyList->getKeyById(signature->fpr);
+ GpgKey key = mCtx->getKeyById(signature->fpr);
this->setTitle(tr("Error for key with id 0x") + fpr);
grid->addWidget(new QLabel(tr("Name:")), 0, 0);
grid->addWidget(new QLabel(tr("EMail:")), 1, 0);
diff --git a/verifynotification.cpp b/verifynotification.cpp
index 59600a5..0319c31 100644
--- a/verifynotification.cpp
+++ b/verifynotification.cpp
@@ -124,7 +124,7 @@ bool VerifyNotification::refresh()
}
case GPG_ERR_NO_ERROR:
{
- GpgKey key = mKeyList->getKeyByFpr(sign->fpr);
+ GpgKey key = mCtx->getKeyByFpr(sign->fpr);
verifyLabelText.append(key.name);
if (!key.email.isEmpty()) {
verifyLabelText.append("<"+key.email+">");
@@ -135,7 +135,7 @@ bool VerifyNotification::refresh()
{
textIsSigned = 3;
verifyStatus=VERIFY_ERROR_CRITICAL;
- GpgKey key = mKeyList->getKeyById(sign->fpr);
+ GpgKey key = mCtx->getKeyById(sign->fpr);
verifyLabelText.append(key.name);
if (!key.email.isEmpty()) {
verifyLabelText.append("<"+key.email+">");