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

Add enum for model columns

GnuPG-bug-id: 5245
parent 4c8b79fc
......@@ -127,15 +127,17 @@ public:
QVariant toolTip(int column) const
{
if (column == 5 /*Status*/) {
return i18n("class %1", mSig.certClass());
if (!mSig.isNull()) {
if (column == static_cast<int>(UserIDListModel::Column::Status)) {
return i18n("class %1", mSig.certClass());
}
}
return mItemData.value(column);
}
QVariant icon(int column) const
{
if (!mSig.isNull() && column == 5 /*Status*/) {
if (!mSig.isNull() && column == static_cast<int>(UserIDListModel::Column::Status)) {
return Formatting::validityIcon(mSig);
}
return QVariant();
......
......@@ -27,6 +27,17 @@ class KLEO_EXPORT UserIDListModel : public QAbstractItemModel
{
Q_OBJECT
public:
enum class Column {
Id,
Name,
Email,
ValidFrom,
ValidUntil,
Status,
Exportable,
Tags,
};
explicit UserIDListModel(QObject *parent = nullptr);
~UserIDListModel() override;
......
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