| 1 |
/**************************************************************************** |
| 2 |
** |
| 3 |
** Copyright (C) 2019 The Qt Company Ltd. |
| 4 |
** Contact: https://www.qt.io/licensing/ |
| 5 |
** |
| 6 |
** This file is part of the documentation of the Qt Toolkit. |
| 7 |
** |
| 8 |
** $QT_BEGIN_LICENSE:FDL$ |
| 9 |
** Commercial License Usage |
| 10 |
** Licensees holding valid commercial Qt licenses may use this file in |
| 11 |
** accordance with the commercial license agreement provided with the |
| 12 |
** Software or, alternatively, in accordance with the terms contained in |
| 13 |
** a written agreement between you and The Qt Company. For licensing terms |
| 14 |
** and conditions see https://www.qt.io/terms-conditions. For further |
| 15 |
** information use the contact form at https://www.qt.io/contact-us. |
| 16 |
** |
| 17 |
** GNU Free Documentation License Usage |
| 18 |
** Alternatively, this file may be used under the terms of the GNU Free |
| 19 |
** Documentation License version 1.3 as published by the Free Software |
| 20 |
** Foundation and appearing in the file included in the packaging of |
| 21 |
** this file. Please review the following information to ensure |
| 22 |
** the GNU Free Documentation License version 1.3 requirements |
| 23 |
** will be met: https://www.gnu.org/licenses/fdl-1.3.html. |
| 24 |
** $QT_END_LICENSE$ |
| 25 |
** |
| 26 |
****************************************************************************/ |
| 27 |
|
| 28 |
//! [displayName] |
| 29 |
|
| 30 |
Returns a localized display name for the given location \a type |
| 31 |
or an empty QString if no relevant location can be found. |
| 32 |
|
| 33 |
//! [displayName] |
| 34 |
|
| 35 |
|
| 36 |
//! [findExecutable] |
| 37 |
|
| 38 |
Finds the executable named \a executableName in the specified |
| 39 |
\a paths, or the system paths if paths is empty. |
| 40 |
|
| 41 |
On most operating systems the system path is determined by the |
| 42 |
\c PATH environment variable. The directories where to search for |
| 43 |
the executable can be set in the paths argument. To search in |
| 44 |
both your own paths and the system paths, call findExecutable |
| 45 |
twice, once with paths set and once with paths empty. |
| 46 |
Symlinks are not resolved in order to preserve behavior for the |
| 47 |
case of executables whose behavior depends on the name they are |
| 48 |
invoked with |
| 49 |
. |
| 50 |
\note On Windows, the usual executable extensions (from the PATHEXT |
| 51 |
environment variable) are automatically appended. For example, the |
| 52 |
findExecutable("foo") call finds \c foo.exe or \c foo.bat if |
| 53 |
present. |
| 54 |
|
| 55 |
Returns the absolute file path to the executable, or an empty |
| 56 |
string if not found. |
| 57 |
|
| 58 |
If the given \n executableName is an absolute path pointing to |
| 59 |
an executable its clean path is returned. |
| 60 |
|
| 61 |
//! [findExecutable] |
| 62 |
|
| 63 |
//! [locate] |
| 64 |
|
| 65 |
Finds a file or directory called \a fileName in the standard |
| 66 |
locations for \a type. |
| 67 |
|
| 68 |
The \a options flag lets you specify whether to look for files |
| 69 |
or directories. By default, this flag is set to \c LocateFile. |
| 70 |
|
| 71 |
Returns the absolute path to the first file or directory found, |
| 72 |
otherwise returns an empty string. |
| 73 |
|
| 74 |
//! [locate] |
| 75 |
|
| 76 |
//! [locateAll] |
| 77 |
|
| 78 |
Finds all files or directories by the name, \a fileName, in the |
| 79 |
standard locations for \a type. |
| 80 |
|
| 81 |
The \a options flag lets you specify whether to look for files |
| 82 |
or directories. By default, this flag is set to \c LocateFile. |
| 83 |
|
| 84 |
Returns the list of all the files that were found. |
| 85 |
|
| 86 |
//! [locateAll] |
| 87 |
|
| 88 |
//! [setTestModeEnabled] |
| 89 |
|
| 90 |
If \a testMode is \c true, this enables a special "test mode" in |
| 91 |
QStandardPaths, which changes writable locations to point to |
| 92 |
test directories. This prevents auto tests from reading |
| 93 |
or writing to the current user's configuration. |
| 94 |
|
| 95 |
It affects the locations into which test programs might write |
| 96 |
files: \c GenericDataLocation, \c DataLocation, \c ConfigLocation, |
| 97 |
\c GenericConfigLocation, \c AppConfigLocation, |
| 98 |
\c GenericCacheLocation, and \c CacheLocation. Other locations |
| 99 |
are not affected. |
| 100 |
|
| 101 |
On Unix, \c XDG_DATA_HOME is set to \c{~/.qttest/share}, |
| 102 |
\c XDG_CONFIG_HOME is set to \c{~/.qttest/config}, and |
| 103 |
\c XDG_CACHE_HOME is set to \c{~/.qttest/cache}. |
| 104 |
|
| 105 |
On macOS, data goes to \c{~/.qttest/Application Support}, |
| 106 |
cache goes to \c{~/.qttest/Cache}, and config goes to |
| 107 |
\c{~/.qttest/Preferences}. |
| 108 |
|
| 109 |
On Windows, everything goes to a "qttest" directory under |
| 110 |
\c{%APPDATA%}. |
| 111 |
|
| 112 |
//! [setTestModeEnabled] |
| 113 |
|
| 114 |
//! [standardLocations] |
| 115 |
|
| 116 |
Returns all the directories where files of \a type belong. |
| 117 |
|
| 118 |
The list of directories is sorted from high to low priority, |
| 119 |
starting with writableLocation() if it can be determined. |
| 120 |
This list is empty if no locations for type are defined. |
| 121 |
|
| 122 |
//! [standardLocations] |
| 123 |
|
| 124 |
//! [writableLocation] |
| 125 |
|
| 126 |
Returns the directory where files of \a type should be written to, |
| 127 |
or an empty string if the location cannot be determined. |
| 128 |
|
| 129 |
\note The storage location returned may not exist; that is, |
| 130 |
it may need to be created by the system or the user. |
| 131 |
|
| 132 |
//! [writableLocation] |