|
|
Site-independent access to standard KDE directories.
The various directory accessors allow you to access the various KDE FSSTND directories in a portable way.
Since the KDE FSSTND is heirarchical, the accessors provide the ability to get the directory in the most to the least specific location (in order, Application/User/System);
Additionally, each accessor has the ability to find the most specific directory that actually exists. The default is no check whether the directory exists.
Ordinarily, you will not want to manually instantiate this class. The global KApplication object instantiates and provides const access to a <code>KStandardDirs</code> object via the KApplication::dirs method.
KStandardDirs ( const char *appName ) |
KStandardDirs Constructor.
Parameters:
appName | The name of the application, which will be used for searching the "apps" directory. |
~KStandardDirs () |
KStandardDirs Destructor.
enum DirScope {Closest, App, User, SysApp, System } |
The scope of a directory. App is the application-specific directory in the user's local KDE directory, User is the user's local KDE directory, SysApp is the application-specific directory in the system directory and System is the system directory in which KDE is installed.
Closest is used for searching the first directory in the list that exists, in the order App, User, SysApp, System.
const char * app (DirScope s = Closest) |
The full path to the application-specific directory.
const char * bin (DirScope s = Closest) |
The full path to the kde binary directory.
const char * cgi (DirScope s = Closest) |
The full path to the directory in which KDE-specific CGI programs are stored.
const char * config (DirScope s = Closest) |
The full path to the directory in which configuration files are stored.
const char * apps (DirScope s = Closest) |
The full path to the data directory.
const char * html (DirScope s = Closest) |
The full path to the directory in which HTML documentation is saved. This does not take into account the current locale setting.
const char * icon (DirScope s = Closest) |
The full path to the directory in which icon images are stored.
const char * locale (DirScope s = Closest) |
The full path to the directory in which locale information and translation catalogues are stored.
const char * mime (DirScope s = Closest) |
The full path to the directory in which MIME information is stored.
const char * parts (DirScope s = Closest) |
The full path to the directory in which mini icons are stored.
const char * toolbar (DirScope s = Closest) |
The full path to the directory in which toolbar icons are stored.
const char * wallpaper (DirScope s = Closest) |
The full path to the directory in which wallpapers are stored.
const char * sound (DirScope s = Closest) |
The full path to the directory in which sound files are stored.
QString findExe ( const char *appname, const char *pathstr=0, bool ignoreExecBit=false ) |
Finds the executable in the system path. A valid executable must be a file and have its executable bit set.
Parameters:
appname | the name of the executable file for which to search. |
pathstr | The path which will be searched. If this is 0 (default), the $PATH environment variable will be searched. |
ignoreExecBit | If true, an existing file will be returned even if its executable bit is not set. |
Returns: The path of the executable. If it was not found, this string will be null.
See also: findAllExe
int findAllExe ( QStrList& list, const char *appname, const char *pathstr=0, bool ignoreExecBit=false ) |
Finds all occurences of an executable in the system path.
Parameters:
list | will be filled with the pathnames of all the executables found. Will be empty if the executable was not found. |
appname | The name of the executable for which to search. |
pathstr | The path list which will be searched. If this is 0 (default), the $PATH environment variable will be searched. |
ignoreExecBit | If true, an existing file will be returned even if its executable bit is not set. |
Returns: The number of executables found, 0 if none were found.
See also: findExe