diff options
author | nils <nils@34ebc366-c3a9-4b3c-9f84-69acf7962910> | 2010-05-10 18:08:34 +0000 |
---|---|---|
committer | nils <nils@34ebc366-c3a9-4b3c-9f84-69acf7962910> | 2010-05-10 18:08:34 +0000 |
commit | 5b68ac27a4c773c03c9d9a36d8e8baf9be5e2f61 (patch) | |
tree | bdcb9686aa7aa681003dff09b41156e8b8d6024f /keylist.cpp | |
parent | reinclude attachments-view in build (diff) | |
download | gpg4usb-5b68ac27a4c773c03c9d9a36d8e8baf9be5e2f61.tar.gz gpg4usb-5b68ac27a4c773c03c9d9a36d8e8baf9be5e2f61.zip |
only save and restore checked private keys
git-svn-id: http://cpunk.de/svn/src/gpg4usb/trunk@319 34ebc366-c3a9-4b3c-9f84-69acf7962910
Diffstat (limited to 'keylist.cpp')
-rw-r--r-- | keylist.cpp | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/keylist.cpp b/keylist.cpp index 7a0b12e..a481076 100644 --- a/keylist.cpp +++ b/keylist.cpp @@ -109,14 +109,23 @@ QStringList *KeyList::getChecked() return ret; } +QStringList *KeyList::getPrivateChecked() +{ + QStringList *ret = new QStringList(); + for (int i = 0; i < mKeyList->rowCount(); i++) { + if ((mKeyList->item(i, 0)->checkState() == Qt::Checked) && (mKeyList->item(i,1))) { + *ret << mKeyList->item(i, 4)->text(); + } + } + return ret; +} + void KeyList::setChecked(QStringList *keyIds) { if (!keyIds->isEmpty()){ - if (keyIds->at(0) != "" ){ - for (int i = 0; i < mKeyList->rowCount(); i++) { - if (keyIds->contains(mKeyList->item(i, 4)->text())) { - mKeyList->item(i, 0)->setCheckState(Qt::Checked); - } + for (int i = 0; i < mKeyList->rowCount(); i++) { + if (keyIds->contains(mKeyList->item(i, 4)->text())) { + mKeyList->item(i, 0)->setCheckState(Qt::Checked); } } } |