• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdelibs API Reference
  • KDE Home
  • Contact Us
 

Solid

  • Solid
  • XdgBaseDirs
Functions
Solid::XdgBaseDirs Namespace Reference

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"
Author
Kevin Krammer, kevin.nosp@m..kra.nosp@m.mmer@.nosp@m.gmx..nosp@m.at
See also
http://www.freedesktop.org/wiki/Specifications/basedir-spec

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
resourcea named resource type, e.g. "config"
relPathrelative 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
resourcea 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
resourcea 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.

This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:23:26 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

Solid

Skip menu "Solid"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal