Skip to content
Snippets Groups Projects
Commit a592ee5d authored by Nicolas Jager's avatar Nicolas Jager Committed by Guillaume Roguez
Browse files

Certificate : implemente roleData()


- this function allow to obtained data from their role

Change-Id: Ic0e0dd55a5bdf94f71f76a9437ee967cb4b0e748
Reviewed-by: default avatarGuillaume Roguez <guillaume.roguez@savoirfairelinux.com>
parent 12790dfa
Branches
No related tags found
No related merge requests found
...@@ -889,4 +889,26 @@ bool Certificate::moveToDotCert() const ...@@ -889,4 +889,26 @@ bool Certificate::moveToDotCert() const
#endif #endif
} }
/**
* get the data by role selection
* @param role define the role to select
* @return a QVariant object, wich contains the selection
*/
QVariant
Certificate::roleData(int role) const
{
switch (role) {
case Qt::DisplayRole:
case Qt::EditRole:
return remoteId();
case static_cast<int>(Ring::Role::Object):
return QVariant::fromValue(const_cast<Certificate*>(this));
case static_cast<int>(Ring::Role::ObjectType):
return QVariant::fromValue(Ring::ObjectType::Certificate);
}
/* unknown role */
return QVariant();
}
#include <certificate.moc> #include <certificate.moc>
...@@ -236,6 +236,8 @@ public: ...@@ -236,6 +236,8 @@ public:
ChainOfTrustModel* chainOfTrustModel ( ) const; ChainOfTrustModel* chainOfTrustModel ( ) const;
FlagPack<OriginHint> originHint ( ) const; FlagPack<OriginHint> originHint ( ) const;
ContactMethod* contactMethod ( ) const; ContactMethod* contactMethod ( ) const;
Q_INVOKABLE QVariant roleData ( int role ) const;
static QString getName (Certificate::Checks check ); static QString getName (Certificate::Checks check );
static QString getName (Certificate::Details details ); static QString getName (Certificate::Details details );
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment