18#ifndef QT_NO_STANDARDPATHS
43#ifndef QT_BOOTSTRAPPED
49 path += u
'/' + appName;
67 auto* token_info =
reinterpret_cast<TOKEN_MANDATORY_LABEL*
>(token_info_buf.
data());
68 DWORD token_info_length = token_info_buf.
size();
69 if (!GetTokenInformation(process_token, TokenIntegrityLevel, token_info, token_info_length, &token_info_length)) {
71 token_info_buf.
resize(token_info_length);
72 token_info =
reinterpret_cast<TOKEN_MANDATORY_LABEL*
>(token_info_buf.
data());
73 if (!GetTokenInformation(process_token, TokenIntegrityLevel, token_info, token_info_length, &token_info_length))
79 DWORD integrity_level = *GetSidSubAuthority(token_info->Label.Sid, *GetSidSubAuthorityCount(token_info->Label.Sid) - 1);
80 return (integrity_level < SECURITY_MANDATORY_MEDIUM_RID);
87 static const GUID folderIds[] = {
96 FOLDERID_LocalAppData,
98 FOLDERID_LocalAppData,
100 FOLDERID_LocalAppData,
103 FOLDERID_LocalAppData,
104 FOLDERID_RoamingAppData,
105 FOLDERID_LocalAppData,
112 static const GUID folderIds_li[] = {
121 FOLDERID_LocalAppDataLow,
123 FOLDERID_LocalAppDataLow,
125 FOLDERID_LocalAppDataLow,
128 FOLDERID_LocalAppDataLow,
129 FOLDERID_RoamingAppData,
130 FOLDERID_LocalAppDataLow,
134 static_assert(
sizeof(folderIds_li) ==
sizeof(folderIds));
137 if (
size_t(
type) <
sizeof(folderIds) /
sizeof(folderIds[0]))
138 return low_integrity_process ? folderIds_li[
type] : folderIds[
type];
147 if (
Q_LIKELY(SUCCEEDED(SHGetKnownFolderPath(clsid, KF_FLAG_DONT_VERIFY, 0, &
path)))) {
199#ifndef QT_BOOTSTRAPPED
208 dirs.append(localDir);
216 dirs.append(programData);
218#ifndef QT_BOOTSTRAPPED
224 dirs.append(applicationDirPath);
225 const QString dataDir = applicationDirPath +
"/data"_L1;
226 dirs.append(dataDir);
231 if (appDataDir != dataDir)
232 dirs.append(appDataDir);
QString organizationName
the name of the organization that wrote this application
static QString applicationDirPath()
Returns the directory that contains the application executable.
QString applicationName
the name of this application
static QString fromNativeSeparators(const QString &pathName)
static QString tempPath()
Returns the absolute canonical path of the system's temporary directory.
static QString homePath()
Returns the absolute path of the user's home directory.
\inmodule QtCore \reentrant
static bool isTestModeEnabled()
static QStringList standardLocations(StandardLocation type)
static QString writableLocation(StandardLocation type)
StandardLocation
This enum describes the different locations that can be queried using methods such as QStandardPaths:...
\macro QT_RESTRICTED_CAST_FROM_ASCII
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
static QString fromWCharArray(const wchar_t *string, qsizetype size=-1)
constexpr size_type size() const noexcept
void resize(qsizetype sz)
Combined button and popup list for selecting options.
GLsizei const GLchar *const * path
static void appendOrganizationAndApp(QString &path)
static GUID writableSpecialFolderId(QStandardPaths::StandardLocation type)
static bool isGenericConfigLocation(QStandardPaths::StandardLocation type)
static bool isProcessLowIntegrity()
static void appendTestMode(QString &path)
static void appendOrganizationAndApp(QString &path)
static bool isConfigLocation(QStandardPaths::StandardLocation type)
static QString sHGetKnownFolderPath(const GUID &clsid)
static QString convertCharArray(const wchar_t *path)