\section{KDesktop\-File Class Reference}
\label{classKDesktopFile}\index{KDesktopFile@{KDesktopFile}}
{\bf KDE}{\rm (p.\,\pageref{namespaceKDE})} Desktop File Management. {\bf KDE}{\rm (p.\,\pageref{namespaceKDE})} Desktop File Management class.  


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

Inheritance diagram for KDesktop\-File:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=55pt]{classKDesktopFile__inherit__graph}
\end{center}
\end{figure}
Collaboration diagram for KDesktop\-File:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=211pt]{classKDesktopFile__coll__graph}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
{\bf KDesktop\-File} (const {\bf QString} \&file\-Name, bool read\-Only=false, const char $\ast$res\-Type=\char`\"{}apps\char`\"{})
\item 
virtual {\bf $\sim$KDesktop\-File} ()
\item 
{\bf QString} {\bf read\-Type} () const 
\item 
{\bf QString} {\bf read\-Icon} () const 
\item 
{\bf QString} {\bf read\-Name} () const 
\item 
{\bf QString} {\bf read\-Comment} () const 
\item 
{\bf QString} {\bf read\-Generic\-Name} () const 
\item 
{\bf QString} {\bf read\-Path} () const 
\item 
{\bf QString} {\bf read\-Device} () const 
\item 
{\bf QString} {\bf read\-URL} () const 
\item 
{\bf QString\-List} {\bf read\-Actions} () const 
\item 
void {\bf set\-Action\-Group} (const {\bf QString} \&group)
\item 
bool {\bf has\-Action\-Group} (const {\bf QString} \&group) const 
\item 
bool {\bf has\-Link\-Type} () const 
\item 
bool {\bf has\-Application\-Type} () const 
\item 
bool {\bf has\-Mime\-Type\-Type} () const 
\item 
bool {\bf has\-Device\-Type} () const 
\item 
bool {\bf try\-Exec} () const 
\item 
{\bf QString} {\bf file\-Name} () const 
\item 
{\bf QString} {\bf resource} () const 
\item 
{\bf QString} {\bf read\-Doc\-Path} () const 
\item 
{\bf QString\-List} {\bf sort\-Order} () const 
\item 
{\bf KDesktop\-File} $\ast$ {\bf copy\-To} (const {\bf QString} \&file) const 
\item 
KDE\_\-DEPRECATED {\bf QString} {\bf filename} () const 
\end{CompactItemize}
\subsection*{Static Public Member Functions}
\begin{CompactItemize}
\item 
static bool {\bf is\-Desktop\-File} (const {\bf QString} \&path)
\item 
static bool {\bf is\-Authorized\-Desktop\-File} (const {\bf QString} \&path)
\item 
static {\bf QString} {\bf locate\-Local} (const {\bf QString} \&path)
\end{CompactItemize}
\subsection*{Protected Member Functions}
\begin{CompactItemize}
\item 
virtual void {\bf virtual\_\-hook} (int id, void $\ast$data)\label{classKDesktopFile_b0}

\end{CompactItemize}


\subsection{Detailed Description}
{\bf KDE}{\rm (p.\,\pageref{namespaceKDE})} Desktop File Management. {\bf KDE}{\rm (p.\,\pageref{namespaceKDE})} Desktop File Management class. 

\begin{Desc}
\item[Author:]Pietro Iglio $<${\tt iglio@kde.org}$>$ \end{Desc}
\begin{Desc}
\item[See also:]{\bf KConfig\-Base}{\rm (p.\,\pageref{classKConfigBase})} {\bf KConfig}{\rm (p.\,\pageref{classKConfig})} \end{Desc}




Definition at line 34 of file kdesktopfile.h.

\subsection{Constructor \& Destructor Documentation}
\index{KDesktopFile@{KDesktop\-File}!KDesktopFile@{KDesktopFile}}
\index{KDesktopFile@{KDesktopFile}!KDesktopFile@{KDesktop\-File}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KDesktop\-File::KDesktop\-File (const {\bf QString} \& {\em file\-Name}, bool {\em read\-Only} = {\tt false}, const char $\ast$ {\em res\-Type} = {\tt \char`\"{}apps\char`\"{}})}\label{classKDesktopFile_a0}


Constructs a KDesktop\-File object and make it either read-write or read-only. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em file\-Name}]The name or path of the desktop file. If it is not absolute, it will be located using the resource type {\tt res\-Type}. \item[{\em read\-Only}]Whether the object should be read-only. \item[{\em res\-Type}]Allows you to change what sort of resource to search for if {\tt file\-Name} is not absolute. For instance, you might want to specify \char`\"{}config\char`\"{}. \end{description}
\end{Desc}


Definition at line 41 of file kdesktopfile.cpp.

References KConfig\-Back\-End::change\-File\-Name(), file\-Name(), KConfig::reparse\-Configuration(), KConfig\-Base::set\-Desktop\-Group(), and KConfig\-Base::set\-Read\-Only().

Referenced by copy\-To().\index{KDesktopFile@{KDesktop\-File}!~KDesktopFile@{$\sim$KDesktopFile}}
\index{~KDesktopFile@{$\sim$KDesktopFile}!KDesktopFile@{KDesktop\-File}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KDesktop\-File::$\sim${\bf KDesktop\-File} ()\hspace{0.3cm}{\tt  [virtual]}}\label{classKDesktopFile_a1}


Destructs the KDesktop\-File object. 

Writes back any dirty configuration entries. 

Definition at line 54 of file kdesktopfile.cpp.

\subsection{Member Function Documentation}
\index{KDesktopFile@{KDesktop\-File}!isDesktopFile@{isDesktopFile}}
\index{isDesktopFile@{isDesktopFile}!KDesktopFile@{KDesktop\-File}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KDesktop\-File::is\-Desktop\-File (const {\bf QString} \& {\em path})\hspace{0.3cm}{\tt  [static]}}\label{classKDesktopFile_e0}


Checks whether this is really a desktop file. 

The check is performed looking at the file extension (the file is not opened). Currently, valid extensions are \char`\"{}.kdelnk\char`\"{} and \char`\"{}.desktop\char`\"{}. \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em path}]the path of the file to check \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]true if the file appears to be a desktop file. \end{Desc}


Definition at line 111 of file kdesktopfile.cpp.

References QString::from\-Latin1(), and QString::length().\index{KDesktopFile@{KDesktop\-File}!isAuthorizedDesktopFile@{isAuthorizedDesktopFile}}
\index{isAuthorizedDesktopFile@{isAuthorizedDesktopFile}!KDesktopFile@{KDesktop\-File}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KDesktop\-File::is\-Authorized\-Desktop\-File (const {\bf QString} \& {\em path})\hspace{0.3cm}{\tt  [static]}}\label{classKDesktopFile_e1}


Checks whether the user is authorized to run this desktop file. 

By default users are authorized to run all desktop files but the KIOSK framework can be used to activate certain restrictions. See README.kiosk for more information. \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em path}]the file to check \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]true if the user is authorized to run the file \end{Desc}
\begin{Desc}
\item[Since:]3.1 \end{Desc}


Definition at line 123 of file kdesktopfile.cpp.

References KGlobal::dirs(), endl(), KStandard\-Dirs::relative\-Location(), and QString::starts\-With().\index{KDesktopFile@{KDesktop\-File}!locateLocal@{locateLocal}}
\index{locateLocal@{locateLocal}!KDesktopFile@{KDesktop\-File}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KDesktop\-File::locate\-Local (const {\bf QString} \& {\em path})\hspace{0.3cm}{\tt  [static]}}\label{classKDesktopFile_e2}


Returns the location where changes for the .desktop file {\tt path} should be written to. 

\begin{Desc}
\item[Since:]3.2 \end{Desc}


Definition at line 59 of file kdesktopfile.cpp.

References KGlobal::dirs(), QString::mid(), and KStandard\-Dirs::relative\-Location().\index{KDesktopFile@{KDesktop\-File}!readType@{readType}}
\index{readType@{readType}!KDesktopFile@{KDesktop\-File}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KDesktop\-File::read\-Type () const}\label{classKDesktopFile_a2}


Returns the value of the \char`\"{}Type=\char`\"{} entry. 

\begin{Desc}
\item[Returns:]the type or QString::null if not specified \end{Desc}


Definition at line 148 of file kdesktopfile.cpp.

References KConfig\-Base::read\-Entry().\index{KDesktopFile@{KDesktop\-File}!readIcon@{readIcon}}
\index{readIcon@{readIcon}!KDesktopFile@{KDesktop\-File}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KDesktop\-File::read\-Icon () const}\label{classKDesktopFile_a3}


Returns the value of the \char`\"{}Icon=\char`\"{} entry. 

\begin{Desc}
\item[Returns:]the icon or QString::null if not specified \end{Desc}


Definition at line 153 of file kdesktopfile.cpp.

References KConfig\-Base::read\-Entry().\index{KDesktopFile@{KDesktop\-File}!readName@{readName}}
\index{readName@{readName}!KDesktopFile@{KDesktop\-File}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KDesktop\-File::read\-Name () const}\label{classKDesktopFile_a4}


Returns the value of the \char`\"{}Name=\char`\"{} entry. 

\begin{Desc}
\item[Returns:]the name or QString::null if not specified \end{Desc}


Definition at line 158 of file kdesktopfile.cpp.

References KConfig\-Base::read\-Entry().\index{KDesktopFile@{KDesktop\-File}!readComment@{readComment}}
\index{readComment@{readComment}!KDesktopFile@{KDesktop\-File}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KDesktop\-File::read\-Comment () const}\label{classKDesktopFile_a5}


Returns the value of the \char`\"{}Comment=\char`\"{} entry. 

\begin{Desc}
\item[Returns:]the comment or QString::null if not specified \end{Desc}


Definition at line 163 of file kdesktopfile.cpp.

References KConfig\-Base::read\-Entry().\index{KDesktopFile@{KDesktop\-File}!readGenericName@{readGenericName}}
\index{readGenericName@{readGenericName}!KDesktopFile@{KDesktop\-File}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KDesktop\-File::read\-Generic\-Name () const}\label{classKDesktopFile_a6}


Returns the value of the \char`\"{}Generic\-Name=\char`\"{} entry. 

\begin{Desc}
\item[Returns:]the generic name or QString::null if not specified \end{Desc}


Definition at line 168 of file kdesktopfile.cpp.

References KConfig\-Base::read\-Entry().\index{KDesktopFile@{KDesktop\-File}!readPath@{readPath}}
\index{readPath@{readPath}!KDesktopFile@{KDesktop\-File}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KDesktop\-File::read\-Path () const}\label{classKDesktopFile_a7}


Returns the value of the \char`\"{}Path=\char`\"{} entry. 

\begin{Desc}
\item[Returns:]the path or QString::null if not specified \end{Desc}


Definition at line 173 of file kdesktopfile.cpp.

References KConfig\-Base::read\-Path\-Entry().\index{KDesktopFile@{KDesktop\-File}!readDevice@{readDevice}}
\index{readDevice@{readDevice}!KDesktopFile@{KDesktop\-File}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KDesktop\-File::read\-Device () const}\label{classKDesktopFile_a8}


Returns the value of the \char`\"{}Dev=\char`\"{} entry. 

\begin{Desc}
\item[Returns:]the device or QString::null if not specified \end{Desc}


Definition at line 178 of file kdesktopfile.cpp.

References KConfig\-Base::read\-Entry().

Referenced by read\-URL().\index{KDesktopFile@{KDesktop\-File}!readURL@{readURL}}
\index{readURL@{readURL}!KDesktopFile@{KDesktop\-File}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KDesktop\-File::read\-URL () const}\label{classKDesktopFile_a9}


Returns the value of the \char`\"{}URL=\char`\"{} entry. 

\begin{Desc}
\item[Returns:]the URL or QString::null if not specified \end{Desc}


Definition at line 183 of file kdesktopfile.cpp.

References QValue\-List::begin(), QValue\-List::end(), has\-Device\-Type(), QString::is\-Empty(), QDir::is\-Relative\-Path(), KMount\-Point::mounted\-From(), KMount\-Point::mount\-Point(), KMount\-Point::possible\-Mount\-Points(), read\-Device(), KConfig\-Base::read\-Path\-Entry(), KURL::set\-Path(), and KURL::url().\index{KDesktopFile@{KDesktop\-File}!readActions@{readActions}}
\index{readActions@{readActions}!KDesktopFile@{KDesktop\-File}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString\-List} KDesktop\-File::read\-Actions () const}\label{classKDesktopFile_a10}


Returns a list of the \char`\"{}Actions=\char`\"{} entries. 

\begin{Desc}
\item[Returns:]the list of actions \end{Desc}


Definition at line 214 of file kdesktopfile.cpp.

References KConfig\-Base::read\-List\-Entry().\index{KDesktopFile@{KDesktop\-File}!setActionGroup@{setActionGroup}}
\index{setActionGroup@{setActionGroup}!KDesktopFile@{KDesktop\-File}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KDesktop\-File::set\-Action\-Group (const {\bf QString} \& {\em group})}\label{classKDesktopFile_a11}


Sets the desktop action group. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em group}]the new action group \end{description}
\end{Desc}


Definition at line 219 of file kdesktopfile.cpp.

References KConfig\-Base::set\-Group().\index{KDesktopFile@{KDesktop\-File}!hasActionGroup@{hasActionGroup}}
\index{hasActionGroup@{hasActionGroup}!KDesktopFile@{KDesktop\-File}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KDesktop\-File::has\-Action\-Group (const {\bf QString} \& {\em group}) const}\label{classKDesktopFile_a12}


Returns true if the action group exists, false otherwise. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em group}]the action group to test \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]true if the action group exists \end{Desc}


Definition at line 224 of file kdesktopfile.cpp.

References KConfig\-Base::has\-Group().\index{KDesktopFile@{KDesktop\-File}!hasLinkType@{hasLinkType}}
\index{hasLinkType@{hasLinkType}!KDesktopFile@{KDesktop\-File}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KDesktop\-File::has\-Link\-Type () const}\label{classKDesktopFile_a13}


Checks whether there is a \char`\"{}Type=Link\char`\"{} entry. 

The link points to the \char`\"{}URL=\char`\"{} entry. \begin{Desc}
\item[Returns:]true if there is a \char`\"{}Type=Link\char`\"{} entry \end{Desc}


Definition at line 229 of file kdesktopfile.cpp.

References QString::from\-Latin1(), and KConfig\-Base::read\-Entry().\index{KDesktopFile@{KDesktop\-File}!hasApplicationType@{hasApplicationType}}
\index{hasApplicationType@{hasApplicationType}!KDesktopFile@{KDesktop\-File}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KDesktop\-File::has\-Application\-Type () const}\label{classKDesktopFile_a14}


Checks whether there is an entry \char`\"{}Type=Application\char`\"{}. 

\begin{Desc}
\item[Returns:]true if there is a \char`\"{}Type=Application\char`\"{} entry \end{Desc}


Definition at line 234 of file kdesktopfile.cpp.

References QString::from\-Latin1(), and KConfig\-Base::read\-Entry().\index{KDesktopFile@{KDesktop\-File}!hasMimeTypeType@{hasMimeTypeType}}
\index{hasMimeTypeType@{hasMimeTypeType}!KDesktopFile@{KDesktop\-File}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KDesktop\-File::has\-Mime\-Type\-Type () const}\label{classKDesktopFile_a15}


Checks whether there is an entry \char`\"{}Type=Mime\-Type\char`\"{}. 

\begin{Desc}
\item[Returns:]true if there is a \char`\"{}Type=Mime\-Type\char`\"{} entry \end{Desc}


Definition at line 239 of file kdesktopfile.cpp.

References QString::from\-Latin1(), and KConfig\-Base::read\-Entry().\index{KDesktopFile@{KDesktop\-File}!hasDeviceType@{hasDeviceType}}
\index{hasDeviceType@{hasDeviceType}!KDesktopFile@{KDesktop\-File}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KDesktop\-File::has\-Device\-Type () const}\label{classKDesktopFile_a16}


Checks whether there is an entry \char`\"{}Type=FSDev\char`\"{}. 

\begin{Desc}
\item[Returns:]true if there is a \char`\"{}Type=FSDev\char`\"{} entry \end{Desc}


Definition at line 244 of file kdesktopfile.cpp.

References QString::from\-Latin1(), and KConfig\-Base::read\-Entry().

Referenced by read\-URL().\index{KDesktopFile@{KDesktop\-File}!tryExec@{tryExec}}
\index{tryExec@{tryExec}!KDesktopFile@{KDesktop\-File}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KDesktop\-File::try\-Exec () const}\label{classKDesktopFile_a17}


Checks whether the Try\-Exec field contains a binary which is found on the local system. 

\begin{Desc}
\item[Returns:]true if Try\-Exec contains an existing binary \end{Desc}


Definition at line 250 of file kdesktopfile.cpp.

References QString::is\-Empty(), KConfig\-Base::read\-Bool\-Entry(), KConfig\-Base::read\-Entry(), KConfig\-Base::read\-List\-Entry(), KConfig\-Base::read\-Path\-Entry(), and QString\-List::split().\index{KDesktopFile@{KDesktop\-File}!fileName@{fileName}}
\index{fileName@{fileName}!KDesktopFile@{KDesktop\-File}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KDesktop\-File::file\-Name () const}\label{classKDesktopFile_a18}


Returns the file name. 

\begin{Desc}
\item[Returns:]The filename as passed to the constructor. \end{Desc}


Definition at line 311 of file kdesktopfile.cpp.

References KConfig\-Back\-End::file\-Name().

Referenced by KDesktop\-File().\index{KDesktopFile@{KDesktop\-File}!resource@{resource}}
\index{resource@{resource}!KDesktopFile@{KDesktop\-File}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KDesktop\-File::resource () const}\label{classKDesktopFile_a19}


Returns the resource. 

\begin{Desc}
\item[Returns:]The resource type as passed to the constructor. \end{Desc}


Definition at line 317 of file kdesktopfile.cpp.

References KConfig\-Back\-End::resource().\index{KDesktopFile@{KDesktop\-File}!readDocPath@{readDocPath}}
\index{readDocPath@{readDocPath}!KDesktopFile@{KDesktop\-File}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KDesktop\-File::read\-Doc\-Path () const}\label{classKDesktopFile_a20}


Returns the value of the \char`\"{}X-Doc\-Path=\char`\"{} Or \char`\"{}Doc\-Path=\char`\"{} entry. 

X-Doc\-Path should be used and Doc\-Path is depreciated and will one day be not supported. \begin{Desc}
\item[Returns:]The value of the \char`\"{}X-Doc\-Path=\char`\"{} Or \char`\"{}Doc\-Path=\char`\"{} entry. \end{Desc}
\begin{Desc}
\item[Since:]3.1 \end{Desc}


Definition at line 328 of file kdesktopfile.cpp.

References KConfig\-Base::has\-Key(), and KConfig\-Base::read\-Path\-Entry().\index{KDesktopFile@{KDesktop\-File}!sortOrder@{sortOrder}}
\index{sortOrder@{sortOrder}!KDesktopFile@{KDesktop\-File}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString\-List} KDesktop\-File::sort\-Order () const}\label{classKDesktopFile_a21}


Returns the entry of the \char`\"{}Sort\-Order=\char`\"{} entry. 

\begin{Desc}
\item[Returns:]the value of the \char`\"{}Sort\-Order=\char`\"{} entry. \end{Desc}


Definition at line 320 of file kdesktopfile.cpp.

References KConfig\-Base::read\-List\-Entry().\index{KDesktopFile@{KDesktop\-File}!copyTo@{copyTo}}
\index{copyTo@{copyTo}!KDesktopFile@{KDesktop\-File}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf KDesktop\-File} $\ast$ KDesktop\-File::copy\-To (const {\bf QString} \& {\em file}) const}\label{classKDesktopFile_a22}


Copies all entries from this config object to a new KDesktop\-File object that will save itself to {\tt file}. 

Actual saving to {\tt file} happens when the returned object is destructed or when {\bf sync()}{\rm (p.\,\pageref{classKConfigBase_a105})} is called upon it.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em file}]the new KDesktop\-File object it will save itself to. \end{description}
\end{Desc}
\begin{Desc}
\item[Since:]3.2 \end{Desc}


Definition at line 338 of file kdesktopfile.cpp.

References KConfig::copy\-To(), KDesktop\-File(), and KConfig\-Base::set\-Desktop\-Group().\index{KDesktopFile@{KDesktop\-File}!filename@{filename}}
\index{filename@{filename}!KDesktopFile@{KDesktop\-File}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KDE\_\-DEPRECATED {\bf QString} KDesktop\-File::filename () const\hspace{0.3cm}{\tt  [inline]}}\label{classKDesktopFile_a23}


\begin{Desc}
\item[{\bf Deprecated}]Use\end{Desc}
\begin{Desc}
\item[See also:]{\bf file\-Name()}{\rm (p.\,\pageref{classKDesktopFile_a18})} instead. \end{Desc}


Definition at line 235 of file kdesktopfile.h.

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