\section{KFile\-Item Class Reference}
\label{classKFileItem}\index{KFileItem@{KFileItem}}
A KFile\-Item is a generic class to handle a file, local or remote.  


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

Collaboration diagram for KFile\-Item:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=215pt]{classKFileItem__coll__graph}
\end{center}
\end{figure}
\subsection*{Public Types}
\begin{CompactItemize}
\item 
enum \{ {\bf Unknown} =  (mode\_\-t) - 1
 \}
\end{CompactItemize}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
{\bf KFile\-Item} (const  {\bf KIO::UDSEntry} \&\_\-entry, const  {\bf KURL} \&\_\-url, bool \_\-determine\-Mime\-Type\-On\-Demand=false, bool \_\-url\-Is\-Directory=false)
\begin{CompactList}\small\item\em Creates an item representing a file, from a UDSEntry. \item\end{CompactList}\item 
{\bf KFile\-Item} (mode\_\-t \_\-mode, mode\_\-t \_\-permissions, const  {\bf KURL} \&\_\-url, bool \_\-determine\-Mime\-Type\-On\-Demand=false)
\begin{CompactList}\small\item\em Creates an item representing a file, from all the necessary info for it. \item\end{CompactList}\item 
{\bf KFile\-Item} (const  {\bf KURL} \&url, const  {\bf QString} \&mime\-Type, mode\_\-t mode)
\begin{CompactList}\small\item\em Creates an item representing a file, for which the mimetype is already known. \item\end{CompactList}\item 
{\bf KFile\-Item} (const  {\bf KFile\-Item} \&item)
\begin{CompactList}\small\item\em Copy constructor. \item\end{CompactList}\item 
virtual {\bf $\sim$KFile\-Item} ()
\begin{CompactList}\small\item\em Destructs the KFile\-Item. \item\end{CompactList}\item 
void {\bf refresh} ()
\begin{CompactList}\small\item\em Re-reads information (currently only permissions and mimetype). \item\end{CompactList}\item 
void {\bf refresh\-Mime\-Type} ()
\begin{CompactList}\small\item\em Re-reads mimetype information. \item\end{CompactList}\item 
const  {\bf KURL} \& {\bf url} () const 
\begin{CompactList}\small\item\em Returns the url of the file. \item\end{CompactList}\item 
void {\bf set\-URL} (const  {\bf KURL} \&url)
\begin{CompactList}\small\item\em Sets the item's URL. \item\end{CompactList}\item 
mode\_\-t {\bf permissions} () const 
\begin{CompactList}\small\item\em Returns the permissions of the file (stat.st\_\-mode containing only permissions). \item\end{CompactList}\item 
{\bf QString} {\bf permissions\-String} () const 
\begin{CompactList}\small\item\em Returns the access permissions for the file as a string. \item\end{CompactList}\item 
mode\_\-t {\bf mode} () const 
\begin{CompactList}\small\item\em Returns the file type (stat.st\_\-mode containing only S\_\-IFDIR, S\_\-IFLNK, ...). \item\end{CompactList}\item 
{\bf QString} {\bf user} () const 
\begin{CompactList}\small\item\em Returns the owner of the file. \item\end{CompactList}\item 
{\bf QString} {\bf group} () const 
\begin{CompactList}\small\item\em Returns the group of the file. \item\end{CompactList}\item 
bool {\bf is\-Link} () const 
\begin{CompactList}\small\item\em Returns true if this item represents a link in the UNIX sense of a link. \item\end{CompactList}\item 
bool {\bf is\-Dir} () const 
\begin{CompactList}\small\item\em Returns true if this item represents a directory. \item\end{CompactList}\item 
bool {\bf is\-File} () const 
\begin{CompactList}\small\item\em Returns true if this item represents a file (and not a a directory). \item\end{CompactList}\item 
bool {\bf is\-Readable} () const 
\item 
{\bf QString} {\bf link\-Dest} () const 
\begin{CompactList}\small\item\em Returns the link destination if {\bf is\-Link()}{\rm (p.\,\pageref{classKFileItem_a14})} == true. \item\end{CompactList}\item 
KIO::filesize\_\-t {\bf size} () const 
\begin{CompactList}\small\item\em Returns the size of the file, if known. \item\end{CompactList}\item 
time\_\-t {\bf time} (unsigned int which) const 
\item 
{\bf QString} {\bf time\-String} (unsigned int which=KIO::UDS\_\-MODIFICATION\_\-TIME) const 
\item 
bool {\bf is\-Local\-File} () const 
\begin{CompactList}\small\item\em Returns true if the file is a local file. \item\end{CompactList}\item 
const  {\bf QString} \& {\bf text} () const 
\begin{CompactList}\small\item\em Returns the text of the file item. \item\end{CompactList}\item 
const  {\bf QString} \& {\bf name} (bool lower\-Case=false) const 
\item 
{\bf QString} {\bf mimetype} () const 
\begin{CompactList}\small\item\em Returns the mimetype of the file item. \item\end{CompactList}\item 
{\bf KMime\-Type::Ptr} {\bf determine\-Mime\-Type} ()
\begin{CompactList}\small\item\em Returns the mimetype of the file item. \item\end{CompactList}\item 
{\bf KMime\-Type::Ptr} {\bf mime\-Type\-Ptr} () const 
\begin{CompactList}\small\item\em Returns the currently known mimetype of the file item. \item\end{CompactList}\item 
bool {\bf is\-Mime\-Type\-Known} () const \label{classKFileItem_a28}

\item 
{\bf QString} {\bf mime\-Comment} ()
\begin{CompactList}\small\item\em Returns the descriptive comment for this mime type, or the mime type itself if none is present. \item\end{CompactList}\item 
{\bf QString} {\bf icon\-Name} ()
\begin{CompactList}\small\item\em Returns the full path name to the icon that represents this mime type. \item\end{CompactList}\item 
{\bf QPixmap} {\bf pixmap} (int \_\-size, int \_\-state=0) const 
\begin{CompactList}\small\item\em Returns a pixmap representing the file. \item\end{CompactList}\item 
int {\bf overlays} () const 
\begin{CompactList}\small\item\em Returns the overlays (bitfield of {\bf KIcon}::$\ast$Overlay flags) that are used for this item's pixmap. \item\end{CompactList}\item 
{\bf QString} {\bf get\-Status\-Bar\-Info} ()
\begin{CompactList}\small\item\em Returns the string to be displayed in the statusbar, e.g. \item\end{CompactList}\item 
{\bf QString} {\bf get\-Tool\-Tip\-Text} (int maxcount=6)
\item 
bool {\bf accepts\-Drops} ()
\begin{CompactList}\small\item\em Returns true if files can be dropped over this item. \item\end{CompactList}\item 
void {\bf run} ()
\begin{CompactList}\small\item\em Let's \char`\"{}KRun\char`\"{} this file ! (e.g. \item\end{CompactList}\item 
const  {\bf KIO::UDSEntry} \& {\bf entry} () const 
\begin{CompactList}\small\item\em Returns the UDS entry. \item\end{CompactList}\item 
bool {\bf is\-Marked} () const \label{classKFileItem_a38}

\item 
void {\bf mark} ()\label{classKFileItem_a39}

\item 
void {\bf unmark} ()\label{classKFileItem_a40}

\item 
bool {\bf cmp} (const  {\bf KFile\-Item} \&item)
\begin{CompactList}\small\item\em Somewhat like a comparison operator, but more explicit. \item\end{CompactList}\item 
virtual void {\bf set\-Extra\-Data} (const  void $\ast$key, void $\ast$value)
\begin{CompactList}\small\item\em This allows to associate some \char`\"{}extra\char`\"{} data to a KFile\-Item. \item\end{CompactList}\item 
virtual const  void $\ast$ {\bf extra\-Data} (const  void $\ast$key) const 
\item 
virtual void $\ast$ {\bf extra\-Data} (const  void $\ast$key)
\begin{CompactList}\small\item\em The non-const version of the previous {\tt {\bf extra\-Data()}{\rm (p.\,\pageref{classKFileItem_a43})}} method. \item\end{CompactList}\item 
virtual void {\bf remove\-Extra\-Data} (const  void $\ast$key)
\begin{CompactList}\small\item\em Removes the extra data associated with an item via {\tt key}. \item\end{CompactList}\item 
void {\bf set\-Meta\-Info} (const  {\bf KFile\-Meta\-Info} \&info)
\begin{CompactList}\small\item\em Sets the metainfo of this item to {\tt info}. \item\end{CompactList}\item 
const  {\bf KFile\-Meta\-Info} \& {\bf meta\-Info} (bool autoget=true, int what=KFile\-Meta\-Info::Fastest) const 
\begin{CompactList}\small\item\em Returns the metainfo of this item. \item\end{CompactList}\item 
void {\bf assign} (const  {\bf KFile\-Item} \&item)
\begin{CompactList}\small\item\em Somewhat like an assignment operator, but more explicit. \item\end{CompactList}\end{CompactItemize}
\subsection*{Protected Member Functions}
\begin{CompactItemize}
\item 
void {\bf init} (bool \_\-determine\-Mime\-Type\-On\-Demand)
\begin{CompactList}\small\item\em Computes the text, mode, and mimetype from the UDSEntry Called by constructor, but can be called again later. \item\end{CompactList}\item 
{\bf QString} {\bf parse\-Permissions} (mode\_\-t perm) const 
\begin{CompactList}\small\item\em Parses the given permission set and provides it for access(). \item\end{CompactList}\item 
virtual void {\bf virtual\_\-hook} (int id, void $\ast$data)\label{classKFileItem_b2}

\end{CompactItemize}


\subsection{Detailed Description}
A KFile\-Item is a generic class to handle a file, local or remote. 

In particular, it makes it easier to handle the result of {\bf KIO::list\-Dir}{\rm (p.\,\pageref{namespaceKIO_a213})}. (UDSEntry isn't very friendly to use) It includes many file attributes such as mimetype, icon, text, mode, link... 



Definition at line 40 of file kfileitem.h.

\subsection{Constructor \& Destructor Documentation}
\index{KFileItem@{KFile\-Item}!KFileItem@{KFileItem}}
\index{KFileItem@{KFileItem}!KFileItem@{KFile\-Item}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KFile\-Item::KFile\-Item (const {\bf KIO::UDSEntry} \& {\em \_\-entry}, const {\bf KURL} \& {\em \_\-url}, bool {\em \_\-determine\-Mime\-Type\-On\-Demand} = false, bool {\em \_\-url\-Is\-Directory} = false)}\label{classKFileItem_a0}


Creates an item representing a file, from a UDSEntry. 

This is the preferred constructor when using {\bf KIO::list\-Dir()}{\rm (p.\,\pageref{namespaceKIO_a213})}.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em \_\-entry}]the {\bf KIO}{\rm (p.\,\pageref{namespaceKIO})} entry used to get the file, contains info about it \item[{\em \_\-url}]the file url \item[{\em \_\-determine\-Mime\-Type\-On\-Demand}]specifies if the mimetype of the given URL should be determined immediately or on demand \item[{\em \_\-url\-Is\-Directory}]specifies if the url is just the directory of the fileitem and the filename from the UDSEntry should be used. \end{description}
\end{Desc}


Definition at line 47 of file kfileitem.cpp.

References KURL::add\-Path(), QValue\-List::begin(), KIO::decode\-File\-Name(), QValue\-List::end(), init(), QString::is\-Empty(), KMime\-Type::mime\-Type(), KGlobal::static\-QString(), and KIO::UDSEntry.\index{KFileItem@{KFile\-Item}!KFileItem@{KFileItem}}
\index{KFileItem@{KFileItem}!KFileItem@{KFile\-Item}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KFile\-Item::KFile\-Item (mode\_\-t {\em \_\-mode}, mode\_\-t {\em \_\-permissions}, const {\bf KURL} \& {\em \_\-url}, bool {\em \_\-determine\-Mime\-Type\-On\-Demand} = false)}\label{classKFileItem_a1}


Creates an item representing a file, from all the necessary info for it. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em \_\-mode}]the file mode (according to stat() (e.g. S\_\-IFDIR...) Set to KFile\-Item::Unknown if unknown. For local files, KFile\-Item will use stat(). \item[{\em \_\-permissions}]the access permissions If you set both the mode and the permissions, you save a ::stat() for local files. Set to KFile\-Item::Unknown if you don't know the mode or the permission. \item[{\em \_\-url}]the file url\item[{\em \_\-determine\-Mime\-Type\-On\-Demand}]specify if the mimetype of the given URL should be determined immediately or on demand \end{description}
\end{Desc}


Definition at line 113 of file kfileitem.cpp.

References KIO::decode\-File\-Name(), and init().\index{KFileItem@{KFile\-Item}!KFileItem@{KFileItem}}
\index{KFileItem@{KFileItem}!KFileItem@{KFile\-Item}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KFile\-Item::KFile\-Item (const {\bf KURL} \& {\em url}, const {\bf QString} \& {\em mime\-Type}, mode\_\-t {\em mode})}\label{classKFileItem_a2}


Creates an item representing a file, for which the mimetype is already known. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em url}]the file url \item[{\em mime\-Type}]the name of the file's mimetype \item[{\em mode}]the mode (S\_\-IFDIR...) \end{description}
\end{Desc}


Definition at line 130 of file kfileitem.cpp.

References KIO::decode\-File\-Name(), init(), and KMime\-Type::mime\-Type().\index{KFileItem@{KFile\-Item}!KFileItem@{KFileItem}}
\index{KFileItem@{KFileItem}!KFileItem@{KFile\-Item}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KFile\-Item::KFile\-Item (const {\bf KFile\-Item} \& {\em item})}\label{classKFileItem_a3}


Copy constructor. 

Note that extra-data set via {\bf set\-Extra\-Data}{\rm (p.\,\pageref{classKFileItem_a42})}() is not deeply copied -- just the pointers are copied. 

Definition at line 149 of file kfileitem.cpp.

References assign().\index{KFileItem@{KFile\-Item}!~KFileItem@{$\sim$KFileItem}}
\index{~KFileItem@{$\sim$KFileItem}!KFileItem@{KFile\-Item}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KFile\-Item::$\sim${\bf KFile\-Item} ()\hspace{0.3cm}{\tt  [virtual]}}\label{classKFileItem_a4}


Destructs the KFile\-Item. 

Extra data set via {\bf set\-Extra\-Data()}{\rm (p.\,\pageref{classKFileItem_a42})} is not deleted. 

Definition at line 155 of file kfileitem.cpp.

\subsection{Member Function Documentation}
\index{KFileItem@{KFile\-Item}!refresh@{refresh}}
\index{refresh@{refresh}!KFileItem@{KFile\-Item}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KFile\-Item::refresh ()}\label{classKFileItem_a5}


Re-reads information (currently only permissions and mimetype). 

This is called when the \_\-file\_\- changes. 

Definition at line 217 of file kfileitem.cpp.

References init(), and KIO::UDSEntry.

Referenced by KDir\-Lister\-Cache::Files\-Changed().\index{KFileItem@{KFile\-Item}!refreshMimeType@{refreshMimeType}}
\index{refreshMimeType@{refreshMimeType}!KFileItem@{KFile\-Item}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KFile\-Item::refresh\-Mime\-Type ()}\label{classKFileItem_a6}


Re-reads mimetype information. 

This is called when the mimetype database changes. 

Definition at line 237 of file kfileitem.cpp.

References init().

Referenced by KDir\-Lister\-Cache::File\-Renamed().\index{KFileItem@{KFile\-Item}!url@{url}}
\index{url@{url}!KFileItem@{KFile\-Item}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}const {\bf KURL}\& KFile\-Item::url () const\hspace{0.3cm}{\tt  [inline]}}\label{classKFileItem_a7}


Returns the url of the file. 



Definition at line 111 of file kfileitem.h.

Referenced by KDir\-Lister\-Cache::Files\-Removed(), KDir\-Operator::insert\-New\-Files(), KProps\-Dlg\-Plugin::is\-Desktop\-File(), KFile\-Props\-Plugin::KFile\-Props\-Plugin(), KProperties\-Dialog::KProperties\-Dialog(), run(), KDir\-Operator::select\-Dir(), and KFile\-Tree\-View\-Item::url().\index{KFileItem@{KFile\-Item}!setURL@{setURL}}
\index{setURL@{setURL}!KFileItem@{KFile\-Item}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KFile\-Item::set\-URL (const {\bf KURL} \& {\em url})}\label{classKFileItem_a8}


Sets the item's URL. 

Do not call unless you know what you are doing! (used for example when an item got renamed). 

Definition at line 243 of file kfileitem.cpp.

References KIO::decode\-File\-Name().

Referenced by KDir\-Lister\-Cache::File\-Renamed().\index{KFileItem@{KFile\-Item}!permissions@{permissions}}
\index{permissions@{permissions}!KFileItem@{KFile\-Item}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}mode\_\-t KFile\-Item::permissions () const\hspace{0.3cm}{\tt  [inline]}}\label{classKFileItem_a9}


Returns the permissions of the file (stat.st\_\-mode containing only permissions). 



Definition at line 122 of file kfileitem.h.

Referenced by KFile\-Permissions\-Props\-Plugin::KFile\-Permissions\-Props\-Plugin().\index{KFileItem@{KFile\-Item}!permissionsString@{permissionsString}}
\index{permissionsString@{permissionsString}!KFileItem@{KFile\-Item}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KFile\-Item::permissions\-String () const}\label{classKFileItem_a10}


Returns the access permissions for the file as a string. 



Definition at line 720 of file kfileitem.cpp.

References QString::is\-Null(), and parse\-Permissions().

Referenced by KFile\-List\-View\-Item::init().\index{KFileItem@{KFile\-Item}!mode@{mode}}
\index{mode@{mode}!KFileItem@{KFile\-Item}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}mode\_\-t KFile\-Item::mode () const\hspace{0.3cm}{\tt  [inline]}}\label{classKFileItem_a11}


Returns the file type (stat.st\_\-mode containing only S\_\-IFDIR, S\_\-IFLNK, ...). 



Definition at line 132 of file kfileitem.h.

Referenced by accepts\-Drops(), init(), KProps\-Dlg\-Plugin::is\-Desktop\-File(), and KFile\-Props\-Plugin::KFile\-Props\-Plugin().\index{KFileItem@{KFile\-Item}!user@{user}}
\index{user@{user}!KFileItem@{KFile\-Item}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KFile\-Item::user () const}\label{classKFileItem_a12}


Returns the owner of the file. 



Definition at line 337 of file kfileitem.cpp.

References QFile::encode\-Name(), QString::from\-Local8Bit(), QString::is\-Empty(), KURL::path(), and user().

Referenced by get\-Tool\-Tip\-Text(), KFile\-List\-View\-Item::init(), KFile\-Permissions\-Props\-Plugin::KFile\-Permissions\-Props\-Plugin(), and user().\index{KFileItem@{KFile\-Item}!group@{group}}
\index{group@{group}!KFileItem@{KFile\-Item}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KFile\-Item::group () const}\label{classKFileItem_a13}


Returns the group of the file. 



Definition at line 352 of file kfileitem.cpp.

References QFile::encode\-Name(), QString::from\-Local8Bit(), group(), QString::is\-Empty(), KURL::path(), and QString::sprintf().

Referenced by get\-Tool\-Tip\-Text(), group(), KFile\-List\-View\-Item::init(), and KFile\-Permissions\-Props\-Plugin::KFile\-Permissions\-Props\-Plugin().\index{KFileItem@{KFile\-Item}!isLink@{isLink}}
\index{isLink@{isLink}!KFileItem@{KFile\-Item}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KFile\-Item::is\-Link () const\hspace{0.3cm}{\tt  [inline]}}\label{classKFileItem_a14}


Returns true if this item represents a link in the UNIX sense of a link. 



Definition at line 148 of file kfileitem.h.

Referenced by KFile\-Permissions\-Props\-Plugin::KFile\-Permissions\-Props\-Plugin(), KFile\-Props\-Plugin::KFile\-Props\-Plugin(), and parse\-Permissions().\index{KFileItem@{KFile\-Item}!isDir@{isDir}}
\index{isDir@{isDir}!KFileItem@{KFile\-Item}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KFile\-Item::is\-Dir () const}\label{classKFileItem_a15}


Returns true if this item represents a directory. 



Definition at line 497 of file kfileitem.cpp.

References QString::is\-Empty().

Referenced by KFile\-View\-Signaler::activate(), KDir\-Lister\-Cache::Files\-Removed(), KCombi\-View::insert\-Item(), KDir\-Operator::insert\-New\-Files(), KFile\-Tree\-View\-Item::is\-Dir(), is\-File(), KDir\-Lister::items\-For\-Dir(), KFile\-Permissions\-Props\-Plugin::KFile\-Permissions\-Props\-Plugin(), KFile\-Props\-Plugin::KFile\-Props\-Plugin(), KDir\-Lister::matches\-Filter(), parse\-Permissions(), KDir\-Operator::prepare\-Completion\-Objects(), KFile\-View::remove\-Item(), KFile\-Dialog::set\-Selection(), KFile\-Icon\-View::set\-Sorting(), and KFile\-View::update\-Numbers().\index{KFileItem@{KFile\-Item}!isFile@{isFile}}
\index{isFile@{isFile}!KFileItem@{KFile\-Item}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KFile\-Item::is\-File () const\hspace{0.3cm}{\tt  [inline]}}\label{classKFileItem_a16}


Returns true if this item represents a file (and not a a directory). 



Definition at line 158 of file kfileitem.h.

References is\-Dir().

Referenced by KFile\-View::update\-Numbers().\index{KFileItem@{KFile\-Item}!isReadable@{isReadable}}
\index{isReadable@{isReadable}!KFileItem@{KFile\-Item}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KFile\-Item::is\-Readable () const}\label{classKFileItem_a17}


\begin{Desc}
\item[Returns:]true if the file can be read - more precisely, returns false if we know for sure it can't. In some cases (remote files), we may return true even though it can't be read. \end{Desc}


Definition at line 476 of file kfileitem.cpp.

References QFile::encode\-Name(), and KURL::path().

Referenced by overlays().\index{KFileItem@{KFile\-Item}!linkDest@{linkDest}}
\index{linkDest@{linkDest}!KFileItem@{KFile\-Item}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KFile\-Item::link\-Dest () const}\label{classKFileItem_a18}


Returns the link destination if {\bf is\-Link()}{\rm (p.\,\pageref{classKFileItem_a14})} == true. 



Definition at line 250 of file kfileitem.cpp.

References QValue\-List::begin(), QFile::decode\-Name(), QFile::encode\-Name(), QValue\-List::end(), and KURL::path().

Referenced by get\-Status\-Bar\-Info(), KFile\-Props\-Plugin::KFile\-Props\-Plugin(), and run().\index{KFileItem@{KFile\-Item}!size@{size}}
\index{size@{size}!KFileItem@{KFile\-Item}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KIO::filesize\_\-t KFile\-Item::size () const}\label{classKFileItem_a19}


Returns the size of the file, if known. 



Definition at line 271 of file kfileitem.cpp.

References QValue\-List::begin(), QFile::encode\-Name(), QValue\-List::end(), and KURL::path().

Referenced by cmp(), get\-Status\-Bar\-Info(), get\-Tool\-Tip\-Text(), KFile\-List\-View\-Item::init(), KFile\-Props\-Plugin::KFile\-Props\-Plugin(), and KFile\-Icon\-View::set\-Sorting().\index{KFileItem@{KFile\-Item}!time@{time}}
\index{time@{time}!KFileItem@{KFile\-Item}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}time\_\-t KFile\-Item::time (unsigned int {\em which}) const}\label{classKFileItem_a20}


\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em which}]UDS\_\-MODIFICATION\_\-TIME, UDS\_\-ACCESS\_\-TIME or even UDS\_\-CREATION\_\-TIME \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]the time asked for, (time\_\-t)0 if not available \end{Desc}
\begin{Desc}
\item[See also:]{\bf time\-String}{\rm (p.\,\pageref{classKFileItem_a21})} \end{Desc}


Definition at line 293 of file kfileitem.cpp.

References QValue\-List::begin(), QFile::encode\-Name(), QValue\-List::end(), and KURL::path().

Referenced by cmp(), KFile\-Props\-Plugin::KFile\-Props\-Plugin(), KFile\-Icon\-View::set\-Sorting(), and time\-String().\index{KFileItem@{KFile\-Item}!timeString@{timeString}}
\index{timeString@{timeString}!KFileItem@{KFile\-Item}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KFile\-Item::time\-String (unsigned int {\em which} = KIO::UDS\_\-MODIFICATION\_\-TIME) const}\label{classKFileItem_a21}


\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em which}]UDS\_\-MODIFICATION\_\-TIME, UDS\_\-ACCESS\_\-TIME or even UDS\_\-CREATION\_\-TIME \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]a formatted string of the requested time.\end{Desc}
\begin{Desc}
\item[See also:]{\bf time}{\rm (p.\,\pageref{classKFileItem_a20})} \end{Desc}


Definition at line 762 of file kfileitem.cpp.

References KLocale::format\-Date\-Time(), KGlobal::locale(), QDate\-Time::set\-Time\_\-t(), and time().

Referenced by get\-Tool\-Tip\-Text(), and KFile\-List\-View\-Item::init().\index{KFileItem@{KFile\-Item}!isLocalFile@{isLocalFile}}
\index{isLocalFile@{isLocalFile}!KFileItem@{KFile\-Item}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KFile\-Item::is\-Local\-File () const\hspace{0.3cm}{\tt  [inline]}}\label{classKFileItem_a22}


Returns true if the file is a local file. 



Definition at line 195 of file kfileitem.h.

Referenced by KProps\-Dlg\-Plugin::is\-Desktop\-File().\index{KFileItem@{KFile\-Item}!text@{text}}
\index{text@{text}!KFileItem@{KFile\-Item}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}const {\bf QString}\& KFile\-Item::text () const\hspace{0.3cm}{\tt  [inline]}}\label{classKFileItem_a23}


Returns the text of the file item. 

It's not exactly the filename since some decoding happens ('\%2F'-$>$'/'). 

Definition at line 201 of file kfileitem.h.

Referenced by get\-Status\-Bar\-Info(), KFile\-List\-View\-Item::init(), KFile\-Icon\-View::insert\-Item(), KDir\-Lister::matches\-Filter(), and KFile\-Icon\-View::set\-Sorting().\index{KFileItem@{KFile\-Item}!name@{name}}
\index{name@{name}!KFileItem@{KFile\-Item}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}const {\bf QString}\& KFile\-Item::name (bool {\em lower\-Case} = false) const\hspace{0.3cm}{\tt  [inline]}}\label{classKFileItem_a24}


\begin{Desc}
\item[Returns:]the name of the file item (without a path) Similar to {\bf text}{\rm (p.\,\pageref{classKFileItem_a23})}(), but unencoded, i.e. the original name If {\tt lower\-Case} is true, the name will be returned in lower case, which is useful to speed up sorting by name, case insensitively. \end{Desc}


Definition at line 209 of file kfileitem.h.

References QString::is\-Null(), and QString::lower().

Referenced by KFile\-Dialog::multi\-Selection\-Changed(), KDir\-Operator::prepare\-Completion\-Objects(), and KFile\-View::set\-Current\-Item().\index{KFileItem@{KFile\-Item}!mimetype@{mimetype}}
\index{mimetype@{mimetype}!KFileItem@{KFile\-Item}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KFile\-Item::mimetype () const}\label{classKFileItem_a25}


Returns the mimetype of the file item. 

If determine\-Mime\-Type\-On\-Demand was used, this will determine the mimetype first. Equivalent to {\bf determine\-Mime\-Type()}{\rm (p.\,\pageref{classKFileItem_a26})}-$>${\bf name()}{\rm (p.\,\pageref{classKFileItem_a24})} 

Definition at line 371 of file kfileitem.cpp.

References determine\-Mime\-Type().

Referenced by accepts\-Drops(), KProps\-Dlg\-Plugin::is\-Desktop\-File(), KDir\-Lister::matches\-Mime\-Filter(), and meta\-Info().\index{KFileItem@{KFile\-Item}!determineMimeType@{determineMimeType}}
\index{determineMimeType@{determineMimeType}!KFileItem@{KFile\-Item}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf KMime\-Type::Ptr} KFile\-Item::determine\-Mime\-Type ()}\label{classKFileItem_a26}


Returns the mimetype of the file item. 

If determine\-Mime\-Type\-On\-Demand was used, this will determine the mimetype first. 

Definition at line 377 of file kfileitem.cpp.

References KMime\-Type::find\-By\-URL().

Referenced by assign(), get\-Status\-Bar\-Info(), get\-Tool\-Tip\-Text(), icon\-Name(), mime\-Comment(), and mimetype().\index{KFileItem@{KFile\-Item}!mimeTypePtr@{mimeTypePtr}}
\index{mimeTypePtr@{mimeTypePtr}!KFileItem@{KFile\-Item}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf KMime\-Type::Ptr} KFile\-Item::mime\-Type\-Ptr () const\hspace{0.3cm}{\tt  [inline]}}\label{classKFileItem_a27}


Returns the currently known mimetype of the file item. 

This will not try to determine the mimetype if unknown. 

Definition at line 235 of file kfileitem.h.\index{KFileItem@{KFile\-Item}!mimeComment@{mimeComment}}
\index{mimeComment@{mimeComment}!KFileItem@{KFile\-Item}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KFile\-Item::mime\-Comment ()}\label{classKFileItem_a29}


Returns the descriptive comment for this mime type, or the mime type itself if none is present. 



Definition at line 397 of file kfileitem.cpp.

References determine\-Mime\-Type(), and QString::is\-Empty().

Referenced by KFile\-Props\-Plugin::KFile\-Props\-Plugin().\index{KFileItem@{KFile\-Item}!iconName@{iconName}}
\index{iconName@{iconName}!KFileItem@{KFile\-Item}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KFile\-Item::icon\-Name ()}\label{classKFileItem_a30}


Returns the full path name to the icon that represents this mime type. 



Definition at line 407 of file kfileitem.cpp.

References determine\-Mime\-Type().\index{KFileItem@{KFile\-Item}!pixmap@{pixmap}}
\index{pixmap@{pixmap}!KFileItem@{KFile\-Item}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QPixmap} KFile\-Item::pixmap (int {\em \_\-size}, int {\em \_\-state} = 0) const}\label{classKFileItem_a31}


Returns a pixmap representing the file. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em \_\-size}]Size for the pixmap in pixels. Zero will return the globally configured default size. \item[{\em \_\-state}]The state of the icon: {\bf KIcon::Default\-State}, {\bf KIcon::Active\-State} or {\bf KIcon::Disabled\-State}. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]the pixmap \end{Desc}


Definition at line 439 of file kfileitem.cpp.

References KURL::file\-Name(), KMime\-Type::find\-By\-URL(), KService\-Type::icon(), QString::is\-Empty(), QPixmap::is\-Null(), QString::left(), QString::length(), KMime\-Type::mime\-Type(), overlays(), KURL::path(), QString::right(), and KGlobal::static\-QString().

Referenced by KFile\-List\-View\-Item::init(), KFile\-Icon\-View::insert\-Item(), and KFile\-Detail\-View::update\-View().\index{KFileItem@{KFile\-Item}!overlays@{overlays}}
\index{overlays@{overlays}!KFileItem@{KFile\-Item}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int KFile\-Item::overlays () const}\label{classKFileItem_a32}


Returns the overlays (bitfield of {\bf KIcon}::$\ast$Overlay flags) that are used for this item's pixmap. 



Definition at line 412 of file kfileitem.cpp.

References KURL::file\-Name(), KIcon::Hidden\-Overlay, KFile\-Share::is\-Directory\-Shared(), is\-Readable(), KIcon::Link\-Overlay, KIcon::Lock\-Overlay, KURL::path(), QString::right(), KIcon::Share\-Overlay, and KIcon::Zip\-Overlay.

Referenced by pixmap().\index{KFileItem@{KFile\-Item}!getStatusBarInfo@{getStatusBarInfo}}
\index{getStatusBarInfo@{getStatusBarInfo}!KFileItem@{KFile\-Item}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KFile\-Item::get\-Status\-Bar\-Info ()}\label{classKFileItem_a33}


Returns the string to be displayed in the statusbar, e.g. 

when the mouse is over this item 

Definition at line 532 of file kfileitem.cpp.

References QString::arg(), determine\-Mime\-Type(), QString::is\-Empty(), link\-Dest(), size(), and text().\index{KFileItem@{KFile\-Item}!getToolTipText@{getToolTipText}}
\index{getToolTipText@{getToolTipText}!KFileItem@{KFile\-Item}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KFile\-Item::get\-Tool\-Tip\-Text (int {\em maxcount} = 6)}\label{classKFileItem_a34}


\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em maxcount}]the maximum number of entries shown\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]the string to be displayed in the tool tip when the mouse is over this item. This may load a plugin to determine additional information specific to the mimetype of the file \end{Desc}


Definition at line 571 of file kfileitem.cpp.

References QString::arg(), KIO::convert\-Size(), determine\-Mime\-Type(), KStd\-Accel::end(), QStyle\-Sheet::escape(), group(), QString::is\-Empty(), KFile\-Meta\-Info::is\-Empty(), KFile\-Meta\-Info\-Item::is\-Valid(), KFile\-Meta\-Info::is\-Valid(), KFile\-Meta\-Info::item(), QString::left(), QString::length(), meta\-Info(), parse\-Permissions(), KFile\-Meta\-Info::preferred\-Keys(), size(), KFile\-Meta\-Info\-Item::string(), time\-String(), KFile\-Meta\-Info\-Item::translated\-Key(), and user().\index{KFileItem@{KFile\-Item}!acceptsDrops@{acceptsDrops}}
\index{acceptsDrops@{acceptsDrops}!KFileItem@{KFile\-Item}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KFile\-Item::accepts\-Drops ()}\label{classKFileItem_a35}


Returns true if files can be dropped over this item. 

Contrary to popular belief, not only dirs will return true :) Executables, .desktop files, will do so as well. 

Definition at line 507 of file kfileitem.cpp.

References QFile::encode\-Name(), mimetype(), mode(), and KURL::path().\index{KFileItem@{KFile\-Item}!run@{run}}
\index{run@{run}!KFileItem@{KFile\-Item}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KFile\-Item::run ()}\label{classKFileItem_a36}


Let's \char`\"{}KRun\char`\"{} this file ! (e.g. 

when file is clicked or double-clicked or return is pressed) 

Definition at line 639 of file kfileitem.cpp.

References link\-Dest(), and url().\index{KFileItem@{KFile\-Item}!entry@{entry}}
\index{entry@{entry}!KFileItem@{KFile\-Item}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}const {\bf KIO::UDSEntry}\& KFile\-Item::entry () const\hspace{0.3cm}{\tt  [inline]}}\label{classKFileItem_a37}


Returns the UDS entry. 

Used by the tree view to access all details by position. 

Definition at line 298 of file kfileitem.h.

References KIO::UDSEntry.\index{KFileItem@{KFile\-Item}!cmp@{cmp}}
\index{cmp@{cmp}!KFileItem@{KFile\-Item}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KFile\-Item::cmp (const {\bf KFile\-Item} \& {\em item})}\label{classKFileItem_a41}


Somewhat like a comparison operator, but more explicit. 



Definition at line 650 of file kfileitem.cpp.

References m\_\-b\-Is\-Local\-URL, m\_\-b\-Link, m\_\-file\-Mode, m\_\-group, m\_\-permissions, m\_\-str\-Name, m\_\-user, size(), and time().\index{KFileItem@{KFile\-Item}!setExtraData@{setExtraData}}
\index{setExtraData@{setExtraData}!KFileItem@{KFile\-Item}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KFile\-Item::set\-Extra\-Data (const void $\ast$ {\em key}, void $\ast$ {\em value})\hspace{0.3cm}{\tt  [virtual]}}\label{classKFileItem_a42}


This allows to associate some \char`\"{}extra\char`\"{} data to a KFile\-Item. 

As one KFile\-Item can be used by several objects (often views) which all need to add some data, you have to use a key to reference your extra data within the KFile\-Item.

That way a KFile\-Item can hold and provide access to all those views separately.

I.e. a {\bf KFile\-Icon\-View}{\rm (p.\,\pageref{classKFileIconView})} that associates a {\bf KFile\-Icon\-View\-Item}{\rm (p.\,\pageref{classKFileIconViewItem})} (an item suitable for use with {\bf QIcon\-View}) does

\small\begin{alltt}
 kfileItem-$>$setExtraData( this, iconViewItem );
 \end{alltt}\normalsize 


and can later access the icon\-View\-Item by doing

\small\begin{alltt}
 {\bf KFileIconViewItem}{\rm (p.\,\pageref{classKFileIconViewItem})} *iconViewItem = static\_cast<KFileIconViewItem*>( kfileItem-$>$extraData( this ));
 \end{alltt}\normalsize 


This is usually more efficient then having every view associate data to items by using a separate {\bf QDict} or {\bf QMap}.

Note: you have to remove and destroy the data you associated yourself when you don't need it anymore!

\begin{Desc}
\item[See also:]{\bf extra\-Data}{\rm (p.\,\pageref{classKFileItem_a43})} 

{\bf remove\-Extra\-Data}{\rm (p.\,\pageref{classKFileItem_a45})} \end{Desc}


Definition at line 691 of file kfileitem.cpp.

References KStd\-Accel::key().

Referenced by KFile\-Icon\-View::insert\-Item(), and KFile\-Detail\-View::insert\-Item().\index{KFileItem@{KFile\-Item}!extraData@{extraData}}
\index{extraData@{extraData}!KFileItem@{KFile\-Item}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}const  void $\ast$ KFile\-Item::extra\-Data (const void $\ast$ {\em key}) const\hspace{0.3cm}{\tt  [virtual]}}\label{classKFileItem_a43}


\begin{Desc}
\item[Returns:]the extra data associated to an item with {\tt key} via {\bf set\-Extra\-Data}{\rm (p.\,\pageref{classKFileItem_a42})}. Returns 0L if nothing was associated with {\tt key}.\end{Desc}
\begin{Desc}
\item[See also:]{\bf extra\-Data}{\rm (p.\,\pageref{classKFileItem_a43})} \end{Desc}


Definition at line 699 of file kfileitem.cpp.

References QMap\-Const\-Iterator::data(), and KStd\-Accel::key().

Referenced by KFile\-Detail\-View::ensure\-Item\-Visible(), KFile\-Tree\-View::find\-Item(), KFile\-Tree\-Branch::find\-TVIBy\-URL(), KFile\-Detail\-View::is\-Selected(), KFile\-Detail\-View::remove\-Item(), KFile\-Detail\-View::set\-Current\-Item(), and KFile\-Detail\-View::set\-Selected().\index{KFileItem@{KFile\-Item}!extraData@{extraData}}
\index{extraData@{extraData}!KFileItem@{KFile\-Item}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void $\ast$ KFile\-Item::extra\-Data (const void $\ast$ {\em key})\hspace{0.3cm}{\tt  [virtual]}}\label{classKFileItem_a44}


The non-const version of the previous {\tt {\bf extra\-Data()}{\rm (p.\,\pageref{classKFileItem_a43})}} method. 



Definition at line 707 of file kfileitem.cpp.

References QMap\-Iterator::data(), and KStd\-Accel::key().\index{KFileItem@{KFile\-Item}!removeExtraData@{removeExtraData}}
\index{removeExtraData@{removeExtraData}!KFileItem@{KFile\-Item}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KFile\-Item::remove\-Extra\-Data (const void $\ast$ {\em key})\hspace{0.3cm}{\tt  [virtual]}}\label{classKFileItem_a45}


Removes the extra data associated with an item via {\tt key}. 



Definition at line 715 of file kfileitem.cpp.

References KStd\-Accel::key().\index{KFileItem@{KFile\-Item}!setMetaInfo@{setMetaInfo}}
\index{setMetaInfo@{setMetaInfo}!KFileItem@{KFile\-Item}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KFile\-Item::set\-Meta\-Info (const {\bf KFile\-Meta\-Info} \& {\em info})}\label{classKFileItem_a46}


Sets the metainfo of this item to {\tt info}. 



Definition at line 769 of file kfileitem.cpp.

Referenced by KFile\-Meta\-Props\-Plugin::KFile\-Meta\-Props\-Plugin().\index{KFileItem@{KFile\-Item}!metaInfo@{metaInfo}}
\index{metaInfo@{metaInfo}!KFileItem@{KFile\-Item}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}const  {\bf KFile\-Meta\-Info} \& KFile\-Item::meta\-Info (bool {\em autoget} = true, int {\em what} = KFile\-Meta\-Info::Fastest) const}\label{classKFileItem_a47}


Returns the metainfo of this item. 

If {\tt autoget} is true, it will automatically be created 

Definition at line 774 of file kfileitem.cpp.

References KURL::is\-Local\-File(), KFile\-Meta\-Info::is\-Valid(), mimetype(), and KURL::path().

Referenced by get\-Tool\-Tip\-Text(), and KFile\-Meta\-Props\-Plugin::KFile\-Meta\-Props\-Plugin().\index{KFileItem@{KFile\-Item}!assign@{assign}}
\index{assign@{assign}!KFileItem@{KFile\-Item}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KFile\-Item::assign (const {\bf KFile\-Item} \& {\em item})}\label{classKFileItem_a48}


Somewhat like an assignment operator, but more explicit. 

Note: extra-data set with {\bf set\-Extra\-Data}{\rm (p.\,\pageref{classKFileItem_a42})}() is not copied, so be careful what you do!

I.e. {\bf KDir\-Lister}{\rm (p.\,\pageref{classKDirLister})} uses it to update existing items from a fresh item. 

Definition at line 663 of file kfileitem.cpp.

References determine\-Mime\-Type(), m\_\-access, m\_\-b\-Is\-Local\-URL, m\_\-b\-Link, m\_\-b\-Mime\-Type\-Known, m\_\-entry, m\_\-file\-Mode, m\_\-group, m\_\-guessed\-Mime\-Type, m\_\-meta\-Info, m\_\-permissions, m\_\-p\-Mime\-Type, m\_\-size, m\_\-str\-Lower\-Case\-Name, m\_\-str\-Name, m\_\-str\-Text, m\_\-time, m\_\-url, and m\_\-user.

Referenced by KFile\-Item().\index{KFileItem@{KFile\-Item}!init@{init}}
\index{init@{init}!KFileItem@{KFile\-Item}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KFile\-Item::init (bool {\em \_\-determine\-Mime\-Type\-On\-Demand})\hspace{0.3cm}{\tt  [protected]}}\label{classKFileItem_b0}


Computes the text, mode, and mimetype from the UDSEntry Called by constructor, but can be called again later. 



Definition at line 159 of file kfileitem.cpp.

References KMime\-Type::default\-Mime\-Type(), QFile::encode\-Name(), KMime\-Type::find\-By\-URL(), KURL::is\-Local\-File(), mode(), and KURL::path().

Referenced by KFile\-Item(), refresh(), and refresh\-Mime\-Type().\index{KFileItem@{KFile\-Item}!parsePermissions@{parsePermissions}}
\index{parsePermissions@{parsePermissions}!KFileItem@{KFile\-Item}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KFile\-Item::parse\-Permissions (mode\_\-t {\em perm}) const\hspace{0.3cm}{\tt  [protected]}}\label{classKFileItem_b1}


Parses the given permission set and provides it for access(). 



Definition at line 728 of file kfileitem.cpp.

References QString::from\-Latin1(), is\-Dir(), and is\-Link().

Referenced by get\-Tool\-Tip\-Text(), and permissions\-String().

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