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

Modernize code

parent 941f82fb
...@@ -39,6 +39,8 @@ class UIDModelItem ...@@ -39,6 +39,8 @@ class UIDModelItem
// //
public: public:
explicit UIDModelItem(const UserID::Signature &sig, UIDModelItem *parentItem, bool showRemarks) explicit UIDModelItem(const UserID::Signature &sig, UIDModelItem *parentItem, bool showRemarks)
: mParentItem{parentItem}
, mSig{sig}
{ {
mItemData << QString::fromUtf8(sig.signerKeyID()) mItemData << QString::fromUtf8(sig.signerKeyID())
<< Formatting::prettyName(sig) << Formatting::prettyName(sig)
...@@ -47,8 +49,6 @@ public: ...@@ -47,8 +49,6 @@ public:
<< Formatting::expirationDateString(sig) << Formatting::expirationDateString(sig)
<< Formatting::validityShort(sig) << Formatting::validityShort(sig)
<< (sig.isExportable() ? QStringLiteral("✓") : QString()); << (sig.isExportable() ? QStringLiteral("✓") : QString());
mSig = sig;
mParentItem = parentItem;
if (showRemarks && parentItem) { if (showRemarks && parentItem) {
QString lastNotation; QString lastNotation;
...@@ -62,14 +62,14 @@ public: ...@@ -62,14 +62,14 @@ public:
} }
explicit UIDModelItem(const UserID &uid, UIDModelItem *parentItem) explicit UIDModelItem(const UserID &uid, UIDModelItem *parentItem)
: mParentItem{parentItem}
, mUid{uid}
{ {
mItemData << Formatting::prettyUserID(uid); mItemData << Formatting::prettyUserID(uid);
mUid = uid;
mParentItem = parentItem;
} }
// The root item // The root item
explicit UIDModelItem(bool showRemarks) : mParentItem(nullptr) explicit UIDModelItem(bool showRemarks)
{ {
mItemData << i18n("ID") mItemData << i18n("ID")
<< i18n("Name") << i18n("Name")
...@@ -140,7 +140,7 @@ public: ...@@ -140,7 +140,7 @@ public:
if (!mSig.isNull() && column == static_cast<int>(UserIDListModel::Column::Status)) { if (!mSig.isNull() && column == static_cast<int>(UserIDListModel::Column::Status)) {
return Formatting::validityIcon(mSig); return Formatting::validityIcon(mSig);
} }
return QVariant(); return {};
} }
int row() const int row() const
......
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