summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRolf Eike Beer <eb@emlix.com>2016-10-21 15:26:29 (GMT)
committerRolf Eike Beer <kde@opensource.sf-tec.de>2016-10-21 16:20:18 (GMT)
commitafe68e81f5c2d4a625f615b7e36457d37f811061 (patch)
tree6fc831c41d6a8f8c0cc9ed89a02ac4ce8e4207d3
parent55d77a14fedf9545a1f8792288fb922006acb404 (diff)
also refresh groups when refreshing all keys
Otherwise all group members will shown "unknown key <id>" afterwards, even if the keys are still known.
-rw-r--r--model/kgpgitemmodel.cpp18
1 files changed, 11 insertions, 7 deletions
diff --git a/model/kgpgitemmodel.cpp b/model/kgpgitemmodel.cpp
index 9044197..37cde75 100644
--- a/model/kgpgitemmodel.cpp
+++ b/model/kgpgitemmodel.cpp
@@ -447,18 +447,22 @@ KGpgItemModel::refreshKeys(const QStringList &ids)
refreshKeyIds(ids);
}
+static QStringList
+readGroups()
+{
+ return GPGProc::getGgpParsedConfig(KGpgSettings::gpgBinaryPath(), "group");
+}
+
void
KGpgItemModel::refreshKeyIds(const QStringList &ids)
{
beginResetModel();
if (ids.isEmpty()) {
- for (int i = m_root->getChildCount() - 1; i >= 0; i--) {
- KGpgNode *nd = m_root->getChild(i);
- if (nd->getType() == ITYPE_GROUP)
- continue;
- delete nd;
- }
+ for (int i = m_root->getChildCount() - 1; i >= 0; i--)
+ delete m_root->getChild(i);
m_root->addKeys();
+
+ m_root->addGroups(readGroups());
} else {
QStringList::ConstIterator it = ids.constBegin();
const QStringList::ConstIterator itEnd = ids.constEnd();
@@ -504,7 +508,7 @@ KGpgItemModel::refreshGroups()
endRemoveRows();
}
- const QStringList groups = GPGProc::getGgpParsedConfig(KGpgSettings::gpgBinaryPath(), "group");
+ const QStringList groups = readGroups();
if (groups.isEmpty())
return;