.TH "KStandardDirs" 3 "28 Jan 2004" "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
.RI "\fIKStandardDirs' constructor. \fP"
.ti -1c
.RI "virtual \fB~KStandardDirs\fP ()"
.br
.RI "\fIKStandardDirs' destructor. \fP"
.ti -1c
.RI "void \fBaddPrefix\fP (const  \fBQString\fP &dir)"
.br
.RI "\fIAdds another search dir to front of the \fCfsstnd\fP list. \fP"
.ti -1c
.RI "bool \fBaddResourceType\fP (const  char *type, const  \fBQString\fP &relativename)"
.br
.RI "\fIAdds suffixes for types. \fP"
.ti -1c
.RI "bool \fBaddResourceDir\fP (const  char *type, const  \fBQString\fP &absdir)"
.br
.RI "\fIAdds absolute path at the end of the search path for particular types (for example in case of icons where the user specifies extra paths). \fP"
.ti -1c
.RI "\fBQString\fP \fBfindResource\fP (const  char *type, const  \fBQString\fP &filename) const "
.br
.RI "\fITries to find a resource in the following order: 
.IP "\(bu" 2
All PREFIX/ paths (most recent first). 
.PP
\fP"
.ti -1c
.RI "bool \fBisRestrictedResource\fP (const  char *type, const  \fBQString\fP &relPath=QString::null) const "
.br
.RI "\fIChecks whether a resource is restricted as part of the KIOSK framework. \fP"
.ti -1c
.RI "Q_UINT32 \fBcalcResourceHash\fP (const  char *type, const  \fBQString\fP &filename, bool deep) const "
.br
.RI "\fIReturns a number that identifies this version of the resource. \fP"
.ti -1c
.RI "\fBQStringList\fP \fBfindDirs\fP (const  char *type, const  \fBQString\fP &reldir) const "
.br
.RI "\fITries to find all directories whose names consist of the specified type and a relative path. \fP"
.ti -1c
.RI "\fBQString\fP \fBfindResourceDir\fP (const  char *type, const  \fBQString\fP &filename) const "
.br
.RI "\fITries to find the directory the file is in. \fP"
.ti -1c
.RI "\fBQStringList\fP \fBfindAllResources\fP (const  char *type, const  \fBQString\fP &filter=QString::null, bool recursive=false, bool uniq=false) const "
.br
.RI "\fITries to find all resources with the specified type. \fP"
.ti -1c
.RI "\fBQStringList\fP \fBfindAllResources\fP (const  char *type, const  \fBQString\fP &filter, bool recursive, bool uniq, \fBQStringList\fP &relPaths) const "
.br
.RI "\fITries to find all resources with the specified type. \fP"
.ti -1c
.RI "void \fBaddKDEDefaults\fP ()"
.br
.RI "\fIThis function adds the defaults that are used by the current \fBKDE\fP version. \fP"
.ti -1c
.RI "bool \fBaddCustomized\fP (\fBKConfig\fP *config)"
.br
.RI "\fIReads customized entries out of the given config object and add them via \fBaddResourceDirs\fP(). \fP"
.ti -1c
.RI "\fBQStringList\fP \fBresourceDirs\fP (const  char *type) const "
.br
.RI "\fIThis function is used internally by almost all other function as it serves and fills the directories cache. \fP"
.ti -1c
.RI "\fBQStringList\fP \fBallTypes\fP () const "
.br
.RI "\fIThis function will return a list of all the types that KStandardDirs supports. \fP"
.ti -1c
.RI "\fBQString\fP \fBsaveLocation\fP (const  char *type, const  \fBQString\fP &suffix=QString::null, bool create=true) const "
.br
.RI "\fIFinds a location to save files into for the given type in the user's home directory. \fP"
.ti -1c
.RI "\fBQString\fP \fBrelativeLocation\fP (const  char *type, const  \fBQString\fP &absPath)"
.br
.RI "\fIConverts an absolute path to a path relative to a certain resource. \fP"
.ti -1c
.RI "\fBQString\fP \fBkfsstnd_prefixes\fP ()"
.br
.ti -1c
.RI "\fBQString\fP \fBlocalkdedir\fP () const "
.br
.RI "\fIReturns the toplevel directory in which KStandardDirs will store things. \fP"
.in -1c
.SS "Static Public Member Functions"

.in +1c
.ti -1c
.RI "\fBQString\fP \fBfindExe\fP (const  \fBQString\fP &appname, const  \fBQString\fP &pathstr=QString::null, bool ignoreExecBit=false)"
.br
.RI "\fIFinds the executable in the system path. \fP"
.ti -1c
.RI "int \fBfindAllExe\fP (\fBQStringList\fP &list, const  \fBQString\fP &appname, const  \fBQString\fP &pathstr=QString::null, bool ignoreExecBit=false)"
.br
.RI "\fIFinds all occurences of an executable in the system path. \fP"
.ti -1c
.RI "bool \fBmakeDir\fP (const  \fBQString\fP &dir, int mode=0755)"
.br
.RI "\fIRecursively creates still-missing directories in the given path. \fP"
.ti -1c
.RI "\fBQString\fP \fBkde_default\fP (const  char *type)"
.br
.RI "\fIThis returns a default relative path for the standard \fBKDE\fP resource types. \fP"
.ti -1c
.RI "bool \fBexists\fP (const  \fBQString\fP &fullPath)"
.br
.RI "\fIChecks for existence and accessability. \fP"
.ti -1c
.RI "\fBQString\fP \fBrealPath\fP (const  \fBQString\fP &dirname)"
.br
.RI "\fIExpands all symbolic links and resolves references to '/./', '/../' and extra '/' characters in \fCdirname\fP and returns the canonicalized absolute pathname. \fP"
.in -1c
.SS "Related Functions"
(Note that these are not member functions.) 
.in +1c
.ti -1c
.RI "\fBQString\fP \fBlocate\fP (const char *type, const \fBQString\fP &filename, const \fBKInstance\fP *instance=KGlobal::instance())"
.br
.ti -1c
.RI "\fBQString\fP \fBlocateLocal\fP (const char *type, const \fBQString\fP &filename, 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
\fBVersion:\fP
.RS 4
\fBId\fP.RS 4
\fBkstandarddirs.h\fP,v 1.100.2.1 2003/01/08 16:15:51 waba Exp 
.RE
.PP
.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 basicly 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
\fB Standard resources that kdelibs allocates are:\fP
.PP
\fB 
.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 (specfic for both current host and current user) 
.IP "\(bu" 2
socket - UNIX Sockets (specific for both current host and current user)
.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').\fP
.PP
\fB \fP
.PP
\fB\fB KStandardDirs supports the following environment variables:\fP\fP
.PP
\fB\fB 
.IP "\(bu" 2
KDEDIRS: This may set an additional number of directory prefixes to search for resources. The directories should be seperated 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
\fP\fP
.PP
Definition at line 125 of file kstandarddirs.h.
.SH "Constructor & Destructor Documentation"
.PP 
.SS "KStandardDirs::KStandardDirs ()"
.PP
KStandardDirs' constructor. It just initializes the caches. Definition at line 77 of file kstandarddirs.cpp.
.PP
References addKDEDefaults(), QDict< QString >::setAutoDelete(), and QDict< QStringList >::setAutoDelete().
.SS "KStandardDirs::~\fBKStandardDirs\fP ()\fC [virtual]\fP"
.PP
KStandardDirs' destructor. Definition at line 86 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. .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
Definition at line 134 of file kstandarddirs.cpp.
.PP
References QString::at(), QDict< QStringList >::clear(), QString::isNull(), and QString::length().
.PP
Referenced by addCustomized(), and addKDEDefaults().
.SS "bool KStandardDirs::addResourceType (const char * type, const \fBQString\fP & relativename)"
.PP
Adds suffixes for types. You may add as many as you need, but it is advised that there is exactly one to make writing definite. All basic types (\fBkde_default\fP) 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
Definition at line 154 of file kstandarddirs.cpp.
.PP
References KStdAction::copy(), QDict< QStringList >::find(), QDict< QStringList >::insert(), QString::isNull(), and QDict< QStringList >::remove().
.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). 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
Definition at line 176 of file kstandarddirs.cpp.
.PP
References KStdAction::copy(), QDict< QStringList >::find(), QDict< QStringList >::insert(), and QDict< QStringList >::remove().
.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: 
.IP "\(bu" 2
All PREFIX/ paths (most recent first). 
.PP
.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
Definition at line 196 of file kstandarddirs.cpp.
.PP
References QString::at(), findResourceDir(), and QString::isNull().
.PP
Referenced by KLibLoader::findLibrary(), and locate().
.SS "bool KStandardDirs::isRestrictedResource (const char * type, const \fBQString\fP & relPath = QString::null) const"
.PP
Checks whether a resource is restricted as part of the KIOSK framework. 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
Definition at line 92 of file kstandarddirs.cpp.
.PP
Referenced by KConfigINIBackEnd::parseConfigFiles().
.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. 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
Definition at line 231 of file kstandarddirs.cpp.
.PP
References QString::at(), and 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. So would findDirs('apps', 'Settings') return 
.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
Definition at line 257 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. 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
Definition at line 279 of file kstandarddirs.cpp.
.PP
References exists(), QString::isEmpty(), and resourceDirs().
.PP
Referenced by findResource().
.SS "\fBQStringList\fP KStandardDirs::findAllResources (const char * type, const \fBQString\fP & filter = QString::null, bool recursive = false, bool uniq = false) const"
.PP
Tries to find all resources with the specified type. 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
\fIuniq\fP If specified, only return items which have unique suffixes - suppressing duplicated filenames.
.RE
.PP
\fBReturns:\fP
.RS 4
A list of directories matching the resource specified, or an empty list if the resource type is unknown.
.RE
.PP
Definition at line 513 of file kstandarddirs.cpp.
.PP
Referenced by KLocale::allCountriesTwoAlpha(), and KPalette::getPaletteList().
.SS "\fBQStringList\fP KStandardDirs::findAllResources (const char * type, const \fBQString\fP & filter, bool recursive, bool uniq, \fBQStringList\fP & relPaths) const"
.PP
Tries to find all resources with the specified type. 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
\fIuniq\fP If specified, only return items which have unique suffixes. 
.br
\fIlist\fP Of relative paths for the given type. 
.br
\fIrelPaths\fP The list to store the relative paths into These can be used later to \fBlocate()\fP the file
.RE
.PP
\fBReturns:\fP
.RS 4
A list of directories matching the resource specified, or an empty list if the resource type is unknown.
.RE
.PP
Definition at line 465 of file kstandarddirs.cpp.
.PP
References QString::at(), QString::findRev(), QString::isEmpty(), QString::left(), QString::length(), QString::mid(), and resourceDirs().
.SS "\fBQString\fP KStandardDirs::findExe (const \fBQString\fP & appname, const \fBQString\fP & pathstr = QString::null, bool ignoreExecBit = false)\fC [static]\fP"
.PP
Finds the executable in the system path. 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
Definition at line 672 of file kstandarddirs.cpp.
.PP
References QString::arg(), QFileInfo::exists(), QString::find(), QString::fromLatin1(), QString::fromLocal8Bit(), QDir::homeDirPath(), QFileInfo::isExecutable(), QFileInfo::isFile(), QFileInfo::isSymLink(), QString::length(), QString::local8Bit(), QString::mid(), QString::replace(), QFileInfo::setFile(), and QString::startsWith().
.PP
Referenced by resourceDirs().
.SS "int KStandardDirs::findAllExe (\fBQStringList\fP & list, const \fBQString\fP & appname, const \fBQString\fP & pathstr = QString::null, bool ignoreExecBit = false)\fC [static]\fP"
.PP
Finds all occurences of an executable in the system path. \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
Definition at line 742 of file kstandarddirs.cpp.
.PP
References QFileInfo::exists(), QFileInfo::isExecutable(), QFileInfo::isFile(), and QFileInfo::setFile().
.SS "void KStandardDirs::addKDEDefaults ()"
.PP
This function adds the defaults that are used by the current \fBKDE\fP version. It's a series of \fBaddResourceTypes\fP() and \fBaddPrefix\fP() calls. You normally wouldn't call this function because it's called for you from \fBKGlobal\fP.Definition at line 966 of file kstandarddirs.cpp.
.PP
References addPrefix(), addResourceDir(), addResourceType(), QFile::decodeName(), QDir::homeDirPath(), QString::isEmpty(), kde_default(), and QString::length().
.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 \fBaddResourceDirs\fP(). \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
Definition at line 1056 of file kstandarddirs.cpp.
.PP
References addPrefix(), addResourceDir(), QMap::begin(), QMap::end(), KConfig::entryMap(), KConfigBase::group(), KStdAccel::key(), QString::latin1(), KConfigBase::readBoolEntry(), KConfigBase::readListEntry(), QDict< QStringList >::remove(), resourceDirs(), KConfigBase::setGroup(), and QStringList::split().
.PP
Referenced by KInstance::config(), KInstance::dirs(), and KConfig::KConfig().
.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. \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
Definition at line 540 of file kstandarddirs.cpp.
.PP
References QDir::cleanDirPath(), QFile::decodeName(), QFile::encodeName(), QDir::exists(), QDict< QStringList >::find(), findExe(), QString::fromLatin1(), QDict< QStringList >::insert(), QString::isEmpty(), localkdedir(), 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. \fBReturns:\fP
.RS 4
All types that \fBKDE\fP supports
.RE
.PP
Definition at line 126 of file kstandarddirs.cpp.
.PP
References QString::fromLatin1().
.SS "\fBQString\fP KStandardDirs::saveLocation (const char * type, const \fBQString\fP & suffix = QString::null, bool create = true) const"
.PP
Finds a location to save files into for the given type in the user's home directory. \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
Definition at line 840 of file kstandarddirs.cpp.
.PP
References KStdAction::create(), QFile::encodeName(), QDict< QStringList >::find(), QDict< QString >::find(), QDict< QString >::insert(), localkdedir(), makeDir(), realPath(), QDict< QStringList >::remove(), and resourceDirs().
.PP
Referenced by KConfigBackEnd::changeFileName(), and locateLocal().
.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. 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
Definition at line 888 of file kstandarddirs.cpp.
.PP
References QString::findRev(), QString::left(), QString::mid(), realPath(), resourceDirs(), and QString::startsWith().
.PP
Referenced by KDesktopFile::isAuthorizedDesktopFile().
.SS "bool KStandardDirs::makeDir (const \fBQString\fP & dir, int mode = 0755)\fC [static]\fP"
.PP
Recursively creates still-missing directories in the given path. 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
Definition at line 910 of file kstandarddirs.cpp.
.PP
References QString::at(), QFile::encodeName(), QString::find(), QString::length(), and QString::mid().
.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. Below is a list of them so you get an idea of what this is all about.
.PP
.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
Definition at line 799 of file kstandarddirs.cpp.
.PP
Referenced by KIconLoader::addAppDir(), and addKDEDefaults().
.SS "\fBQString\fP KStandardDirs::localkdedir () const"
.PP
Returns the toplevel directory in which KStandardDirs will store things. Most likely $HOME/.kde Don't use this function if you can use locateLocal 
.PP
\fBReturns:\fP
.RS 4
the toplevel directory
.RE
.PP
Definition at line 1121 of file kstandarddirs.cpp.
.PP
Referenced by resourceDirs(), and saveLocation().
.SS "bool KStandardDirs::exists (const \fBQString\fP & fullPath)\fC [static]\fP"
.PP
Checks for existence and accessability. Faster than creating a \fBQFileInfo\fP first. 
.PP
\fBParameters:\fP
.RS 4
\fIfullPath\fP the path to check 
.RE
.PP
\fBReturns:\fP
.RS 4
true if the directory exists
.RE
.PP
Definition at line 307 of file kstandarddirs.cpp.
.PP
References QFile::encodeName().
.PP
Referenced by KIconLoader::addExtraDesktopThemes(), findResourceDir(), KIconTheme::KIconTheme(), and KIconTheme::list().
.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. The resulting path will have no symbolic link, '/./' or '/../' components. 
.PP
\fBSince:\fP
.RS 4
3.1 
.RE
.PP
Definition at line 523 of file kstandarddirs.cpp.
.PP
References QFile::decodeName(), and QFile::encodeName().
.PP
Referenced by relativeLocation(), resourceDirs(), and saveLocation().

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