\section{KStandard\-Dirs Class Reference}
\label{classKStandardDirs}\index{KStandardDirs@{KStandardDirs}}
Site-independent access to standard {\bf KDE}{\rm (p.\,\pageref{namespaceKDE})} directories.  


{\tt \#include $<$kstandarddirs.h$>$}

Collaboration diagram for KStandard\-Dirs:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=170pt]{classKStandardDirs__coll__graph}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
{\bf KStandard\-Dirs} ()
\item 
virtual {\bf $\sim$KStandard\-Dirs} ()
\item 
void {\bf add\-Prefix} (const {\bf QString} \&dir)
\item 
void {\bf add\-Xdg\-Config\-Prefix} (const {\bf QString} \&dir)
\item 
void {\bf add\-Xdg\-Data\-Prefix} (const {\bf QString} \&dir)
\item 
bool {\bf add\-Resource\-Type} (const char $\ast$type, const {\bf QString} \&relativename)
\item 
bool {\bf add\-Resource\-Dir} (const char $\ast$type, const {\bf QString} \&absdir)
\item 
{\bf QString} {\bf find\-Resource} (const char $\ast$type, const {\bf QString} \&filename) const 
\item 
bool {\bf is\-Restricted\-Resource} (const char $\ast$type, const {\bf QString} \&rel\-Path=QString::null) const 
\item 
Q\_\-UINT32 {\bf calc\-Resource\-Hash} (const char $\ast$type, const {\bf QString} \&filename, bool deep) const 
\item 
{\bf QString\-List} {\bf find\-Dirs} (const char $\ast$type, const {\bf QString} \&reldir) const 
\item 
{\bf QString} {\bf find\-Resource\-Dir} (const char $\ast$type, const {\bf QString} \&filename) const 
\item 
{\bf QString\-List} {\bf find\-All\-Resources} (const char $\ast$type, const {\bf QString} \&filter=QString::null, bool recursive=false, bool unique=false) const 
\item 
{\bf QString\-List} {\bf find\-All\-Resources} (const char $\ast$type, const {\bf QString} \&filter, bool recursive, bool unique, {\bf QString\-List} \&rel\-Paths) const 
\item 
void {\bf add\-KDEDefaults} ()
\item 
bool {\bf add\-Customized} ({\bf KConfig} $\ast$config)
\item 
{\bf QString\-List} {\bf resource\-Dirs} (const char $\ast$type) const 
\item 
{\bf QString\-List} {\bf all\-Types} () const 
\item 
{\bf QString} {\bf save\-Location} (const char $\ast$type, const {\bf QString} \&suffix=QString::null, bool create=true) const 
\item 
{\bf QString} {\bf relative\-Location} (const char $\ast$type, const {\bf QString} \&abs\-Path)
\item 
{\bf QString} {\bf kfsstnd\_\-prefixes} ()\label{classKStandardDirs_a20}

\item 
{\bf QString} {\bf kfsstnd\_\-xdg\_\-conf\_\-prefixes} ()\label{classKStandardDirs_a21}

\item 
{\bf QString} {\bf kfsstnd\_\-xdg\_\-data\_\-prefixes} ()\label{classKStandardDirs_a22}

\item 
{\bf QString} {\bf localkdedir} () const 
\item 
{\bf QString} {\bf localxdgdatadir} () const 
\item 
{\bf QString} {\bf localxdgconfdir} () const 
\end{CompactItemize}
\subsection*{Static Public Member Functions}
\begin{CompactItemize}
\item 
static {\bf QString\-List} {\bf system\-Paths} (const {\bf QString} \&pstr=QString::null)
\item 
static {\bf QString} {\bf find\-Exe} (const {\bf QString} \&appname, const {\bf QString} \&pathstr=QString::null, bool ignore\-Exec\-Bit=false)
\item 
static int {\bf find\-All\-Exe} ({\bf QString\-List} \&list, const {\bf QString} \&appname, const {\bf QString} \&pathstr=QString::null, bool ignore\-Exec\-Bit=false)
\item 
static bool {\bf make\-Dir} (const {\bf QString} \&dir, int mode=0755)
\item 
static {\bf QString} {\bf kde\_\-default} (const char $\ast$type)
\item 
static {\bf QString} {\bf kfsstnd\_\-defaultprefix} ()\label{classKStandardDirs_e5}

\item 
static {\bf QString} {\bf kfsstnd\_\-defaultbindir} ()\label{classKStandardDirs_e6}

\item 
static bool {\bf exists} (const {\bf QString} \&full\-Path)
\item 
static {\bf QString} {\bf real\-Path} (const {\bf QString} \&dirname)
\item 
static {\bf QString} {\bf real\-File\-Path} (const {\bf QString} \&filename)
\end{CompactItemize}
\subsection*{Related Functions}
(Note that these are not member functions.) \begin{CompactItemize}
\item 
KDECORE\_\-EXPORT {\bf QString} {\bf locate} (const char $\ast$type, const {\bf QString} \&filename, const {\bf KInstance} $\ast$instance=KGlobal::instance())
\item 
KDECORE\_\-EXPORT {\bf QString} {\bf locate\-Local} (const char $\ast$type, const {\bf QString} \&filename, const {\bf KInstance} $\ast$instance=KGlobal::instance())
\item 
KDECORE\_\-EXPORT {\bf QString} {\bf locate\-Local} (const char $\ast$type, const {\bf QString} \&filename, bool create\-Dir, const {\bf KInstance} $\ast$instance=KGlobal::instance())
\end{CompactItemize}


\subsection{Detailed Description}
Site-independent access to standard {\bf KDE}{\rm (p.\,\pageref{namespaceKDE})} directories. 

\begin{Desc}
\item[Author:]Stephan Kulow $<${\tt coolo@kde.org}$>$ and Sirtaj Singh Kang $<${\tt taj@kde.org}$>$\end{Desc}
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.

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 {\bf KStandard\-Dirs::find\-Resource}{\rm (p.\,\pageref{classKStandardDirs_a7})}(\char`\"{}apps\char`\"{}, \char`\"{}Home.desktop\char`\"{}) to apply this knowledge to return /opt/kde/share/applnk/Home.desktop or ::locate(\char`\"{}data\char`\"{}, \char`\"{}kgame/background.jpg\char`\"{}) to return /opt/kde/share/apps/kgame/background.jpg

The main idea behind KStandard\-Dirs 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 \char`\"{}html\char`\"{} 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 KStandard\-Dirs 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.

{\bf Standard resources that kdelibs allocates are:}\par


\begin{itemize}
\item apps - Applications menu (.desktop files). \item cache - Cached information (e.g. favicons, web-pages) \item cgi - CGIs to run from kdehelp. \item config - Configuration files. \item data - Where applications store data. \item exe - Executables in \$prefix/bin. {\bf find\-Exe()}{\rm (p.\,\pageref{classKStandardDirs_e1})} for a function that takes \$PATH into account. \item html - HTML documentation. \item icon - Icons, see {\bf KIcon\-Loader}{\rm (p.\,\pageref{classKIconLoader})}. \item lib - Libraries. \item locale - Translation files for {\bf KLocale}{\rm (p.\,\pageref{classKLocale})}. \item mime - Mime types. \item module - Module (dynamically loaded library). \item qtplugins - {\bf Qt} plugins (dynamically loaded objects for {\bf Qt}) \item services - Services. \item servicetypes - Service types. \item scripts - Application scripting additions. \item sound - Application sounds. \item templates - Templates \item wallpaper - Wallpapers. \item tmp - Temporary files (specific for both current host and current user) \item socket - UNIX Sockets (specific for both current host and current user) \item emoticons - Emoticons themes (Since {\bf KDE}{\rm (p.\,\pageref{namespaceKDE})} 3.4)\end{itemize}
A type that is added by the class {\bf KApplication}{\rm (p.\,\pageref{classKApplication})} 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(\char`\"{}data\char`\"{}, \char`\"{}appname/filename\char`\"{}) so you can also write ::locate(\char`\"{}appdata\char`\"{}, \char`\"{}filename\char`\"{}) if your {\bf KApplication}{\rm (p.\,\pageref{classKApplication})} instance is called \char`\"{}appname\char`\"{} (as set via KApplication's constructor or {\bf KAbout\-Data}{\rm (p.\,\pageref{classKAboutData})}, if you use the global KStandard\-Dirs object {\bf KGlobal::dirs()}{\rm (p.\,\pageref{classKGlobal_e1})}). Please note though that you cannot use the \char`\"{}appdata\char`\"{} type if you intend to use it in an applet for Kicker because 'appname' would be \char`\"{}Kicker\char`\"{} instead of the applet's name. Therefore, for applets, you've got to work around this by using ::locate(\char`\"{}data\char`\"{}, \char`\"{}appletname/filename\char`\"{}).

{\bf KStandard\-Dirs supports the following environment variables:}

\begin{itemize}
\item 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. \item KDEDIR: Used for backwards compatibility. As KDEDIRS but only a single directory may be specified. If KDEDIRS is set KDEDIR is ignored. \item 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 \char`\"{}\$HOME/.kde\char`\"{} \item 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 \char`\"{}/root/.kde\char`\"{}. Note that the setting of \$HOME is ignored in this case.\end{itemize}
\begin{Desc}
\item[See also:]{\bf KGlobal\-Settings}{\rm (p.\,\pageref{classKGlobalSettings})} \end{Desc}




Definition at line 125 of file kstandarddirs.h.

\subsection{Constructor \& Destructor Documentation}
\index{KStandardDirs@{KStandard\-Dirs}!KStandardDirs@{KStandardDirs}}
\index{KStandardDirs@{KStandardDirs}!KStandardDirs@{KStandard\-Dirs}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KStandard\-Dirs::KStandard\-Dirs ()}\label{classKStandardDirs_a0}


KStandard\-Dirs' constructor. 

It just initializes the caches. 

Definition at line 108 of file kstandarddirs.cpp.

References add\-KDEDefaults(), and QDict::set\-Auto\-Delete().\index{KStandardDirs@{KStandard\-Dirs}!~KStandardDirs@{$\sim$KStandardDirs}}
\index{~KStandardDirs@{$\sim$KStandardDirs}!KStandardDirs@{KStandard\-Dirs}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KStandard\-Dirs::$\sim${\bf KStandard\-Dirs} ()\hspace{0.3cm}{\tt  [virtual]}}\label{classKStandardDirs_a1}


KStandard\-Dirs' destructor. 



Definition at line 118 of file kstandarddirs.cpp.

\subsection{Member Function Documentation}
\index{KStandardDirs@{KStandard\-Dirs}!addPrefix@{addPrefix}}
\index{addPrefix@{addPrefix}!KStandardDirs@{KStandard\-Dirs}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KStandard\-Dirs::add\-Prefix (const {\bf QString} \& {\em dir})}\label{classKStandardDirs_a2}


Adds another search dir to front of the {\tt fsstnd} list. 

\begin{itemize}
\item When compiling kdelibs, the prefix is added to this. \item KDEDIRS or KDEDIR is taking into account \item Additional dirs may be loaded from kdeglobals.\end{itemize}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em dir}]The directory to append relative paths to.\end{description}
\end{Desc}


Definition at line 180 of file kstandarddirs.cpp.

Referenced by add\-Customized(), and add\-KDEDefaults().\index{KStandardDirs@{KStandard\-Dirs}!addXdgConfigPrefix@{addXdgConfigPrefix}}
\index{addXdgConfigPrefix@{addXdgConfigPrefix}!KStandardDirs@{KStandard\-Dirs}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KStandard\-Dirs::add\-Xdg\-Config\-Prefix (const {\bf QString} \& {\em dir})}\label{classKStandardDirs_a3}


Adds another search dir to front of the XDG\_\-CONFIG\_\-XXX list of prefixes. 

This prefix is only used for resources that start with \char`\"{}xdgconf-\char`\"{}

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em dir}]The directory to append relative paths to.\end{description}
\end{Desc}


Definition at line 200 of file kstandarddirs.cpp.

Referenced by add\-Customized(), and add\-KDEDefaults().\index{KStandardDirs@{KStandard\-Dirs}!addXdgDataPrefix@{addXdgDataPrefix}}
\index{addXdgDataPrefix@{addXdgDataPrefix}!KStandardDirs@{KStandard\-Dirs}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KStandard\-Dirs::add\-Xdg\-Data\-Prefix (const {\bf QString} \& {\em dir})}\label{classKStandardDirs_a4}


Adds another search dir to front of the XDG\_\-DATA\_\-XXX list of prefixes. 

This prefix is only used for resources that start with \char`\"{}xdgdata-\char`\"{}

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em dir}]The directory to append relative paths to.\end{description}
\end{Desc}


Definition at line 220 of file kstandarddirs.cpp.

Referenced by add\-Customized(), and add\-KDEDefaults().\index{KStandardDirs@{KStandard\-Dirs}!addResourceType@{addResourceType}}
\index{addResourceType@{addResourceType}!KStandardDirs@{KStandard\-Dirs}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KStandard\-Dirs::add\-Resource\-Type (const char $\ast$ {\em type}, const {\bf QString} \& {\em relativename})}\label{classKStandardDirs_a5}


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 ( kde\_\-default) are added by {\bf add\-KDEDefaults()}{\rm (p.\,\pageref{classKStandardDirs_a14})}, but for those you can add more relative paths as well.

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 {\bf KGlobal::dirs()}{\rm (p.\,\pageref{classKGlobal_e1})}-$>$add\-Resource\-Type(\char`\"{}app\_\-pics\char`\"{}, \char`\"{}share/app/pics\char`\"{});

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em type}]Specifies a short descriptive string to access files of this type. \item[{\em relativename}]Specifies a directory relative to the root of the KFSSTND. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]true if successful, false otherwise.\end{Desc}


Definition at line 255 of file kstandarddirs.cpp.

Referenced by add\-KDEDefaults().\index{KStandardDirs@{KStandard\-Dirs}!addResourceDir@{addResourceDir}}
\index{addResourceDir@{addResourceDir}!KStandardDirs@{KStandard\-Dirs}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KStandard\-Dirs::add\-Resource\-Dir (const char $\ast$ {\em type}, const {\bf QString} \& {\em absdir})}\label{classKStandardDirs_a6}


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.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em type}]Specifies a short descriptive string to access files of this type. \item[{\em absdir}]Points to directory where to look for this specific type. Non-existant directories may be saved but pruned. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]true if successful, false otherwise.\end{Desc}


Definition at line 286 of file kstandarddirs.cpp.

Referenced by add\-Customized(), and add\-KDEDefaults().\index{KStandardDirs@{KStandard\-Dirs}!findResource@{findResource}}
\index{findResource@{findResource}!KStandardDirs@{KStandard\-Dirs}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KStandard\-Dirs::find\-Resource (const char $\ast$ {\em type}, const {\bf QString} \& {\em filename}) const}\label{classKStandardDirs_a7}


Tries to find a resource in the following order: \begin{itemize}
\item All PREFIX/$<$relativename$>$ paths (most recent first). \end{itemize}


\begin{itemize}
\item All absolute paths (most recent first).\end{itemize}
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 find\-Resource(\char`\"{}lib\char`\"{}, \char`\"{}libkdecore.la\char`\"{}). KStandard\-Dirs 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)

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em type}]The type of the wanted resource \item[{\em filename}]A relative filename of the resource.\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]A full path to the filename specified in the second argument, or QString::null if not found.\end{Desc}


Definition at line 317 of file kstandarddirs.cpp.

References endl(), find\-Resource\-Dir(), and QString::is\-Empty().

Referenced by KLib\-Loader::find\-Library().\index{KStandardDirs@{KStandard\-Dirs}!isRestrictedResource@{isRestrictedResource}}
\index{isRestrictedResource@{isRestrictedResource}!KStandardDirs@{KStandard\-Dirs}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KStandard\-Dirs::is\-Restricted\-Resource (const char $\ast$ {\em type}, const {\bf QString} \& {\em rel\-Path} = {\tt QString::null}) const}\label{classKStandardDirs_a8}


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.

E.g. by restricting the \char`\"{}wallpaper\char`\"{} resource, only system-wide installed wallpapers will be found by this class. Wallpapers installed under the \$KDEHOME directory will be ignored.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em type}]The type of the resource to check \item[{\em rel\-Path}]A relative path in the resource.\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]True if the resource is restricted. \end{Desc}
\begin{Desc}
\item[Since:]3.1\end{Desc}


Definition at line 123 of file kstandarddirs.cpp.\index{KStandardDirs@{KStandard\-Dirs}!calcResourceHash@{calcResourceHash}}
\index{calcResourceHash@{calcResourceHash}!KStandardDirs@{KStandard\-Dirs}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}Q\_\-UINT32 KStandard\-Dirs::calc\-Resource\-Hash (const char $\ast$ {\em type}, const {\bf QString} \& {\em filename}, bool {\em deep}) const}\label{classKStandardDirs_a9}


Returns a number that identifies this version of the resource. 

When a change is made to the resource this number will change.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em type}]The type of the wanted resource \item[{\em filename}]A relative filename of the resource. \item[{\em deep}]If true, all resources are taken into account otherwise only the one returned by {\bf find\-Resource()}{\rm (p.\,\pageref{classKStandardDirs_a7})}.\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]A number identifying the current version of the resource.\end{Desc}


Definition at line 352 of file kstandarddirs.cpp.

References resource\-Dirs().\index{KStandardDirs@{KStandard\-Dirs}!findDirs@{findDirs}}
\index{findDirs@{findDirs}!KStandardDirs@{KStandard\-Dirs}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString\-List} KStandard\-Dirs::find\-Dirs (const char $\ast$ {\em type}, const {\bf QString} \& {\em reldir}) const}\label{classKStandardDirs_a10}


Tries to find all directories whose names consist of the specified type and a relative path. 

So would find\-Dirs(\char`\"{}apps\char`\"{}, \char`\"{}Settings\char`\"{}) return \begin{itemize}
\item /opt/kde/share/applnk/Settings/ \item /home/joe/.kde/share/applnk/Settings/\end{itemize}
Note that it appends / to the end of the directories, so you can use this right away as directory names.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em type}]The type of the base directory. \item[{\em reldir}]Relative directory.\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]A list of matching directories, or an empty list if the resource specified is not found.\end{Desc}


Definition at line 378 of file kstandarddirs.cpp.

References QDir::abs\-Path(), QDir::exists(), resource\-Dirs(), and QDir::set\-Path().\index{KStandardDirs@{KStandard\-Dirs}!findResourceDir@{findResourceDir}}
\index{findResourceDir@{findResourceDir}!KStandardDirs@{KStandard\-Dirs}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KStandard\-Dirs::find\-Resource\-Dir (const char $\ast$ {\em type}, const {\bf QString} \& {\em filename}) const}\label{classKStandardDirs_a11}


Tries to find the directory the file is in. 

It works the same as {\bf find\-Resource()}{\rm (p.\,\pageref{classKStandardDirs_a7})}, but it doesn't return the filename but the name of the directory.

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.

find\-Resource\-Dir(\char`\"{}lib\char`\"{}, \char`\"{}libkdecore.la\char`\"{}) would return the path of the subdir libkdecore.la is found first in (e.g. /opt/kde/lib/)

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em type}]The type of the wanted resource \item[{\em filename}]A relative filename of the resource. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]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.\end{Desc}


Definition at line 412 of file kstandarddirs.cpp.

References endl(), exists(), and resource\-Dirs().

Referenced by find\-Resource().\index{KStandardDirs@{KStandard\-Dirs}!findAllResources@{findAllResources}}
\index{findAllResources@{findAllResources}!KStandardDirs@{KStandard\-Dirs}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString\-List} KStandard\-Dirs::find\-All\-Resources (const char $\ast$ {\em type}, const {\bf QString} \& {\em filter} = {\tt QString::null}, bool {\em recursive} = {\tt false}, bool {\em unique} = {\tt false}) const}\label{classKStandardDirs_a12}


Tries to find all resources with the specified type. 

The function will look into all specified directories and return all filenames in these directories.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em type}]The type of resource to locate directories for. \item[{\em filter}]Only accept filenames that fit to filter. The filter may consist of an optional directory and a {\bf QReg\-Exp} wildcard expression. E.g. \char`\"{}images$\backslash$$\ast$.jpg\char`\"{}. Use QString::null if you do not want a filter. \item[{\em recursive}]Specifies if the function should decend into subdirectories. \item[{\em unique}]If specified, only return items which have unique suffixes - suppressing duplicated filenames.\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]List of all the files whose filename matches the specified filter.\end{Desc}


Definition at line 675 of file kstandarddirs.cpp.

Referenced by KLocale::all\-Countries\-Two\-Alpha(), KPalette::get\-Palette\-List(), and KConfig\-INIBack\-End::parse\-Config\-Files().\index{KStandardDirs@{KStandard\-Dirs}!findAllResources@{findAllResources}}
\index{findAllResources@{findAllResources}!KStandardDirs@{KStandard\-Dirs}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString\-List} KStandard\-Dirs::find\-All\-Resources (const char $\ast$ {\em type}, const {\bf QString} \& {\em filter}, bool {\em recursive}, bool {\em unique}, {\bf QString\-List} \& {\em rel\-Paths}) const}\label{classKStandardDirs_a13}


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.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em type}]The type of resource to locate directories for. \item[{\em filter}]Only accept filenames that fit to filter. The filter may consist of an optional directory and a {\bf QReg\-Exp} wildcard expression. E.g. \char`\"{}images$\backslash$$\ast$.jpg\char`\"{}. Use QString::null if you do not want a filter. \item[{\em recursive}]Specifies if the function should decend into subdirectories. \item[{\em unique}]If specified, only return items which have unique suffixes. \item[{\em rel\-Paths}]The list to store the relative paths into These can be used later to ::locate() the file\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]List of all the files whose filename matches the specified filter.\end{Desc}


Definition at line 619 of file kstandarddirs.cpp.

References QString::is\-Empty(), QString::left(), QString::mid(), and resource\-Dirs().\index{KStandardDirs@{KStandard\-Dirs}!systemPaths@{systemPaths}}
\index{systemPaths@{systemPaths}!KStandardDirs@{KStandard\-Dirs}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString\-List} KStandard\-Dirs::system\-Paths (const {\bf QString} \& {\em pstr} = {\tt QString::null})\hspace{0.3cm}{\tt  [static]}}\label{classKStandardDirs_e0}


Returns a {\bf QString\-List} list of pathnames in the system path. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em pstr}]The path which will be searched. If this is null (default), the \$PATH environment variable will be searched.\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]a {\bf QString\-List} list of pathnames in the system path.\end{Desc}


Definition at line 869 of file kstandarddirs.cpp.

References QString::find(), QString::is\-Null(), QString::length(), QString::local8Bit(), QString::mid(), and QString::replace().

Referenced by find\-All\-Exe(), and find\-Exe().\index{KStandardDirs@{KStandard\-Dirs}!findExe@{findExe}}
\index{findExe@{findExe}!KStandardDirs@{KStandard\-Dirs}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KStandard\-Dirs::find\-Exe (const {\bf QString} \& {\em appname}, const {\bf QString} \& {\em pathstr} = {\tt QString::null}, bool {\em ignore\-Exec\-Bit} = {\tt false})\hspace{0.3cm}{\tt  [static]}}\label{classKStandardDirs_e1}


Finds the executable in the system path. 

A valid executable must be a file and have its executable bit set.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em appname}]The name of the executable file for which to search. \item[{\em pathstr}]The path which will be searched. If this is null (default), the \$PATH environment variable will be searched. \item[{\em ignore\-Exec\-Bit}]If true, an existing file will be returned even if its executable bit is not set.\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]The path of the executable. If it was not found, it will return QString::null. \end{Desc}
\begin{Desc}
\item[See also:]{\bf find\-All\-Exe()}{\rm (p.\,\pageref{classKStandardDirs_e2})}\end{Desc}


Definition at line 915 of file kstandarddirs.cpp.

References QFile\-Info::exists(), QFile\-Info::is\-Executable(), QFile\-Info::is\-File(), QFile\-Info::is\-Sym\-Link(), QFile\-Info::set\-File(), and system\-Paths().

Referenced by KConfig\-Back\-End::check\-Config\-Files\-Writable().\index{KStandardDirs@{KStandard\-Dirs}!findAllExe@{findAllExe}}
\index{findAllExe@{findAllExe}!KStandardDirs@{KStandard\-Dirs}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int KStandard\-Dirs::find\-All\-Exe ({\bf QString\-List} \& {\em list}, const {\bf QString} \& {\em appname}, const {\bf QString} \& {\em pathstr} = {\tt QString::null}, bool {\em ignore\-Exec\-Bit} = {\tt false})\hspace{0.3cm}{\tt  [static]}}\label{classKStandardDirs_e2}


Finds all occurrences of an executable in the system path. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em list}]Will be filled with the pathnames of all the executables found. Will be empty if the executable was not found. \item[{\em appname}]The name of the executable for which to search. \item[{\em pathstr}]The path list which will be searched. If this is 0 (default), the \$PATH environment variable will be searched. \item[{\em ignore\-Exec\-Bit}]If true, an existing file will be returned even if its executable bit is not set.\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]The number of executables found, 0 if none were found.\end{Desc}
\begin{Desc}
\item[See also:]{\bf find\-Exe()}{\rm (p.\,\pageref{classKStandardDirs_e1})}\end{Desc}


Definition at line 964 of file kstandarddirs.cpp.

References QFile\-Info::exists(), QFile\-Info::is\-Executable(), QFile\-Info::is\-File(), QFile\-Info::set\-File(), and system\-Paths().\index{KStandardDirs@{KStandard\-Dirs}!addKDEDefaults@{addKDEDefaults}}
\index{addKDEDefaults@{addKDEDefaults}!KStandardDirs@{KStandard\-Dirs}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KStandard\-Dirs::add\-KDEDefaults ()}\label{classKStandardDirs_a14}


This function adds the defaults that are used by the current {\bf KDE}{\rm (p.\,\pageref{namespaceKDE})} version. 

It's a series of add\-Resource\-Types() and {\bf add\-Prefix()}{\rm (p.\,\pageref{classKStandardDirs_a2})} calls. You normally wouldn't call this function because it's called for you from {\bf KGlobal}{\rm (p.\,\pageref{classKGlobal})}.

Definition at line 1268 of file kstandarddirs.cpp.

References add\-Prefix(), add\-Resource\-Dir(), add\-Resource\-Type(), add\-Xdg\-Config\-Prefix(), add\-Xdg\-Data\-Prefix(), QDir::home\-Dir\-Path(), QString::is\-Empty(), kde\_\-default(), QString::length(), and KShell::tilde\-Expand().

Referenced by KStandard\-Dirs().\index{KStandardDirs@{KStandard\-Dirs}!addCustomized@{addCustomized}}
\index{addCustomized@{addCustomized}!KStandardDirs@{KStandard\-Dirs}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KStandard\-Dirs::add\-Customized ({\bf KConfig} $\ast$ {\em config})}\label{classKStandardDirs_a15}


Reads customized entries out of the given config object and add them via add\-Resource\-Dirs(). 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em config}]The object the entries are read from. This should contain global config files \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]true if new config paths have been added from {\tt config}. \end{Desc}


Definition at line 1496 of file kstandarddirs.cpp.

References add\-Prefix(), add\-Resource\-Dir(), add\-Xdg\-Config\-Prefix(), add\-Xdg\-Data\-Prefix(), QString::append(), QString::arg(), QMap::begin(), QMap::end(), QString::ends\-With(), QString::find(), QString::from\-Latin1(), QString::insert(), QString::is\-Empty(), QString::latin1(), QString::left(), QString::length(), KUser$<$ T $>$::login\-Name(), QString::mid(), QDict::remove(), resource\-Dirs(), QString\-List::split(), and QString::starts\-With().

Referenced by KInstance::config().\index{KStandardDirs@{KStandard\-Dirs}!resourceDirs@{resourceDirs}}
\index{resourceDirs@{resourceDirs}!KStandardDirs@{KStandard\-Dirs}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString\-List} KStandard\-Dirs::resource\-Dirs (const char $\ast$ {\em type}) const}\label{classKStandardDirs_a16}


This function is used internally by almost all other function as it serves and fills the directories cache. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em type}]The type of resource \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]The list of possible directories for the specified {\tt type}. 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.\end{Desc}


Definition at line 782 of file kstandarddirs.cpp.

References endl(), QDir::exists(), QDict::find(), QDict::insert(), real\-Path(), and QDir::set\-Path().

Referenced by add\-Customized(), KIcon\-Loader::add\-Extra\-Desktop\-Themes(), calc\-Resource\-Hash(), find\-All\-Resources(), find\-Dirs(), find\-Resource\-Dir(), KIcon\-Theme::KIcon\-Theme(), KLocale::lang\-Lookup(), KIcon\-Theme::list(), relative\-Location(), and save\-Location().\index{KStandardDirs@{KStandard\-Dirs}!allTypes@{allTypes}}
\index{allTypes@{allTypes}!KStandardDirs@{KStandard\-Dirs}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString\-List} KStandard\-Dirs::all\-Types () const}\label{classKStandardDirs_a17}


This function will return a list of all the types that KStandard\-Dirs supports. 

\begin{Desc}
\item[Returns:]All types that {\bf KDE}{\rm (p.\,\pageref{namespaceKDE})} supports\end{Desc}


Definition at line 157 of file kstandarddirs.cpp.\index{KStandardDirs@{KStandard\-Dirs}!saveLocation@{saveLocation}}
\index{saveLocation@{saveLocation}!KStandardDirs@{KStandard\-Dirs}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KStandard\-Dirs::save\-Location (const char $\ast$ {\em type}, const {\bf QString} \& {\em suffix} = {\tt QString::null}, bool {\em create} = {\tt true}) const}\label{classKStandardDirs_a18}


Finds a location to save files into for the given type in the user's home directory. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em type}]The type of location to return. \item[{\em suffix}]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 ('/'). \item[{\em create}]If set, {\bf save\-Location()}{\rm (p.\,\pageref{classKStandardDirs_a18})} will create the directories needed (including those given by {\tt suffix}).\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]A path where resources of the specified type should be saved, or QString::null if the resource type is unknown.\end{Desc}


Definition at line 1072 of file kstandarddirs.cpp.

References endl(), QString::ends\-With(), QDict::find(), QDict::insert(), localkdedir(), localxdgconfdir(), localxdgdatadir(), make\-Dir(), real\-Path(), QDict::remove(), and resource\-Dirs().

Referenced by KConfig\-Back\-End::change\-File\-Name().\index{KStandardDirs@{KStandard\-Dirs}!relativeLocation@{relativeLocation}}
\index{relativeLocation@{relativeLocation}!KStandardDirs@{KStandard\-Dirs}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KStandard\-Dirs::relative\-Location (const char $\ast$ {\em type}, const {\bf QString} \& {\em abs\-Path})}\label{classKStandardDirs_a19}


Converts an absolute path to a path relative to a certain resource. 

If \char`\"{}abs = ::locate(resource, rel)\char`\"{} then \char`\"{}rel = relative\-Location(resource, abs)\char`\"{} and vice versa.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em type}]The type of resource.\item[{\em abs\-Path}]An absolute path to make relative.\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]A relative path relative to resource {\tt type} that will find {\tt abs\-Path}. If no such relative path exists, abs\-Path will be returned unchanged. \end{Desc}


Definition at line 1129 of file kstandarddirs.cpp.

References QString::find\-Rev(), QString::mid(), real\-Path(), resource\-Dirs(), and QString::starts\-With().

Referenced by KDesktop\-File::is\-Authorized\-Desktop\-File(), and KDesktop\-File::locate\-Local().\index{KStandardDirs@{KStandard\-Dirs}!makeDir@{makeDir}}
\index{makeDir@{makeDir}!KStandardDirs@{KStandard\-Dirs}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KStandard\-Dirs::make\-Dir (const {\bf QString} \& {\em dir}, int {\em mode} = {\tt 0755})\hspace{0.3cm}{\tt  [static]}}\label{classKStandardDirs_e3}


Recursively creates still-missing directories in the given path. 

The resulting permissions will depend on the current umask setting. permission = mode \& $\sim$umask.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em dir}]Absolute path of the directory to be made. \item[{\em mode}]Directory permissions. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]true if successful, false otherwise\end{Desc}


Definition at line 1151 of file kstandarddirs.cpp.

References QFile::encode\-Name(), QString::find(), QString::length(), QString::mid(), and QCString::prepend().

Referenced by KConfig\-INIBack\-End::parse\-Config\-Files(), save\-Location(), and KConfig\-INIBack\-End::sync().\index{KStandardDirs@{KStandard\-Dirs}!kde_default@{kde\_\-default}}
\index{kde_default@{kde\_\-default}!KStandardDirs@{KStandard\-Dirs}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KStandard\-Dirs::kde\_\-default (const char $\ast$ {\em type})\hspace{0.3cm}{\tt  [static]}}\label{classKStandardDirs_e4}


This returns a default relative path for the standard {\bf KDE}{\rm (p.\,\pageref{namespaceKDE})} resource types. 

Below is a list of them so you get an idea of what this is all about.

\begin{itemize}
\item data - share/apps \item html - share/doc/HTML \item icon - share/icon \item config - share/config \item pixmap - share/pixmaps \item apps - share/applnk \item sound - share/sounds \item locale - share/locale \item services - share/services \item servicetypes - share/servicetypes \item mime - share/mimelnk \item wallpaper - share/wallpapers \item templates - share/templates \item exe - bin \item lib - lib\end{itemize}
\begin{Desc}
\item[Returns:]Static default for the specified resource. You should probably be using {\bf locate()}{\rm (p.\,\pageref{group__locates_ga0})} or {\bf locate\-Local()}{\rm (p.\,\pageref{group__locates_ga1})} instead. \end{Desc}
\begin{Desc}
\item[See also:]{\bf locate()}{\rm (p.\,\pageref{group__locates_ga0})} 

{\bf locate\-Local()}{\rm (p.\,\pageref{group__locates_ga1})}\end{Desc}


Definition at line 1019 of file kstandarddirs.cpp.

Referenced by add\-KDEDefaults().\index{KStandardDirs@{KStandard\-Dirs}!localkdedir@{localkdedir}}
\index{localkdedir@{localkdedir}!KStandardDirs@{KStandard\-Dirs}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KStandard\-Dirs::localkdedir () const}\label{classKStandardDirs_a23}


Returns the toplevel directory in which KStandard\-Dirs will store things. 

Most likely \$HOME/.kde Don't use this function if you can use locate\-Local \begin{Desc}
\item[Returns:]the toplevel directory\end{Desc}


Definition at line 1628 of file kstandarddirs.cpp.

Referenced by save\-Location().\index{KStandardDirs@{KStandard\-Dirs}!localxdgdatadir@{localxdgdatadir}}
\index{localxdgdatadir@{localxdgdatadir}!KStandardDirs@{KStandard\-Dirs}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KStandard\-Dirs::localxdgdatadir () const}\label{classKStandardDirs_a24}


\begin{Desc}
\item[Returns:]\$XDG\_\-DATA\_\-HOME See also {\tt http://www.freedesktop.org/standards/basedir/draft/basedir-spec/basedir-spec.html}\end{Desc}


Definition at line 1634 of file kstandarddirs.cpp.

Referenced by save\-Location().\index{KStandardDirs@{KStandard\-Dirs}!localxdgconfdir@{localxdgconfdir}}
\index{localxdgconfdir@{localxdgconfdir}!KStandardDirs@{KStandard\-Dirs}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KStandard\-Dirs::localxdgconfdir () const}\label{classKStandardDirs_a25}


\begin{Desc}
\item[Returns:]\$XDG\_\-CONFIG\_\-HOME See also {\tt http://www.freedesktop.org/standards/basedir/draft/basedir-spec/basedir-spec.html}\end{Desc}


Definition at line 1640 of file kstandarddirs.cpp.

Referenced by save\-Location().\index{KStandardDirs@{KStandard\-Dirs}!exists@{exists}}
\index{exists@{exists}!KStandardDirs@{KStandard\-Dirs}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KStandard\-Dirs::exists (const {\bf QString} \& {\em full\-Path})\hspace{0.3cm}{\tt  [static]}}\label{classKStandardDirs_e7}


Checks for existence and accessability of a file or directory. 

Faster than creating a {\bf QFile\-Info} first. \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em full\-Path}]the path to check. IMPORTANT: must end with a slash if expected to be a directory (and no slash for a file, obviously). \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]true if the directory exists\end{Desc}


Definition at line 450 of file kstandarddirs.cpp.

Referenced by find\-Resource\-Dir(), and KIcon\-Theme::KIcon\-Theme().\index{KStandardDirs@{KStandard\-Dirs}!realPath@{realPath}}
\index{realPath@{realPath}!KStandardDirs@{KStandard\-Dirs}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KStandard\-Dirs::real\-Path (const {\bf QString} \& {\em dirname})\hspace{0.3cm}{\tt  [static]}}\label{classKStandardDirs_e8}


Expands all symbolic links and resolves references to '/./', '/../' and extra '/' characters in {\tt dirname} and returns the canonicalized absolute pathname. 

The resulting path will have no symbolic link, '/./' or '/../' components. \begin{Desc}
\item[Since:]3.1\end{Desc}


Definition at line 685 of file kstandarddirs.cpp.

References QFile::decode\-Name().

Referenced by KMount\-Point::current\-Mount\-Points(), KMount\-Point::possible\-Mount\-Points(), relative\-Location(), resource\-Dirs(), and save\-Location().\index{KStandardDirs@{KStandard\-Dirs}!realFilePath@{realFilePath}}
\index{realFilePath@{realFilePath}!KStandardDirs@{KStandard\-Dirs}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KStandard\-Dirs::real\-File\-Path (const {\bf QString} \& {\em filename})\hspace{0.3cm}{\tt  [static]}}\label{classKStandardDirs_e9}


Expands all symbolic links and resolves references to '/./', '/../' and extra '/' characters in {\tt filename} and returns the canonicalized absolute pathname. 

The resulting path will have no symbolic link, '/./' or '/../' components. \begin{Desc}
\item[Since:]3.4\end{Desc}


Definition at line 703 of file kstandarddirs.cpp.

References QFile::decode\-Name().

Referenced by KSave\-File::KSave\-File().

The documentation for this class was generated from the following files:\begin{CompactItemize}
\item 
kstandarddirs.h\item 
kstandarddirs.cpp\end{CompactItemize}
