fixed display of non validated nodes without fingerprint

This commit is contained in:
csoler 2019-09-10 22:01:06 +02:00
parent bbf92bd5f3
commit b0c7f8f0ca
No known key found for this signature in database
GPG Key ID: 7BCA522266C0804C
2 changed files with 14 additions and 6 deletions

View File

@ -973,9 +973,16 @@ RsFriendListModel::EntryType RsFriendListModel::getType(const QModelIndex& i) co
return e.type;
}
std::map<RsPgpId,uint32_t>::const_iterator RsFriendListModel::createInvalidatedProfile(const RsPgpFingerprint& fpr,std::map<RsPgpId,uint32_t>& pgp_indices,std::vector<HierarchicalProfileInformation>& mProfiles)
std::map<RsPgpId,uint32_t>::const_iterator RsFriendListModel::createInvalidatedProfile(const RsPgpId& _pgp_id,const RsPgpFingerprint& fpr,std::map<RsPgpId,uint32_t>& pgp_indices,std::vector<HierarchicalProfileInformation>& mProfiles)
{
RsPgpId pgp_id = rsPeers->pgpIdFromFingerprint(fpr);
// This is necessary by the time the full fingerprint is used in PeerNetItem.
RsPgpId pgp_id;
if(!fpr.isNull())
pgp_id = rsPeers->pgpIdFromFingerprint(fpr);
else
pgp_id = _pgp_id;
auto it2 = pgp_indices.find(pgp_id);
@ -1087,7 +1094,7 @@ void RsFriendListModel::updateInternalData()
{
// This peer's pgp key hasn't been validated yet. We list such peers at the end.
it2 = createInvalidatedProfile(hnode.node_info.fpr,pgp_indices,mProfiles);
it2 = createInvalidatedProfile(hnode.node_info.gpg_id,hnode.node_info.fpr,pgp_indices,mProfiles);
}
mProfiles[it2->second].child_node_indices.push_back(mLocations.size());

View File

@ -164,9 +164,10 @@ private:
std::vector<HierarchicalProfileInformation>& mProfiles,
bool create);
std::map<RsPgpId,uint32_t>::const_iterator createInvalidatedProfile(const RsPgpFingerprint& pgp_id,
std::map<RsPgpId,uint32_t>& pgp_indices,
std::vector<HierarchicalProfileInformation>& mProfiles);
std::map<RsPgpId,uint32_t>::const_iterator createInvalidatedProfile(const RsPgpId& pgp_id,
const RsPgpFingerprint& fpr,
std::map<RsPgpId,uint32_t>& pgp_indices,
std::vector<HierarchicalProfileInformation>& mProfiles);
QVariant sizeHintRole (const EntryIndex& e, int col) const;
QVariant displayRole (const EntryIndex& e, int col) const;