Commit fb19c2df authored by Rolf Eike Beer's avatar Rolf Eike Beer
Browse files

show a warning icon and a tooltip for expired group member nodes

CCBUG:339749
parent dcce8e83
......@@ -22,6 +22,8 @@
#include "core/kgpgkey.h"
#include <KDebug>
#include <KLocale>
#include <QIcon>
using namespace KgpgCore;
......@@ -91,23 +93,39 @@ GroupEditProxyModel::data(const QModelIndex &index, int role) const
if (!index.isValid() || (index.column() >= 3))
return QVariant();
if ((role != Qt::ToolTipRole) && (role != Qt::DisplayRole))
return QVariant();
KGpgNode *nd = m_model->nodeForIndex(mapToSource(index));
switch (index.column()) {
case 0:
if (role == Qt::ToolTipRole)
return nd->getNameComment();
else
return nd->getName();
case 1:
return nd->getEmail();
case 2:
if (role == Qt::ToolTipRole)
return nd->toKeyNode()->getBeautifiedFingerprint();
else
return nd->getId().right(8);
switch (role) {
case Qt::ToolTipRole:
case Qt::DisplayRole:
switch (index.column()) {
case 0:
if (role == Qt::ToolTipRole)
return nd->getNameComment();
else
return nd->getName();
case 1:
if (role == Qt::ToolTipRole) {
if (nd->toKeyNode()->getExpiration().isValid() && (nd->toKeyNode()->getExpiration() <= QDateTime::currentDateTime()))
return i18nc("Expired key", "Expired");
break;
} else {
return nd->getEmail();
}
case 2:
if (role == Qt::ToolTipRole)
return nd->toKeyNode()->getBeautifiedFingerprint();
else
return nd->getId().right(8);
default:
break;
}
case Qt::DecorationRole:
if (index.column() != 1)
break;
if (nd->toKeyNode()->getExpiration().isValid() && (nd->toKeyNode()->getExpiration() <= QDateTime::currentDateTime()))
return QIcon::fromTheme(QLatin1String("dialog-warning"));
}
return QVariant();
......
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