.TH "KStandardDirs" kde3 "11 Jun 2005" "Version Version 3.4.1" "kdecore Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
KStandardDirs \- Site-independent access to standard \fBKDE\fP directories.  

.PP
.SH SYNOPSIS
.br
.PP
\fC#include <kstandarddirs.h>\fP
.PP
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "\fBKStandardDirs\fP ()"
.br
.ti -1c
.RI "virtual \fB~KStandardDirs\fP ()"
.br
.ti -1c
.RI "void \fBaddPrefix\fP (const \fBQString\fP &dir)"
.br
.ti -1c
.RI "void \fBaddXdgConfigPrefix\fP (const \fBQString\fP &dir)"
.br
.ti -1c
.RI "void \fBaddXdgDataPrefix\fP (const \fBQString\fP &dir)"
.br
.ti -1c
.RI "bool \fBaddResourceType\fP (const char *type, const \fBQString\fP &relativename)"
.br
.ti -1c
.RI "bool \fBaddResourceDir\fP (const char *type, const \fBQString\fP &absdir)"
.br
.ti -1c
.RI "\fBQString\fP \fBfindResource\fP (const char *type, const \fBQString\fP &filename) const "
.br
.ti -1c
.RI "bool \fBisRestrictedResource\fP (const char *type, const \fBQString\fP &relPath=QString::null) const "
.br
.ti -1c
.RI "Q_UINT32 \fBcalcResourceHash\fP (const char *type, const \fBQString\fP &filename, bool deep) const "
.br
.ti -1c
.RI "\fBQStringList\fP \fBfindDirs\fP (const char *type, const \fBQString\fP &reldir) const "
.br
.ti -1c
.RI "\fBQString\fP \fBfindResourceDir\fP (const char *type, const \fBQString\fP &filename) const "
.br
.ti -1c
.RI "\fBQStringList\fP \fBfindAllResources\fP (const char *type, const \fBQString\fP &filter=QString::null, bool recursive=false, bool unique=false) const "
.br
.ti -1c
.RI "\fBQStringList\fP \fBfindAllResources\fP (const char *type, const \fBQString\fP &filter, bool recursive, bool unique, \fBQStringList\fP &relPaths) const "
.br
.ti -1c
.RI "void \fBaddKDEDefaults\fP ()"
.br
.ti -1c
.RI "bool \fBaddCustomized\fP (\fBKConfig\fP *config)"
.br
.ti -1c
.RI "\fBQStringList\fP \fBresourceDirs\fP (const char *type) const "
.br
.ti -1c
.RI "\fBQStringList\fP \fBallTypes\fP () const "
.br
.ti -1c
.RI "\fBQString\fP \fBsaveLocation\fP (const char *type, const \fBQString\fP &suffix=QString::null, bool create=true) const "
.br
.ti -1c
.RI "\fBQString\fP \fBrelativeLocation\fP (const char *type, const \fBQString\fP &absPath)"
.br
.ti -1c
.RI "\fBQString\fP \fBkfsstnd_prefixes\fP ()"
.br
.ti -1c
.RI "\fBQString\fP \fBkfsstnd_xdg_conf_prefixes\fP ()"
.br
.ti -1c
.RI "\fBQString\fP \fBkfsstnd_xdg_data_prefixes\fP ()"
.br
.ti -1c
.RI "\fBQString\fP \fBlocalkdedir\fP () const "
.br
.ti -1c
.RI "\fBQString\fP \fBlocalxdgdatadir\fP () const "
.br
.ti -1c
.RI "\fBQString\fP \fBlocalxdgconfdir\fP () const "
.br
.in -1c
.SS "Static Public Member Functions"

.in +1c
.ti -1c
.RI "static \fBQStringList\fP \fBsystemPaths\fP (const \fBQString\fP &pstr=QString::null)"
.br
.ti -1c
.RI "static \fBQString\fP \fBfindExe\fP (const \fBQString\fP &appname, const \fBQString\fP &pathstr=QString::null, bool ignoreExecBit=false)"
.br
.ti -1c
.RI "static int \fBfindAllExe\fP (\fBQStringList\fP &list, const \fBQString\fP &appname, const \fBQString\fP &pathstr=QString::null, bool ignoreExecBit=false)"
.br
.ti -1c
.RI "static bool \fBmakeDir\fP (const \fBQString\fP &dir, int mode=0755)"
.br
.ti -1c
.RI "static \fBQString\fP \fBkde_default\fP (const char *type)"
.br
.ti -1c
.RI "static \fBQString\fP \fBkfsstnd_defaultprefix\fP ()"
.br
.ti -1c
.RI "static \fBQString\fP \fBkfsstnd_defaultbindir\fP ()"
.br
.ti -1c
.RI "static bool \fBexists\fP (const \fBQString\fP &fullPath)"
.br
.ti -1c
.RI "static \fBQString\fP \fBrealPath\fP (const \fBQString\fP &dirname)"
.br
.ti -1c
.RI "static \fBQString\fP \fBrealFilePath\fP (const \fBQString\fP &filename)"
.br
.in -1c
.SS "Related Functions"
(Note that these are not member functions.) 
.in +1c
.ti -1c
.RI "KDECORE_EXPORT \fBQString\fP \fBlocate\fP (const char *type, const \fBQString\fP &filename, const \fBKInstance\fP *instance=KGlobal::instance())"
.br
.ti -1c
.RI "KDECORE_EXPORT \fBQString\fP \fBlocateLocal\fP (const char *type, const \fBQString\fP &filename, const \fBKInstance\fP *instance=KGlobal::instance())"
.br
.ti -1c
.RI "KDECORE_EXPORT \fBQString\fP \fBlocateLocal\fP (const char *type, const \fBQString\fP &filename, bool createDir, const \fBKInstance\fP *instance=KGlobal::instance())"
.br
.in -1c
.SH "Detailed Description"
.PP 
Site-independent access to standard \fBKDE\fP directories. 

\fBAuthor:\fP
.RS 4
Stephan Kulow <coolo@kde.org> and Sirtaj Singh Kang <taj@kde.org>
.RE
.PP
This is one of the most central classes in kdelibs as it provides a basic service: It knows where the files reside on the user's hard disk. And it's meant to be the only one that knows -- to make the real location as transparent as possible to both the user and the applications.
.PP
To this end it insulates the application from all information and applications always refer to a file with a resource type (e.g. icon) and a filename (e.g. khexdit.xpm). In an ideal world the application would make no assumption where this file is and leave it up to \fBKStandardDirs::findResource\fP('apps', 'Home.desktop') to apply this knowledge to return /opt/kde/share/applnk/Home.desktop or ::locate('data', 'kgame/background.jpg') to return /opt/kde/share/apps/kgame/background.jpg
.PP
The main idea behind KStandardDirs is that there are several toplevel prefixes below which the files lie. One of these prefixes is the one where the user installed kdelibs, one is where the application was installed, and one is $HOME/.kde, but there may be even more. Under these prefixes there are several well defined suffixes where specific resource types are to be found. For example, for the resource type 'html' the suffixes could be share/doc/HTML and share/doc/kde/HTML. So the search algorithm basically appends to each prefix each registered suffix and tries to locate the file there. To make the thing even more complex, it's also possible to register absolute paths that KStandardDirs looks up after not finding anything in the former steps. They can be useful if the user wants to provide specific directories that aren't in his $HOME/.kde directory for, for example, icons.
.PP
\fBStandard resources that kdelibs allocates are:\fP
.br
.PP
.PD 0
.IP "\(bu" 2
apps - Applications menu (.desktop files). 
.IP "\(bu" 2
cache - Cached information (e.g. favicons, web-pages) 
.IP "\(bu" 2
cgi - CGIs to run from kdehelp. 
.IP "\(bu" 2
config - Configuration files. 
.IP "\(bu" 2
data - Where applications store data. 
.IP "\(bu" 2
exe - Executables in $prefix/bin. \fBfindExe()\fP for a function that takes $PATH into account. 
.IP "\(bu" 2
html - HTML documentation. 
.IP "\(bu" 2
icon - Icons, see \fBKIconLoader\fP. 
.IP "\(bu" 2
lib - Libraries. 
.IP "\(bu" 2
locale - Translation files for \fBKLocale\fP. 
.IP "\(bu" 2
mime - Mime types. 
.IP "\(bu" 2
module - Module (dynamically loaded library). 
.IP "\(bu" 2
qtplugins - \fBQt\fP plugins (dynamically loaded objects for \fBQt\fP) 
.IP "\(bu" 2
services - Services. 
.IP "\(bu" 2
servicetypes - Service types. 
.IP "\(bu" 2
scripts - Application scripting additions. 
.IP "\(bu" 2
sound - Application sounds. 
.IP "\(bu" 2
templates - Templates 
.IP "\(bu" 2
wallpaper - Wallpapers. 
.IP "\(bu" 2
tmp - Temporary files (specific for both current host and current user) 
.IP "\(bu" 2
socket - UNIX Sockets (specific for both current host and current user) 
.IP "\(bu" 2
emoticons - Emoticons themes (Since \fBKDE\fP 3.4)
.PP
A type that is added by the class \fBKApplication\fP if you use it, is appdata. This one makes the use of the type data a bit easier as it appends the name of the application. So while you had to ::locate('data', 'appname/filename') so you can also write ::locate('appdata', 'filename') if your \fBKApplication\fP instance is called 'appname' (as set via KApplication's constructor or \fBKAboutData\fP, if you use the global KStandardDirs object \fBKGlobal::dirs()\fP). Please note though that you cannot use the 'appdata' type if you intend to use it in an applet for Kicker because 'appname' would be 'Kicker' instead of the applet's name. Therefore, for applets, you've got to work around this by using ::locate('data', 'appletname/filename').
.PP
\fBKStandardDirs supports the following environment variables:\fP
.PP
.PD 0
.IP "\(bu" 2
KDEDIRS: This may set an additional number of directory prefixes to search for resources. The directories should be separated by ':'. The directories are searched in the order they are specified. 
.IP "\(bu" 2
KDEDIR: Used for backwards compatibility. As KDEDIRS but only a single directory may be specified. If KDEDIRS is set KDEDIR is ignored. 
.IP "\(bu" 2
KDEHOME: The directory where changes are saved to. This directory is used to search for resources first. If KDEHOME is not specified it defaults to '$HOME/.kde' 
.IP "\(bu" 2
KDEROOTHOME: Like KDEHOME, but used for the root user. If KDEROOTHOME is not set it defaults to the .kde directory in the home directory of root, usually '/root/.kde'. Note that the setting of $HOME is ignored in this case.
.PP
\fBSee also:\fP
.RS 4
\fBKGlobalSettings\fP 
.RE
.PP

.PP
Definition at line 125 of file kstandarddirs.h.
.SH "Constructor & Destructor Documentation"
.PP 
.SS "KStandardDirs::KStandardDirs ()"
.PP
KStandardDirs' constructor. 
.PP
It just initializes the caches. 
.PP
Definition at line 108 of file kstandarddirs.cpp.
.PP
References addKDEDefaults(), and QDict::setAutoDelete().
.SS "KStandardDirs::~\fBKStandardDirs\fP ()\fC [virtual]\fP"
.PP
KStandardDirs' destructor. 
.PP

.PP
Definition at line 118 of file kstandarddirs.cpp.
.SH "Member Function Documentation"
.PP 
.SS "void KStandardDirs::addPrefix (const \fBQString\fP & dir)"
.PP
Adds another search dir to front of the \fCfsstnd\fP list. 
.PP
.PD 0
.IP "\(bu" 2
When compiling kdelibs, the prefix is added to this. 
.IP "\(bu" 2
KDEDIRS or KDEDIR is taking into account 
.IP "\(bu" 2
Additional dirs may be loaded from kdeglobals.
.PP
\fBParameters:\fP
.RS 4
\fIdir\fP The directory to append relative paths to.
.RE
.PP

.PP
Definition at line 180 of file kstandarddirs.cpp.
.PP
Referenced by addCustomized(), and addKDEDefaults().
.SS "void KStandardDirs::addXdgConfigPrefix (const \fBQString\fP & dir)"
.PP
Adds another search dir to front of the XDG_CONFIG_XXX list of prefixes. 
.PP
This prefix is only used for resources that start with 'xdgconf-'
.PP
\fBParameters:\fP
.RS 4
\fIdir\fP The directory to append relative paths to.
.RE
.PP

.PP
Definition at line 200 of file kstandarddirs.cpp.
.PP
Referenced by addCustomized(), and addKDEDefaults().
.SS "void KStandardDirs::addXdgDataPrefix (const \fBQString\fP & dir)"
.PP
Adds another search dir to front of the XDG_DATA_XXX list of prefixes. 
.PP
This prefix is only used for resources that start with 'xdgdata-'
.PP
\fBParameters:\fP
.RS 4
\fIdir\fP The directory to append relative paths to.
.RE
.PP

.PP
Definition at line 220 of file kstandarddirs.cpp.
.PP
Referenced by addCustomized(), and addKDEDefaults().
.SS "bool KStandardDirs::addResourceType (const char * type, const \fBQString\fP & relativename)"
.PP
Adds suffixes for types. 
.PP
You may add as many as you need, but it is advised that there is exactly one to make writing definite. All basic types ( kde_default) are added by \fBaddKDEDefaults()\fP, but for those you can add more relative paths as well.
.PP
The later a suffix is added, the higher its priority. Note, that the suffix should end with / but doesn't have to start with one (as prefixes should end with one). So adding a suffix for app_pics would look like \fBKGlobal::dirs()\fP->addResourceType('app_pics', 'share/app/pics');
.PP
\fBParameters:\fP
.RS 4
\fItype\fP Specifies a short descriptive string to access files of this type. 
.br
\fIrelativename\fP Specifies a directory relative to the root of the KFSSTND. 
.RE
.PP
\fBReturns:\fP
.RS 4
true if successful, false otherwise.
.RE
.PP

.PP
Definition at line 255 of file kstandarddirs.cpp.
.PP
Referenced by addKDEDefaults().
.SS "bool KStandardDirs::addResourceDir (const char * type, const \fBQString\fP & absdir)"
.PP
Adds absolute path at the end of the search path for particular types (for example in case of icons where the user specifies extra paths). 
.PP
You shouldn't need this function in 99% of all cases besides adding user-given paths.
.PP
\fBParameters:\fP
.RS 4
\fItype\fP Specifies a short descriptive string to access files of this type. 
.br
\fIabsdir\fP Points to directory where to look for this specific type. Non-existant directories may be saved but pruned. 
.RE
.PP
\fBReturns:\fP
.RS 4
true if successful, false otherwise.
.RE
.PP

.PP
Definition at line 286 of file kstandarddirs.cpp.
.PP
Referenced by addCustomized(), and addKDEDefaults().
.SS "\fBQString\fP KStandardDirs::findResource (const char * type, const \fBQString\fP & filename) const"
.PP
Tries to find a resource in the following order: 
.PD 0

.IP "\(bu" 2
All PREFIX/<relativename> paths (most recent first). 
.PP

.PP
.PD 0
.IP "\(bu" 2
All absolute paths (most recent first).
.PP
The filename should be a filename relative to the base dir for resources. So is a way to get the path to libkdecore.la to findResource('lib', 'libkdecore.la'). KStandardDirs will then look into the subdir lib of all elements of all prefixes ($KDEDIRS) for a file libkdecore.la and return the path to the first one it finds (e.g. /opt/kde/lib/libkdecore.la)
.PP
\fBParameters:\fP
.RS 4
\fItype\fP The type of the wanted resource 
.br
\fIfilename\fP A relative filename of the resource.
.RE
.PP
\fBReturns:\fP
.RS 4
A full path to the filename specified in the second argument, or QString::null if not found.
.RE
.PP

.PP
Definition at line 317 of file kstandarddirs.cpp.
.PP
References endl(), findResourceDir(), and QString::isEmpty().
.PP
Referenced by KLibLoader::findLibrary().
.SS "bool KStandardDirs::isRestrictedResource (const char * type, const \fBQString\fP & relPath = \fCQString::null\fP) const"
.PP
Checks whether a resource is restricted as part of the KIOSK framework. 
.PP
When a resource is restricted it means that user- specific files in the resource are ignored.
.PP
E.g. by restricting the 'wallpaper' resource, only system-wide installed wallpapers will be found by this class. Wallpapers installed under the $KDEHOME directory will be ignored.
.PP
\fBParameters:\fP
.RS 4
\fItype\fP The type of the resource to check 
.br
\fIrelPath\fP A relative path in the resource.
.RE
.PP
\fBReturns:\fP
.RS 4
True if the resource is restricted. 
.RE
.PP
\fBSince:\fP
.RS 4
3.1
.RE
.PP

.PP
Definition at line 123 of file kstandarddirs.cpp.
.SS "Q_UINT32 KStandardDirs::calcResourceHash (const char * type, const \fBQString\fP & filename, bool deep) const"
.PP
Returns a number that identifies this version of the resource. 
.PP
When a change is made to the resource this number will change.
.PP
\fBParameters:\fP
.RS 4
\fItype\fP The type of the wanted resource 
.br
\fIfilename\fP A relative filename of the resource. 
.br
\fIdeep\fP If true, all resources are taken into account otherwise only the one returned by \fBfindResource()\fP.
.RE
.PP
\fBReturns:\fP
.RS 4
A number identifying the current version of the resource.
.RE
.PP

.PP
Definition at line 352 of file kstandarddirs.cpp.
.PP
References resourceDirs().
.SS "\fBQStringList\fP KStandardDirs::findDirs (const char * type, const \fBQString\fP & reldir) const"
.PP
Tries to find all directories whose names consist of the specified type and a relative path. 
.PP
So would findDirs('apps', 'Settings') return 
.PD 0

.IP "\(bu" 2
/opt/kde/share/applnk/Settings/ 
.IP "\(bu" 2
/home/joe/.kde/share/applnk/Settings/
.PP
Note that it appends / to the end of the directories, so you can use this right away as directory names.
.PP
\fBParameters:\fP
.RS 4
\fItype\fP The type of the base directory. 
.br
\fIreldir\fP Relative directory.
.RE
.PP
\fBReturns:\fP
.RS 4
A list of matching directories, or an empty list if the resource specified is not found.
.RE
.PP

.PP
Definition at line 378 of file kstandarddirs.cpp.
.PP
References QDir::absPath(), QDir::exists(), resourceDirs(), and QDir::setPath().
.SS "\fBQString\fP KStandardDirs::findResourceDir (const char * type, const \fBQString\fP & filename) const"
.PP
Tries to find the directory the file is in. 
.PP
It works the same as \fBfindResource()\fP, but it doesn't return the filename but the name of the directory.
.PP
This way the application can access a couple of files that have been installed into the same directory without having to look for each file.
.PP
findResourceDir('lib', 'libkdecore.la') would return the path of the subdir libkdecore.la is found first in (e.g. /opt/kde/lib/)
.PP
\fBParameters:\fP
.RS 4
\fItype\fP The type of the wanted resource 
.br
\fIfilename\fP A relative filename of the resource. 
.RE
.PP
\fBReturns:\fP
.RS 4
The directory where the file specified in the second argument is located, or QString::null if the type of resource specified is unknown or the resource cannot be found.
.RE
.PP

.PP
Definition at line 412 of file kstandarddirs.cpp.
.PP
References endl(), exists(), and resourceDirs().
.PP
Referenced by findResource().
.SS "\fBQStringList\fP KStandardDirs::findAllResources (const char * type, const \fBQString\fP & filter = \fCQString::null\fP, bool recursive = \fCfalse\fP, bool unique = \fCfalse\fP) const"
.PP
Tries to find all resources with the specified type. 
.PP
The function will look into all specified directories and return all filenames in these directories.
.PP
\fBParameters:\fP
.RS 4
\fItype\fP The type of resource to locate directories for. 
.br
\fIfilter\fP Only accept filenames that fit to filter. The filter may consist of an optional directory and a \fBQRegExp\fP wildcard expression. E.g. 'images\\*.jpg'. Use QString::null if you do not want a filter. 
.br
\fIrecursive\fP Specifies if the function should decend into subdirectories. 
.br
\fIunique\fP If specified, only return items which have unique suffixes - suppressing duplicated filenames.
.RE
.PP
\fBReturns:\fP
.RS 4
List of all the files whose filename matches the specified filter.
.RE
.PP

.PP
Definition at line 675 of file kstandarddirs.cpp.
.PP
Referenced by KLocale::allCountriesTwoAlpha(), KPalette::getPaletteList(), and KConfigINIBackEnd::parseConfigFiles().
.SS "\fBQStringList\fP KStandardDirs::findAllResources (const char * type, const \fBQString\fP & filter, bool recursive, bool unique, \fBQStringList\fP & relPaths) const"
.PP
Tries to find all resources with the specified type. 
.PP
The function will look into all specified directories and return all filenames (full and relative paths) in these directories.
.PP
\fBParameters:\fP
.RS 4
\fItype\fP The type of resource to locate directories for. 
.br
\fIfilter\fP Only accept filenames that fit to filter. The filter may consist of an optional directory and a \fBQRegExp\fP wildcard expression. E.g. 'images\\*.jpg'. Use QString::null if you do not want a filter. 
.br
\fIrecursive\fP Specifies if the function should decend into subdirectories. 
.br
\fIunique\fP If specified, only return items which have unique suffixes. 
.br
\fIrelPaths\fP The list to store the relative paths into These can be used later to ::locate() the file
.RE
.PP
\fBReturns:\fP
.RS 4
List of all the files whose filename matches the specified filter.
.RE
.PP

.PP
Definition at line 619 of file kstandarddirs.cpp.
.PP
References QString::isEmpty(), QString::left(), QString::mid(), and resourceDirs().
.SS "\fBQStringList\fP KStandardDirs::systemPaths (const \fBQString\fP & pstr = \fCQString::null\fP)\fC [static]\fP"
.PP
Returns a \fBQStringList\fP list of pathnames in the system path. 
.PP
\fBParameters:\fP
.RS 4
\fIpstr\fP The path which will be searched. If this is null (default), the $PATH environment variable will be searched.
.RE
.PP
\fBReturns:\fP
.RS 4
a \fBQStringList\fP list of pathnames in the system path.
.RE
.PP

.PP
Definition at line 869 of file kstandarddirs.cpp.
.PP
References QString::find(), QString::isNull(), QString::length(), QString::local8Bit(), QString::mid(), and QString::replace().
.PP
Referenced by findAllExe(), and findExe().
.SS "\fBQString\fP KStandardDirs::findExe (const \fBQString\fP & appname, const \fBQString\fP & pathstr = \fCQString::null\fP, bool ignoreExecBit = \fCfalse\fP)\fC [static]\fP"
.PP
Finds the executable in the system path. 
.PP
A valid executable must be a file and have its executable bit set.
.PP
\fBParameters:\fP
.RS 4
\fIappname\fP The name of the executable file for which to search. 
.br
\fIpathstr\fP The path which will be searched. If this is null (default), the $PATH environment variable will be searched. 
.br
\fIignoreExecBit\fP If true, an existing file will be returned even if its executable bit is not set.
.RE
.PP
\fBReturns:\fP
.RS 4
The path of the executable. If it was not found, it will return QString::null. 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBfindAllExe()\fP
.RE
.PP

.PP
Definition at line 915 of file kstandarddirs.cpp.
.PP
References QFileInfo::exists(), QFileInfo::isExecutable(), QFileInfo::isFile(), QFileInfo::isSymLink(), QFileInfo::setFile(), and systemPaths().
.PP
Referenced by KConfigBackEnd::checkConfigFilesWritable().
.SS "int KStandardDirs::findAllExe (\fBQStringList\fP & list, const \fBQString\fP & appname, const \fBQString\fP & pathstr = \fCQString::null\fP, bool ignoreExecBit = \fCfalse\fP)\fC [static]\fP"
.PP
Finds all occurrences of an executable in the system path. 
.PP
\fBParameters:\fP
.RS 4
\fIlist\fP Will be filled with the pathnames of all the executables found. Will be empty if the executable was not found. 
.br
\fIappname\fP The name of the executable for which to search. 
.br
\fIpathstr\fP The path list which will be searched. If this is 0 (default), the $PATH environment variable will be searched. 
.br
\fIignoreExecBit\fP If true, an existing file will be returned even if its executable bit is not set.
.RE
.PP
\fBReturns:\fP
.RS 4
The number of executables found, 0 if none were found.
.RE
.PP
\fBSee also:\fP
.RS 4
\fBfindExe()\fP
.RE
.PP

.PP
Definition at line 964 of file kstandarddirs.cpp.
.PP
References QFileInfo::exists(), QFileInfo::isExecutable(), QFileInfo::isFile(), QFileInfo::setFile(), and systemPaths().
.SS "void KStandardDirs::addKDEDefaults ()"
.PP
This function adds the defaults that are used by the current \fBKDE\fP version. 
.PP
It's a series of addResourceTypes() and \fBaddPrefix()\fP calls. You normally wouldn't call this function because it's called for you from \fBKGlobal\fP.
.PP
Definition at line 1268 of file kstandarddirs.cpp.
.PP
References addPrefix(), addResourceDir(), addResourceType(), addXdgConfigPrefix(), addXdgDataPrefix(), QDir::homeDirPath(), QString::isEmpty(), kde_default(), QString::length(), and KShell::tildeExpand().
.PP
Referenced by KStandardDirs().
.SS "bool KStandardDirs::addCustomized (\fBKConfig\fP * config)"
.PP
Reads customized entries out of the given config object and add them via addResourceDirs(). 
.PP
\fBParameters:\fP
.RS 4
\fIconfig\fP The object the entries are read from. This should contain global config files 
.RE
.PP
\fBReturns:\fP
.RS 4
true if new config paths have been added from \fCconfig\fP. 
.RE
.PP

.PP
Definition at line 1496 of file kstandarddirs.cpp.
.PP
References addPrefix(), addResourceDir(), addXdgConfigPrefix(), addXdgDataPrefix(), QString::append(), QString::arg(), QMap::begin(), QMap::end(), QString::endsWith(), QString::find(), QString::fromLatin1(), QString::insert(), QString::isEmpty(), QString::latin1(), QString::left(), QString::length(), KUser< T >::loginName(), QString::mid(), QDict::remove(), resourceDirs(), QStringList::split(), and QString::startsWith().
.PP
Referenced by KInstance::config().
.SS "\fBQStringList\fP KStandardDirs::resourceDirs (const char * type) const"
.PP
This function is used internally by almost all other function as it serves and fills the directories cache. 
.PP
\fBParameters:\fP
.RS 4
\fItype\fP The type of resource 
.RE
.PP
\fBReturns:\fP
.RS 4
The list of possible directories for the specified \fCtype\fP. The function updates the cache if possible. If the resource type specified is unknown, it will return an empty list. Note, that the directories are assured to exist beside the save location, which may not exist, but is returned anyway.
.RE
.PP

.PP
Definition at line 782 of file kstandarddirs.cpp.
.PP
References endl(), QDir::exists(), QDict::find(), QDict::insert(), realPath(), and QDir::setPath().
.PP
Referenced by addCustomized(), KIconLoader::addExtraDesktopThemes(), calcResourceHash(), findAllResources(), findDirs(), findResourceDir(), KIconTheme::KIconTheme(), KLocale::langLookup(), KIconTheme::list(), relativeLocation(), and saveLocation().
.SS "\fBQStringList\fP KStandardDirs::allTypes () const"
.PP
This function will return a list of all the types that KStandardDirs supports. 
.PP
\fBReturns:\fP
.RS 4
All types that \fBKDE\fP supports
.RE
.PP

.PP
Definition at line 157 of file kstandarddirs.cpp.
.SS "\fBQString\fP KStandardDirs::saveLocation (const char * type, const \fBQString\fP & suffix = \fCQString::null\fP, bool create = \fCtrue\fP) const"
.PP
Finds a location to save files into for the given type in the user's home directory. 
.PP
\fBParameters:\fP
.RS 4
\fItype\fP The type of location to return. 
.br
\fIsuffix\fP A subdirectory name. Makes it easier for you to create subdirectories. You can't pass filenames here, you _have_ to pass directory names only and add possible filename in that directory yourself. A directory name always has a trailing slash ('/'). 
.br
\fIcreate\fP If set, \fBsaveLocation()\fP will create the directories needed (including those given by \fCsuffix\fP).
.RE
.PP
\fBReturns:\fP
.RS 4
A path where resources of the specified type should be saved, or QString::null if the resource type is unknown.
.RE
.PP

.PP
Definition at line 1072 of file kstandarddirs.cpp.
.PP
References endl(), QString::endsWith(), QDict::find(), QDict::insert(), localkdedir(), localxdgconfdir(), localxdgdatadir(), makeDir(), realPath(), QDict::remove(), and resourceDirs().
.PP
Referenced by KConfigBackEnd::changeFileName().
.SS "\fBQString\fP KStandardDirs::relativeLocation (const char * type, const \fBQString\fP & absPath)"
.PP
Converts an absolute path to a path relative to a certain resource. 
.PP
If 'abs = ::locate(resource, rel)' then 'rel = relativeLocation(resource, abs)' and vice versa.
.PP
\fBParameters:\fP
.RS 4
\fItype\fP The type of resource.
.br
\fIabsPath\fP An absolute path to make relative.
.RE
.PP
\fBReturns:\fP
.RS 4
A relative path relative to resource \fCtype\fP that will find \fCabsPath\fP. If no such relative path exists, absPath will be returned unchanged. 
.RE
.PP

.PP
Definition at line 1129 of file kstandarddirs.cpp.
.PP
References QString::findRev(), QString::mid(), realPath(), resourceDirs(), and QString::startsWith().
.PP
Referenced by KDesktopFile::isAuthorizedDesktopFile(), and KDesktopFile::locateLocal().
.SS "bool KStandardDirs::makeDir (const \fBQString\fP & dir, int mode = \fC0755\fP)\fC [static]\fP"
.PP
Recursively creates still-missing directories in the given path. 
.PP
The resulting permissions will depend on the current umask setting. permission = mode & ~umask.
.PP
\fBParameters:\fP
.RS 4
\fIdir\fP Absolute path of the directory to be made. 
.br
\fImode\fP Directory permissions. 
.RE
.PP
\fBReturns:\fP
.RS 4
true if successful, false otherwise
.RE
.PP

.PP
Definition at line 1151 of file kstandarddirs.cpp.
.PP
References QFile::encodeName(), QString::find(), QString::length(), QString::mid(), and QCString::prepend().
.PP
Referenced by KConfigINIBackEnd::parseConfigFiles(), saveLocation(), and KConfigINIBackEnd::sync().
.SS "\fBQString\fP KStandardDirs::kde_default (const char * type)\fC [static]\fP"
.PP
This returns a default relative path for the standard \fBKDE\fP resource types. 
.PP
Below is a list of them so you get an idea of what this is all about.
.PP
.PD 0
.IP "\(bu" 2
data - share/apps 
.IP "\(bu" 2
html - share/doc/HTML 
.IP "\(bu" 2
icon - share/icon 
.IP "\(bu" 2
config - share/config 
.IP "\(bu" 2
pixmap - share/pixmaps 
.IP "\(bu" 2
apps - share/applnk 
.IP "\(bu" 2
sound - share/sounds 
.IP "\(bu" 2
locale - share/locale 
.IP "\(bu" 2
services - share/services 
.IP "\(bu" 2
servicetypes - share/servicetypes 
.IP "\(bu" 2
mime - share/mimelnk 
.IP "\(bu" 2
wallpaper - share/wallpapers 
.IP "\(bu" 2
templates - share/templates 
.IP "\(bu" 2
exe - bin 
.IP "\(bu" 2
lib - lib
.PP
\fBReturns:\fP
.RS 4
Static default for the specified resource. You should probably be using \fBlocate()\fP or \fBlocateLocal()\fP instead. 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBlocate()\fP 
.PP
\fBlocateLocal()\fP
.RE
.PP

.PP
Definition at line 1019 of file kstandarddirs.cpp.
.PP
Referenced by addKDEDefaults().
.SS "\fBQString\fP KStandardDirs::localkdedir () const"
.PP
Returns the toplevel directory in which KStandardDirs will store things. 
.PP
Most likely $HOME/.kde Don't use this function if you can use locateLocal 
.PP
\fBReturns:\fP
.RS 4
the toplevel directory
.RE
.PP

.PP
Definition at line 1628 of file kstandarddirs.cpp.
.PP
Referenced by saveLocation().
.SS "\fBQString\fP KStandardDirs::localxdgdatadir () const"
.PP
\fBReturns:\fP
.RS 4
$XDG_DATA_HOME See also http://www.freedesktop.org/standards/basedir/draft/basedir-spec/basedir-spec.html
.RE
.PP

.PP
Definition at line 1634 of file kstandarddirs.cpp.
.PP
Referenced by saveLocation().
.SS "\fBQString\fP KStandardDirs::localxdgconfdir () const"
.PP
\fBReturns:\fP
.RS 4
$XDG_CONFIG_HOME See also http://www.freedesktop.org/standards/basedir/draft/basedir-spec/basedir-spec.html
.RE
.PP

.PP
Definition at line 1640 of file kstandarddirs.cpp.
.PP
Referenced by saveLocation().
.SS "bool KStandardDirs::exists (const \fBQString\fP & fullPath)\fC [static]\fP"
.PP
Checks for existence and accessability of a file or directory. 
.PP
Faster than creating a \fBQFileInfo\fP first. 
.PP
\fBParameters:\fP
.RS 4
\fIfullPath\fP the path to check. IMPORTANT: must end with a slash if expected to be a directory (and no slash for a file, obviously). 
.RE
.PP
\fBReturns:\fP
.RS 4
true if the directory exists
.RE
.PP

.PP
Definition at line 450 of file kstandarddirs.cpp.
.PP
Referenced by findResourceDir(), and KIconTheme::KIconTheme().
.SS "\fBQString\fP KStandardDirs::realPath (const \fBQString\fP & dirname)\fC [static]\fP"
.PP
Expands all symbolic links and resolves references to '/./', '/../' and extra '/' characters in \fCdirname\fP and returns the canonicalized absolute pathname. 
.PP
The resulting path will have no symbolic link, '/./' or '/../' components. 
.PP
\fBSince:\fP
.RS 4
3.1
.RE
.PP

.PP
Definition at line 685 of file kstandarddirs.cpp.
.PP
References QFile::decodeName().
.PP
Referenced by KMountPoint::currentMountPoints(), KMountPoint::possibleMountPoints(), relativeLocation(), resourceDirs(), and saveLocation().
.SS "\fBQString\fP KStandardDirs::realFilePath (const \fBQString\fP & filename)\fC [static]\fP"
.PP
Expands all symbolic links and resolves references to '/./', '/../' and extra '/' characters in \fCfilename\fP and returns the canonicalized absolute pathname. 
.PP
The resulting path will have no symbolic link, '/./' or '/../' components. 
.PP
\fBSince:\fP
.RS 4
3.4
.RE
.PP

.PP
Definition at line 703 of file kstandarddirs.cpp.
.PP
References QFile::decodeName().
.PP
Referenced by KSaveFile::KSaveFile().

.SH "Author"
.PP 
Generated automatically by Doxygen for kdecore Library from the source code.
