10#if QT_CONFIG(regularexpression)
13#include <private/qfilesystemengine_p.h>
17#ifndef QT_BOOTSTRAPPED
21#ifndef QT_NO_STANDARDPATHS
29#ifndef QT_BOOTSTRAPPED
35 path += u
'/' + appName;
41#if QT_CONFIG(regularexpression)
48 return "DOCUMENTS"_L1;
58 return "PUBLICSHARE"_L1;
60 return "TEMPLATES"_L1;
94 if (!metaData.exists())
95 return "a broken symlink";
98 if (metaData.isLink())
99 description =
"a symbolic link to ";
101 if (metaData.isFile())
102 description +=
"a regular file";
103 else if (metaData.isDirectory())
104 description +=
"a directory";
105 else if (metaData.isSequential())
106 description +=
"a character device, socket or FIFO";
108 description +=
"a block device";
129 if (QT_MKDIR(
entry.nativeFilePath(), 0700) == 0)
131 if (errno != EEXIST) {
132 qErrnoWarning(
"QStandardPaths: error creating runtime directory '%ls'",
140 qErrnoWarning(
"QStandardPaths: error obtaining permissions of runtime directory '%ls'",
149 qWarning(
"QStandardPaths: runtime directory '%ls' is not a directory, but %s",
150 qUtf16Printable(xdgRuntimeDir), describeMetaData(metaData).constData());
155 if (metaData.
userId() != myUid) {
156 qWarning(
"QStandardPaths: runtime directory '%ls' is not owned by UID %d, but %s",
157 qUtf16Printable(xdgRuntimeDir), myUid, describeMetaData(metaData).constData());
163 qWarning(
"QStandardPaths: wrong permissions on runtime directory %ls, %s instead of %s",
190 xdgCacheHome.
clear();
229 xdgConfigHome.
clear();
236 return xdgConfigHome;
242 xdgRuntimeDir.
clear();
244 bool fromEnv = !xdgRuntimeDir.
isEmpty();
258 xdgRuntimeDir.
clear();
261 return xdgRuntimeDir;
267#if QT_CONFIG(regularexpression)
271 xdgConfigHome.
clear();
275 QFile file(xdgConfigHome +
"/user-dirs.dirs"_L1);
288 &&
value.startsWith(u
'\"')
289 &&
value.endsWith(u
'\"'))
292 if (
value.startsWith(
"$HOME"_L1))
366 dirs.removeDuplicates();
378 dirs =
QStringList{u
"/usr/local/share"_s, u
"/usr/share"_s};
390 dirs.push_back(u
"/etc/xdg"_s);
405 for (
int i = 0;
i < dirs.size(); ++
i)
413 for (
int i = 0;
i < dirs.size(); ++
i)
414 dirs[
i].
append(
"/applications"_L1);
419 for (
int i = 0;
i < dirs.size(); ++
i)
425 for (
int i = 1;
i < dirs.size(); ++
i)
432 dirs.prepend(localDir);
const char * constData() const noexcept
Returns a pointer to the const data stored in the byte array.
static QByteArray number(int, int base=10)
Returns a byte-array representing the whole number n as text.
QString organizationName
the name of the organization that wrote this application
QString applicationName
the name of this application
static QString tempPath()
Returns the absolute canonical path of the system's temporary directory.
static QString cleanPath(const QString &path)
Returns path with directory separators normalized (that is, platform-native separators converted to "...
static QString homePath()
Returns the absolute path of the user's home directory.
static bool fillMetaData(const QFileSystemEntry &entry, QFileSystemMetaData &data, QFileSystemMetaData::MetaDataFlags what)
static QString resolveUserName(const QFileSystemEntry &entry, QFileSystemMetaData &data)
bool open(OpenMode flags) override
Opens the file using OpenMode mode, returning true if successful; otherwise false.
static QString decodeName(const QByteArray &localFileName)
This does the reverse of QFile::encodeName() using localFileName.
\inmodule QtCore \reentrant
\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 startsWith(const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the string starts with s; otherwise returns false.
void chop(qsizetype n)
Removes n characters from the end of the string.
void clear()
Clears the contents of the string and makes it null.
QString mid(qsizetype position, qsizetype n=-1) const
Returns a string that contains n characters of this string, starting at the specified position index.
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
list append(new Employee("Blackpool", "Stephen"))
void qErrnoWarning(const char *msg,...)
Combined button and popup list for selecting options.
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
GLsizei const GLchar *const * path
static void appendOrganizationAndApp(QString &path)
static QByteArray unixPermissionsText(QFile::Permissions permissions)
static QStringList dirsList(const QString &xdgEnvVar)
static bool checkXdgRuntimeDir(const QString &xdgRuntimeDir)
static QStringList xdgConfigDirs()
static void appendOrganizationAndApp(QString &path)
static QStringList xdgDataDirs()
#define qUtf16Printable(string)
constexpr auto qTokenize(Haystack &&h, Needle &&n, Flags...flags) noexcept(QtPrivate::Tok::is_nothrow_constructible_from< Haystack, Needle >::value) -> decltype(QtPrivate::Tok::TokenizerResult< Haystack, Needle >{std::forward< Haystack >(h), std::forward< Needle >(n), flags...})
Q_CORE_EXPORT QByteArray qgetenv(const char *varName)
static bool match(const uchar *found, uint foundLen, const char *target, uint targetLen)