From 10edb8b480f37f8d8dfb116d351a0e9deabe3af8 Mon Sep 17 00:00:00 2001 From: ubbo Date: Mon, 17 Oct 2011 22:33:29 +0000 Subject: some text text changes, add method getKeyByFpr() git-svn-id: http://cpunk.de/svn/src/gpg4usb/trunk@557 34ebc366-c3a9-4b3c-9f84-69acf7962910 --- keylist.cpp | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) (limited to 'keylist.cpp') diff --git a/keylist.cpp b/keylist.cpp index 98f2fdb..f93f45f 100644 --- a/keylist.cpp +++ b/keylist.cpp @@ -105,26 +105,21 @@ void KeyList::refresh() setChecked(keyList); } -QString KeyList::getKeyNameByFpr(QString fpr) -{ - QString id; - for (int i = 0; i < mKeyList->rowCount(); i++) { - if (mKeyList->item(i, 5)->text() == fpr) { - id=mKeyList->item(i,2)->text(); - } - } - return id; -} - -QString KeyList::getKeyEmailByFpr(QString fpr) -{ - QString id; +/** + * 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) { - id=mKeyList->item(i,3)->text(); + //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 id; + return key; } QStringList *KeyList::getChecked() -- cgit v1.2.3