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

Always add the Tags column to the model

It has to be hidden by the user of the model.

GnuPG-bug-id: 5245
parent 32a3eb6a
...@@ -50,15 +50,15 @@ public: ...@@ -50,15 +50,15 @@ public:
<< Formatting::validityShort(sig) << Formatting::validityShort(sig)
<< (sig.isExportable() ? QStringLiteral("✓") : QString()); << (sig.isExportable() ? QStringLiteral("✓") : QString());
QString lastNotation;
if (showRemarks && parentItem) { if (showRemarks && parentItem) {
QString lastNotation;
for (const auto &notation: sig.notations()) { for (const auto &notation: sig.notations()) {
if (notation.name() && !strcmp(notation.name(), "rem@gnupg.org")) { if (notation.name() && !strcmp(notation.name(), "rem@gnupg.org")) {
lastNotation = QString::fromUtf8(notation.value()); lastNotation = QString::fromUtf8(notation.value());
} }
} }
mItemData << lastNotation;
} }
mItemData << lastNotation;
} }
explicit UIDModelItem(const UserID &uid, UIDModelItem *parentItem) explicit UIDModelItem(const UserID &uid, UIDModelItem *parentItem)
...@@ -69,7 +69,7 @@ public: ...@@ -69,7 +69,7 @@ public:
} }
// The root item // The root item
explicit UIDModelItem(bool showRemarks) UIDModelItem()
{ {
mItemData << i18n("ID") mItemData << i18n("ID")
<< i18n("Name") << i18n("Name")
...@@ -77,11 +77,8 @@ public: ...@@ -77,11 +77,8 @@ public:
<< i18n("Valid From") << i18n("Valid From")
<< i18n("Valid Until") << i18n("Valid Until")
<< i18n("Status") << i18n("Status")
<< i18n("Exportable"); << i18n("Exportable")
<< i18n("Tags");
if (showRemarks) {
mItemData << i18n("Tags");
}
} }
~UIDModelItem() ~UIDModelItem()
...@@ -191,7 +188,7 @@ void UserIDListModel::setKey(const Key &key) ...@@ -191,7 +188,7 @@ void UserIDListModel::setKey(const Key &key)
beginResetModel(); beginResetModel();
mKey = key; mKey = key;
mRootItem.reset(new UIDModelItem(mRemarksEnabled)); mRootItem.reset(new UIDModelItem);
for (int i = 0, ids = key.numUserIDs(); i < ids; ++i) { for (int i = 0, ids = key.numUserIDs(); i < ids; ++i) {
UserID uid = key.userID(i); UserID uid = key.userID(i);
auto uidItem = new UIDModelItem(uid, mRootItem.get()); auto uidItem = new UIDModelItem(uid, mRootItem.get());
......
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