Solid
Functions | |
QString | findResourceFile (const char *resource, const QString &relPath) |
QString | homePath (const char *resource) |
QStringList | systemPathList (const char *resource) |
Detailed Description
Resource type based handling of standard directories.
Developers of several Free Software desktop projects have created a specification for handling so-called "base directories", i.e. lists of system wide directories and directories within each user's home directory for installing and later finding certain files.
This class handles the respective behaviour, i.e. environment variables and their defaults, for the following type of resources:
- "config"
- "data"
Function Documentation
QString Solid::XdgBaseDirs::findResourceFile | ( | const char * | resource, |
const QString & | relPath | ||
) |
Searches the resource specific directories for a given file.
Convenience method for finding a given file (with optional relative path) in any of the configured base directories for a given resource type.
Will check the user local directory first and then process the system wide path list according to the inherent priority.
- Parameters
-
resource a named resource type, e.g. "config" relPath relative path of a file to look for, e.g."akonadi/akonadiserverrc"
- Returns
- the file path of the first match, or
QString()
if no such relative path exists in any of the base directories or if a match is not a file
Definition at line 86 of file xdgbasedirs.cpp.
QString Solid::XdgBaseDirs::homePath | ( | const char * | resource | ) |
Returns the user specific directory for the given resource type.
Unless the user's environment has a specific path set as an override this will be the default as defined in the freedesktop.org base-dir-spec
- Note
- Caches the value of the first call
- Parameters
-
resource a named resource type, e.g. "config"
- Returns
- a directory path
- See also
- systemPathList()
Definition at line 52 of file xdgbasedirs.cpp.
QStringList Solid::XdgBaseDirs::systemPathList | ( | const char * | resource | ) |
Returns the list of system wide directories for a given resource type.
The returned list can contain one or more directory paths. If there are more than one, the list is sorted by falling priority, i.e. if an entry is valid for the respective use case (e.g. contains a file the application looks for) the list should not be processed further.
- Note
- The user's resource path should, to be compliant with the spec, always be treated as having higher priority than any path in the list of system wide paths
- Caches the value of the first call
- Parameters
-
resource a named resource type, e.g. "config"
- Returns
- a priority sorted list of directory paths
- See also
- homePath()
Definition at line 69 of file xdgbasedirs.cpp.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:48:48 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.