Commit aa623c0a authored by Ingo Klöcker's avatar Ingo Klöcker
Browse files

Add summary line for key groups and use it in the key list model

The summary line should uniquely identify a key group (among all groups
and all keys). CertificateLineEdit (in Kleopatra) relies on this
uniqueness.

GnuPG-bug-id: 5175, 5241
parent 68576607
......@@ -430,7 +430,7 @@ QVariant AbstractKeyListModel::data(const KeyGroup &group, int column, int role)
case KeyID:
return QString();
case Summary:
return group.name(); // used for filtering
return Formatting::summaryLine(group); // used for filtering
case Fingerprint:
return QString();
case Issuer:
......
......@@ -11,6 +11,7 @@
#include "formatting.h"
#include "kleo/dn.h"
#include "kleo/keyfiltermanager.h"
#include "kleo/keygroup.h"
#include <gpgme++/key.h>
#include <gpgme++/importresult.h>
......@@ -889,6 +890,11 @@ QString Formatting::summaryLine(const Key &key)
Formatting::creationDateString(key));
}
QString Formatting::summaryLine(const KeyGroup &group)
{
return i18nc("name of group (group)", "%1 (group)", group.name());
}
// Icon for certificate selection indication
QIcon Formatting::iconForUid(const UserID &uid)
{
......
......@@ -26,6 +26,8 @@ class Import;
namespace Kleo
{
class KeyGroup;
namespace Formatting
{
......@@ -115,6 +117,7 @@ KLEO_EXPORT QString importMetaData(const GpgME::Import &import, const QStringLis
KLEO_EXPORT QString formatOverview(const GpgME::Key &key);
KLEO_EXPORT QString usageString(const GpgME::Subkey &subkey);
KLEO_EXPORT QString summaryLine(const GpgME::Key &key);
KLEO_EXPORT QString summaryLine(const KeyGroup &group);
KLEO_EXPORT QIcon iconForUid(const GpgME::UserID &uid);
......
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