MCPcopy Create free account
hub / github.com/altairwei/WizNotePlus / getDocumentAuthorAlias

Method getDocumentAuthorAlias

src/database/WizDatabase.cpp:2933–2958  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2931}
2932
2933QString WizDatabase::getDocumentAuthorAlias(const WIZDOCUMENTDATA& doc)
2934{
2935 if (!doc.strAuthor.isEmpty())
2936 return doc.strAuthor;
2937
2938 WizDatabase* personDb = personalDatabase();
2939 if (!personDb)
2940 return QString();
2941
2942 if (doc.strKbGUID.isEmpty() || doc.strKbGUID == personDb->kbGUID())
2943 {
2944 QString displayName;
2945 if (personDb->getUserDisplayName(displayName))
2946 return displayName;
2947 }
2948
2949 QString strUserID = doc.strOwner;
2950 WIZBIZUSER bizUser;
2951 personDb->userFromID(doc.strKbGUID, strUserID, bizUser);
2952 if (bizUser.alias.isEmpty())
2953 {
2954 int index = doc.strOwner.indexOf('@');
2955 return index == -1 ? doc.strOwner : doc.strOwner.left(index);
2956 }
2957 return bizUser.alias;
2958}
2959
2960QString WizDatabase::getDocumentOwnerAlias(const WIZDOCUMENTDATA& doc)
2961{

Callers

nothing calls this directly

Calls 5

isEmptyMethod · 0.80
getUserDisplayNameMethod · 0.80
userFromIDMethod · 0.80
QStringClass · 0.70
kbGUIDMethod · 0.45

Tested by

no test coverage detected