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

Function WizGetLocalUsers

src/share/WizMisc.cpp:2982–3008  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2980
2981
2982bool WizGetLocalUsers(QList<WizLocalUser>& userList)
2983{
2984 QString dataPath = Utils::WizPathResolve::dataStorePath();
2985 QDir dir(dataPath);
2986 QStringList folderList = dir.entryList(QDir::Dirs | QDir::NoDotAndDotDot);
2987 for (QString folder : folderList)
2988 {
2989 WizLocalUser user;
2990 QString dataBase = dataPath + folder + "/data/index.db";
2991 WizIndex db;
2992 if (!QFile::exists(dataBase) || !db.open(dataBase))
2993 continue;
2994
2995 user.strDataFolderName = folder;
2996 user.strGuid = db.getMetaDef("ACCOUNT", "GUID");
2997 if (user.strGuid.isEmpty())
2998 {
2999 continue;
3000 }
3001 user.strUserId = db.getMetaDef("ACCOUNT", "USERID");
3002// qDebug() << "load user id ; " << user.strUserId << " folder : " << folder;
3003 user.strUserId.isEmpty() ? (user.strUserId = folder) : 0;
3004 user.nUserType = db.getMetaDef("QT_WIZNOTE", "SERVERTYPE").toInt();
3005 userList.append(user);
3006 }
3007 return true;
3008}
3009
3010
3011QString WizGetLocalUserId(const QList<WizLocalUser>& userList, const QString& strGuid)

Callers 1

mainCoreFunction · 0.85

Calls 3

getMetaDefMethod · 0.80
isEmptyMethod · 0.80
openMethod · 0.45

Tested by

no test coverage detected