Classified ads
|
This is is part of datamodel for trust tree related operation. More...
#include <trusttreemodel.h>
Classes | |
struct | TrustTreeItemStruct |
Public Slots | |
void | contentReceived (const Hash &aHashOfContent, const ProtocolItemType aTypeOfReceivdContent) |
Signals | |
void | error (MController::CAErrorSituation aError, const QString &aExplanation) |
Public Member Functions | |
TrustTreeModel (MController *aMController, const MModelProtocolInterface &aModel) | |
~TrustTreeModel () | |
void | offerTrustList (const Hash &aTrustListOwnerProfile, const QString &aOwnerProfileDisplayName, const QList< Hash > &aList) |
bool | isProfileTrusted (const Hash &aProfile, QString *aDisplayNameOfTrustingProfile, Hash *aFpOfTrustingProfile) const |
void | initModel (const QVariant &aPreviousSettings) |
QVariant | trustTreeSettings () const |
void | clear (void) |
Private Types | |
typedef struct TrustTreeModel::TrustTreeItemStruct | TrustTreeItem |
Private Member Functions | |
void | recalculateTrust () |
void | setProfileTrustedInList (const Hash &aTrustedProfile, const Hash &aTrustingProfile, int aLevel) |
Private Attributes | |
MController & | iController |
const MModelProtocolInterface & | iModel |
QMap< Hash, TrustTreeItem > * | iTrustTree |
unsigned | iLastUpdateTime |
This is is part of datamodel for trust tree related operation.
Trust list of part of operator profile. Simple as that. This class contains algorithms manipulating a tree constructed from lists of operators where operators expores (dis)trust of each others in complex web of nodes and vertices. Main goal is fast query about trustworthiness of given operator profile.
Classified ads treats trust as boolean ; operator either is trusted or not. There is no distinction between recognizing the operators identity and assigning trust to her - if operator is trusted it must mean both at the same time: trusted operator is identified at least somehow and in addition is recognized as trustworthy animal, person or bot.
Output is also boolean. There are algorithms for producing floating point numbers for this purpose .. say, half of your trusted friends give some unknown operator "true" for trust, the other half does not (either recognize or trust) so you could decide that his operator enjoys some 50% trustworthiness - this is not done. Motivation is simplicity both in concept and algorithms, the floating point methods tend to be computationally rather expensive.
|
private |
internal trust list item
TrustTreeModel::TrustTreeModel | ( | MController * | aMController, |
const MModelProtocolInterface & | aModel | ||
) |
TrustTreeModel::~TrustTreeModel | ( | ) |
void TrustTreeModel::clear | ( | void | ) |
method for emptying model contents in event of profile change
|
slot |
activated when new profile is received
|
signal |
void TrustTreeModel::initModel | ( | const QVariant & | aPreviousSettings | ) |
method for initializing the model when profile changes
aPreviousSettings | settings previously obtained using trustTreeSettings method |
bool TrustTreeModel::isProfileTrusted | ( | const Hash & | aProfile, |
QString * | aDisplayNameOfTrustingProfile, | ||
Hash * | aFpOfTrustingProfile | ||
) | const |
Method for making a query about a profile.
aProfile | fingerprint of the profile queried |
aDisplayNameOfTrustingProfile | pointer to string that, if non-null, in case of this method returns true, will have its value set to display-name of some profile that trusts aProfile |
aFpOfTrustingProfile | behaves the same way as aDisplayNameOfTrustingProfile but instead of display-name carries a fingerprint |
void TrustTreeModel::offerTrustList | ( | const Hash & | aTrustListOwnerProfile, |
const QString & | aOwnerProfileDisplayName, | ||
const QList< Hash > & | aList | ||
) |
method for injecting a trust list into model. This is called when there is suspicion that trust list of a profile may have been changed and this causes re-calculation of the trust tree
aTrustListOwnerProfile | fingerprint of profile whose list is about to get processed |
aOwnerProfileDisplayName | human-readable name for the profile |
aList | is the list. This is a list of fingerprints of other profiles that aTrustListOwnerProfile indicates to be trustworthy. |
|
private |
method that takes contents of iTrustTree and if there is any additions etc. takes them into account
|
private |
sets profile trusted in trust list. called from recalculateTrust
QVariant TrustTreeModel::trustTreeSettings | ( | ) | const |
Method that exports model state as QVariant.
|
private |
|
private |
|
private |
|
private |