Commit 832c5320 authored by Rolf Eike Beer's avatar Rolf Eike Beer
Browse files

Make GroupEditProxyModel a bit more flexible

Also don't show group members.

svn path=/trunk/KDE/kdeutils/kgpg/; revision=879430
parent b6f2c605
...@@ -25,8 +25,8 @@ ...@@ -25,8 +25,8 @@
using namespace KgpgCore; using namespace KgpgCore;
GroupEditProxyModel::GroupEditProxyModel(QObject *parent, const bool &invert, QList<KGpgNode *> *ids) GroupEditProxyModel::GroupEditProxyModel(QObject *parent, const bool &invert, QList<KGpgNode *> *ids, const KgpgCore::KgpgKeyTrust &mintrust)
: QSortFilterProxyModel(parent), m_model(NULL), m_invert(invert), m_ids(ids) : QSortFilterProxyModel(parent), m_model(NULL), m_invert(invert), m_ids(ids), m_mintrust(mintrust)
{ {
} }
...@@ -43,10 +43,10 @@ GroupEditProxyModel::filterAcceptsRow(int source_row, const QModelIndex &source_ ...@@ -43,10 +43,10 @@ GroupEditProxyModel::filterAcceptsRow(int source_row, const QModelIndex &source_
QModelIndex idx = m_model->index(source_row, 0, source_parent); QModelIndex idx = m_model->index(source_row, 0, source_parent);
KGpgNode *l = m_model->nodeForIndex(idx); KGpgNode *l = m_model->nodeForIndex(idx);
if (l->getType() & ~ITYPE_GPAIR) if (l->getType() & ~ITYPE_PAIR)
return false; return false;
if ((l->getTrust() != TRUST_FULL) && (l->getTrust() != TRUST_ULTIMATE)) if (l->getTrust() < m_mintrust)
return false; return false;
for (int i = 0; i < m_ids->count(); i++) for (int i = 0; i < m_ids->count(); i++)
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#define GROUPEDITPROXYMODEL_H #define GROUPEDITPROXYMODEL_H
#include <QSortFilterProxyModel> #include <QSortFilterProxyModel>
#include "kgpgkey.h"
class KGpgNode; class KGpgNode;
class KGpgItemModel; class KGpgItemModel;
...@@ -27,7 +28,7 @@ class KGpgItemModel; ...@@ -27,7 +28,7 @@ class KGpgItemModel;
class GroupEditProxyModel: public QSortFilterProxyModel class GroupEditProxyModel: public QSortFilterProxyModel
{ {
public: public:
explicit GroupEditProxyModel(QObject * parent, const bool &invert, QList<KGpgNode *> *ids); explicit GroupEditProxyModel(QObject * parent, const bool &invert, QList<KGpgNode *> *ids, const KgpgCore::KgpgKeyTrust &mintrust = KgpgCore::TRUST_FULL);
void setKeyModel(KGpgItemModel *); void setKeyModel(KGpgItemModel *);
...@@ -47,6 +48,7 @@ private: ...@@ -47,6 +48,7 @@ private:
KGpgItemModel *m_model; KGpgItemModel *m_model;
bool m_invert; bool m_invert;
QList<KGpgNode *> *m_ids; QList<KGpgNode *> *m_ids;
KgpgCore::KgpgKeyTrust m_mintrust;
}; };
#endif #endif
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