Commit f535049d authored by Rolf Eike Beer's avatar Rolf Eike Beer
Browse files

delete keys by deleting keys ...

svn path=/trunk/KDE/kdeutils/kgpg/; revision=793688
parent 2557da33
...@@ -2170,6 +2170,7 @@ void KeysManager::confirmdeletekey() ...@@ -2170,6 +2170,7 @@ void KeysManager::confirmdeletekey()
QStringList keysToDelete; QStringList keysToDelete;
QString secList; QString secList;
KGpgKeyNodeList delkeys;
bool secretKeyInside = (pt & ITYPE_SECRET); bool secretKeyInside = (pt & ITYPE_SECRET);
for (int i = 0; i < ndlist.count(); ++i) { for (int i = 0; i < ndlist.count(); ++i) {
...@@ -2177,8 +2178,10 @@ void KeysManager::confirmdeletekey() ...@@ -2177,8 +2178,10 @@ void KeysManager::confirmdeletekey()
if (ki->getType() & ITYPE_SECRET) { if (ki->getType() & ITYPE_SECRET) {
secList += ki->getNameComment(); secList += ki->getNameComment();
} else if (ki != terminalkey) } else if (ki != terminalkey) {
keysToDelete += ki->getNameComment(); keysToDelete += ki->getNameComment();
delkeys << ki;
}
} }
if (secretKeyInside) { if (secretKeyInside) {
...@@ -2193,12 +2196,7 @@ void KeysManager::confirmdeletekey() ...@@ -2193,12 +2196,7 @@ void KeysManager::confirmdeletekey()
int result = KMessageBox::warningContinueCancelList(this, i18np("<qt><b>Delete the following public key?</b></qt>", "<qt><b>Delete the following %1 public keys?</b></qt>", keysToDelete.count()), keysToDelete, QString(), KStandardGuiItem::del()); int result = KMessageBox::warningContinueCancelList(this, i18np("<qt><b>Delete the following public key?</b></qt>", "<qt><b>Delete the following %1 public keys?</b></qt>", keysToDelete.count()), keysToDelete, QString(), KStandardGuiItem::del());
if (result != KMessageBox::Continue) if (result != KMessageBox::Continue)
return; return;
else
deletekey(keysToDelete);
}
void KeysManager::deletekey(const QStringList &keysToDelete)
{
KProcess gp; KProcess gp;
gp << KGpgSettings::gpgBinaryPath() gp << KGpgSettings::gpgBinaryPath()
<< "--no-tty" << "--no-tty"
...@@ -2210,7 +2208,8 @@ void KeysManager::deletekey(const QStringList &keysToDelete) ...@@ -2210,7 +2208,8 @@ void KeysManager::deletekey(const QStringList &keysToDelete)
gp.execute(); gp.execute();
imodel->refreshKeys(); for (int i = delkeys.count() - 1; i >= 0; i--)
imodel->delNode(delkeys.at(i));
changeMessage(imodel->statusCountMessage(), 1); changeMessage(imodel->statusCountMessage(), 1);
} }
......
...@@ -140,7 +140,6 @@ private slots: ...@@ -140,7 +140,6 @@ private slots:
void readOptions(); void readOptions();
void slotSetDefKey(); void slotSetDefKey();
void confirmdeletekey(); void confirmdeletekey();
void deletekey(const QStringList &keysToDelete);
void deleteseckey(); void deleteseckey();
void signkey(); void signkey();
void signuid(); void signuid();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment