.TH "KFileItem" 3 "28 Jan 2004" "kio Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
KFileItem \- A KFileItem is a generic class to handle a file, local or remote.  

.PP
.SH SYNOPSIS
.br
.PP
\fC#include <kfileitem.h>\fP
.PP
.SS "Public Types"

.in +1c
.ti -1c
.RI "enum { \fBUnknown\fP =  (mode_t) - 1 }"
.br
.in -1c
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "\fBKFileItem\fP (const  \fBKIO::UDSEntry\fP &_entry, const  \fBKURL\fP &_url, bool _determineMimeTypeOnDemand=false, bool _urlIsDirectory=false)"
.br
.RI "\fICreates an item representing a file, from a \fBUDSEntry\fP. \fP"
.ti -1c
.RI "\fBKFileItem\fP (mode_t _mode, mode_t _permissions, const  \fBKURL\fP &_url, bool _determineMimeTypeOnDemand=false)"
.br
.RI "\fICreates an item representing a file, from all the necessary info for it. \fP"
.ti -1c
.RI "\fBKFileItem\fP (const  \fBKURL\fP &url, const  \fBQString\fP &mimeType, mode_t mode)"
.br
.RI "\fICreates an item representing a file, for which the mimetype is already known. \fP"
.ti -1c
.RI "\fBKFileItem\fP (const  \fBKFileItem\fP &item)"
.br
.RI "\fICopy constructor. \fP"
.ti -1c
.RI "virtual \fB~KFileItem\fP ()"
.br
.RI "\fIDestructs the KFileItem. \fP"
.ti -1c
.RI "void \fBrefresh\fP ()"
.br
.RI "\fIRe-reads information (currently only permissions and mimetype). \fP"
.ti -1c
.RI "void \fBrefreshMimeType\fP ()"
.br
.RI "\fIRe-reads mimetype information. \fP"
.ti -1c
.RI "const  \fBKURL\fP & \fBurl\fP () const "
.br
.RI "\fIReturns the url of the file. \fP"
.ti -1c
.RI "void \fBsetURL\fP (const  \fBKURL\fP &url)"
.br
.RI "\fISets the item's URL. \fP"
.ti -1c
.RI "mode_t \fBpermissions\fP () const "
.br
.RI "\fIReturns the permissions of the file (stat.st_mode containing only permissions). \fP"
.ti -1c
.RI "\fBQString\fP \fBpermissionsString\fP () const "
.br
.RI "\fIReturns the access permissions for the file as a string. \fP"
.ti -1c
.RI "mode_t \fBmode\fP () const "
.br
.RI "\fIReturns the file type (stat.st_mode containing only S_IFDIR, S_IFLNK, ...). \fP"
.ti -1c
.RI "\fBQString\fP \fBuser\fP () const "
.br
.RI "\fIReturns the owner of the file. \fP"
.ti -1c
.RI "\fBQString\fP \fBgroup\fP () const "
.br
.RI "\fIReturns the group of the file. \fP"
.ti -1c
.RI "bool \fBisLink\fP () const "
.br
.RI "\fIReturns true if this item represents a link in the UNIX sense of a link. \fP"
.ti -1c
.RI "bool \fBisDir\fP () const "
.br
.RI "\fIReturns true if this item represents a directory. \fP"
.ti -1c
.RI "bool \fBisFile\fP () const "
.br
.RI "\fIReturns true if this item represents a file (and not a a directory). \fP"
.ti -1c
.RI "bool \fBisReadable\fP () const "
.br
.ti -1c
.RI "\fBQString\fP \fBlinkDest\fP () const "
.br
.RI "\fIReturns the link destination if \fBisLink()\fP == true. \fP"
.ti -1c
.RI "KIO::filesize_t \fBsize\fP () const "
.br
.RI "\fIReturns the size of the file, if known. \fP"
.ti -1c
.RI "time_t \fBtime\fP (unsigned int which) const "
.br
.ti -1c
.RI "\fBQString\fP \fBtimeString\fP (unsigned int which=KIO::UDS_MODIFICATION_TIME) const "
.br
.ti -1c
.RI "bool \fBisLocalFile\fP () const "
.br
.RI "\fIReturns true if the file is a local file. \fP"
.ti -1c
.RI "const  \fBQString\fP & \fBtext\fP () const "
.br
.RI "\fIReturns the text of the file item. \fP"
.ti -1c
.RI "const  \fBQString\fP & \fBname\fP (bool lowerCase=false) const "
.br
.ti -1c
.RI "\fBQString\fP \fBmimetype\fP () const "
.br
.RI "\fIReturns the mimetype of the file item. \fP"
.ti -1c
.RI "\fBKMimeType::Ptr\fP \fBdetermineMimeType\fP ()"
.br
.RI "\fIReturns the mimetype of the file item. \fP"
.ti -1c
.RI "\fBKMimeType::Ptr\fP \fBmimeTypePtr\fP () const "
.br
.RI "\fIReturns the currently known mimetype of the file item. \fP"
.ti -1c
.RI "bool \fBisMimeTypeKnown\fP () const "
.br
.ti -1c
.RI "\fBQString\fP \fBmimeComment\fP ()"
.br
.RI "\fIReturns the descriptive comment for this mime type, or the mime type itself if none is present. \fP"
.ti -1c
.RI "\fBQString\fP \fBiconName\fP ()"
.br
.RI "\fIReturns the full path name to the icon that represents this mime type. \fP"
.ti -1c
.RI "\fBQPixmap\fP \fBpixmap\fP (int _size, int _state=0) const "
.br
.RI "\fIReturns a pixmap representing the file. \fP"
.ti -1c
.RI "int \fBoverlays\fP () const "
.br
.RI "\fIReturns the overlays (bitfield of \fBKIcon\fP::*Overlay flags) that are used for this item's pixmap. \fP"
.ti -1c
.RI "\fBQString\fP \fBgetStatusBarInfo\fP ()"
.br
.RI "\fIReturns the string to be displayed in the statusbar, e.g. \fP"
.ti -1c
.RI "\fBQString\fP \fBgetToolTipText\fP (int maxcount=6)"
.br
.ti -1c
.RI "bool \fBacceptsDrops\fP ()"
.br
.RI "\fIReturns true if files can be dropped over this item. \fP"
.ti -1c
.RI "void \fBrun\fP ()"
.br
.RI "\fILet's 'KRun' this file ! (e.g. \fP"
.ti -1c
.RI "const  \fBKIO::UDSEntry\fP & \fBentry\fP () const "
.br
.RI "\fIReturns the UDS entry. \fP"
.ti -1c
.RI "bool \fBisMarked\fP () const "
.br
.ti -1c
.RI "void \fBmark\fP ()"
.br
.ti -1c
.RI "void \fBunmark\fP ()"
.br
.ti -1c
.RI "bool \fBcmp\fP (const  \fBKFileItem\fP &item)"
.br
.RI "\fISomewhat like a comparison operator, but more explicit. \fP"
.ti -1c
.RI "virtual void \fBsetExtraData\fP (const  void *key, void *value)"
.br
.RI "\fIThis allows to associate some 'extra' data to a KFileItem. \fP"
.ti -1c
.RI "virtual const  void * \fBextraData\fP (const  void *key) const "
.br
.ti -1c
.RI "virtual void * \fBextraData\fP (const  void *key)"
.br
.RI "\fIThe non-const version of the previous \fC\fBextraData()\fP\fP method. \fP"
.ti -1c
.RI "virtual void \fBremoveExtraData\fP (const  void *key)"
.br
.RI "\fIRemoves the extra data associated with an item via \fCkey\fP. \fP"
.ti -1c
.RI "void \fBsetMetaInfo\fP (const  \fBKFileMetaInfo\fP &info)"
.br
.RI "\fISets the metainfo of this item to \fCinfo\fP. \fP"
.ti -1c
.RI "const  \fBKFileMetaInfo\fP & \fBmetaInfo\fP (bool autoget=true, int what=KFileMetaInfo::Fastest) const "
.br
.RI "\fIReturns the metainfo of this item. \fP"
.ti -1c
.RI "void \fBassign\fP (const  \fBKFileItem\fP &item)"
.br
.RI "\fISomewhat like an assignment operator, but more explicit. \fP"
.in -1c
.SS "Protected Member Functions"

.in +1c
.ti -1c
.RI "void \fBinit\fP (bool _determineMimeTypeOnDemand)"
.br
.RI "\fIComputes the text, mode, and mimetype from the UDSEntry Called by constructor, but can be called again later. \fP"
.ti -1c
.RI "\fBQString\fP \fBparsePermissions\fP (mode_t perm) const "
.br
.RI "\fIParses the given permission set and provides it for \fBaccess\fP(). \fP"
.ti -1c
.RI "virtual void \fBvirtual_hook\fP (int id, void *data)"
.br
.in -1c
.SH "Detailed Description"
.PP 
A KFileItem is a generic class to handle a file, local or remote. 

In particular, it makes it easier to handle the result of \fBKIO::listDir\fP. (UDSEntry isn't very friendly to use) It includes many file attributes such as mimetype, icon, text, mode, link... 
.PP
Definition at line 40 of file kfileitem.h.
.SH "Constructor & Destructor Documentation"
.PP 
.SS "KFileItem::KFileItem (const \fBKIO::UDSEntry\fP & _entry, const \fBKURL\fP & _url, bool _determineMimeTypeOnDemand = false, bool _urlIsDirectory = false)"
.PP
Creates an item representing a file, from a \fBUDSEntry\fP. This is the preferred constructor when using \fBKIO::listDir()\fP.
.PP
\fBParameters:\fP
.RS 4
\fI_entry\fP the \fBKIO\fP entry used to get the file, contains info about it 
.br
\fI_url\fP the file url 
.br
\fI_determineMimeTypeOnDemand\fP specifies if the mimetype of the given URL should be determined immediately or on demand 
.br
\fI_urlIsDirectory\fP specifies if the url is just the directory of the fileitem and the filename from the UDSEntry should be used. 
.RE
.PP
Definition at line 47 of file kfileitem.cpp.
.PP
References KURL::addPath(), QValueList::begin(), KIO::decodeFileName(), QValueList::end(), init(), QString::isEmpty(), KMimeType::mimeType(), KGlobal::staticQString(), and KIO::UDSEntry.
.SS "KFileItem::KFileItem (mode_t _mode, mode_t _permissions, const \fBKURL\fP & _url, bool _determineMimeTypeOnDemand = false)"
.PP
Creates an item representing a file, from all the necessary info for it. \fBParameters:\fP
.RS 4
\fI_mode\fP the file mode (according to stat() (e.g. S_IFDIR...) Set to KFileItem::Unknown if unknown. For local files, KFileItem will use stat(). 
.br
\fI_permissions\fP the access permissions If you set both the mode and the permissions, you save a ::stat() for local files. Set to KFileItem::Unknown if you don't know the mode or the permission. 
.br
\fI_url\fP the file url
.br
\fI_determineMimeTypeOnDemand\fP specify if the mimetype of the given URL should be determined immediately or on demand 
.RE
.PP
Definition at line 113 of file kfileitem.cpp.
.PP
References KIO::decodeFileName(), and init().
.SS "KFileItem::KFileItem (const \fBKURL\fP & url, const \fBQString\fP & mimeType, mode_t mode)"
.PP
Creates an item representing a file, for which the mimetype is already known. \fBParameters:\fP
.RS 4
\fIurl\fP the file url 
.br
\fImimeType\fP the name of the file's mimetype 
.br
\fImode\fP the mode (S_IFDIR...) 
.RE
.PP
Definition at line 130 of file kfileitem.cpp.
.PP
References KIO::decodeFileName(), init(), and KMimeType::mimeType().
.SS "KFileItem::KFileItem (const \fBKFileItem\fP & item)"
.PP
Copy constructor. Note that extra-data set via \fBsetExtraData\fP() is not deeply copied -- just the pointers are copied. Definition at line 149 of file kfileitem.cpp.
.PP
References assign().
.SS "KFileItem::~\fBKFileItem\fP ()\fC [virtual]\fP"
.PP
Destructs the KFileItem. Extra data set via \fBsetExtraData()\fP is not deleted. Definition at line 155 of file kfileitem.cpp.
.SH "Member Function Documentation"
.PP 
.SS "void KFileItem::refresh ()"
.PP
Re-reads information (currently only permissions and mimetype). This is called when the _file_ changes. Definition at line 217 of file kfileitem.cpp.
.PP
References init(), and KIO::UDSEntry.
.PP
Referenced by KDirListerCache::FilesChanged().
.SS "void KFileItem::refreshMimeType ()"
.PP
Re-reads mimetype information. This is called when the mimetype database changes. Definition at line 237 of file kfileitem.cpp.
.PP
References init().
.PP
Referenced by KDirListerCache::FileRenamed().
.SS "const \fBKURL\fP& KFileItem::url () const\fC [inline]\fP"
.PP
Returns the url of the file. Definition at line 111 of file kfileitem.h.
.PP
Referenced by KDirListerCache::FilesRemoved(), KDirOperator::insertNewFiles(), KPropsDlgPlugin::isDesktopFile(), KFilePropsPlugin::KFilePropsPlugin(), KPropertiesDialog::KPropertiesDialog(), run(), KDirOperator::selectDir(), and KFileTreeViewItem::url().
.SS "void KFileItem::setURL (const \fBKURL\fP & url)"
.PP
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.
.PP
References KIO::decodeFileName().
.PP
Referenced by KDirListerCache::FileRenamed().
.SS "mode_t KFileItem::permissions () const\fC [inline]\fP"
.PP
Returns the permissions of the file (stat.st_mode containing only permissions). Definition at line 122 of file kfileitem.h.
.PP
Referenced by KFilePermissionsPropsPlugin::KFilePermissionsPropsPlugin().
.SS "\fBQString\fP KFileItem::permissionsString () const"
.PP
Returns the access permissions for the file as a string. Definition at line 720 of file kfileitem.cpp.
.PP
References QString::isNull(), and parsePermissions().
.PP
Referenced by KFileListViewItem::init().
.SS "mode_t KFileItem::mode () const\fC [inline]\fP"
.PP
Returns the file type (stat.st_mode containing only S_IFDIR, S_IFLNK, ...). Definition at line 132 of file kfileitem.h.
.PP
Referenced by acceptsDrops(), init(), KPropsDlgPlugin::isDesktopFile(), and KFilePropsPlugin::KFilePropsPlugin().
.SS "\fBQString\fP KFileItem::user () const"
.PP
Returns the owner of the file. Definition at line 337 of file kfileitem.cpp.
.PP
References QFile::encodeName(), QString::fromLocal8Bit(), QString::isEmpty(), KURL::path(), and user().
.PP
Referenced by getToolTipText(), KFileListViewItem::init(), KFilePermissionsPropsPlugin::KFilePermissionsPropsPlugin(), and user().
.SS "\fBQString\fP KFileItem::group () const"
.PP
Returns the group of the file. Definition at line 352 of file kfileitem.cpp.
.PP
References QFile::encodeName(), QString::fromLocal8Bit(), group(), QString::isEmpty(), KURL::path(), and QString::sprintf().
.PP
Referenced by getToolTipText(), group(), KFileListViewItem::init(), and KFilePermissionsPropsPlugin::KFilePermissionsPropsPlugin().
.SS "bool KFileItem::isLink () const\fC [inline]\fP"
.PP
Returns true if this item represents a link in the UNIX sense of a link. Definition at line 148 of file kfileitem.h.
.PP
Referenced by KFilePermissionsPropsPlugin::KFilePermissionsPropsPlugin(), KFilePropsPlugin::KFilePropsPlugin(), and parsePermissions().
.SS "bool KFileItem::isDir () const"
.PP
Returns true if this item represents a directory. Definition at line 497 of file kfileitem.cpp.
.PP
References QString::isEmpty().
.PP
Referenced by KFileViewSignaler::activate(), KDirListerCache::FilesRemoved(), KCombiView::insertItem(), KDirOperator::insertNewFiles(), KFileTreeViewItem::isDir(), isFile(), KDirLister::itemsForDir(), KFilePermissionsPropsPlugin::KFilePermissionsPropsPlugin(), KFilePropsPlugin::KFilePropsPlugin(), KDirLister::matchesFilter(), parsePermissions(), KDirOperator::prepareCompletionObjects(), KFileView::removeItem(), KFileDialog::setSelection(), KFileIconView::setSorting(), and KFileView::updateNumbers().
.SS "bool KFileItem::isFile () const\fC [inline]\fP"
.PP
Returns true if this item represents a file (and not a a directory). Definition at line 158 of file kfileitem.h.
.PP
References isDir().
.PP
Referenced by KFileView::updateNumbers().
.SS "bool KFileItem::isReadable () const"
.PP
\fBReturns:\fP
.RS 4
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. 
.RE
.PP
Definition at line 476 of file kfileitem.cpp.
.PP
References QFile::encodeName(), and KURL::path().
.PP
Referenced by overlays().
.SS "\fBQString\fP KFileItem::linkDest () const"
.PP
Returns the link destination if \fBisLink()\fP == true. Definition at line 250 of file kfileitem.cpp.
.PP
References QValueList::begin(), QFile::decodeName(), QFile::encodeName(), QValueList::end(), and KURL::path().
.PP
Referenced by getStatusBarInfo(), KFilePropsPlugin::KFilePropsPlugin(), and run().
.SS "KIO::filesize_t KFileItem::size () const"
.PP
Returns the size of the file, if known. Definition at line 271 of file kfileitem.cpp.
.PP
References QValueList::begin(), QFile::encodeName(), QValueList::end(), and KURL::path().
.PP
Referenced by cmp(), getStatusBarInfo(), getToolTipText(), KFileListViewItem::init(), KFilePropsPlugin::KFilePropsPlugin(), and KFileIconView::setSorting().
.SS "time_t KFileItem::time (unsigned int which) const"
.PP
\fBParameters:\fP
.RS 4
\fIwhich\fP UDS_MODIFICATION_TIME, UDS_ACCESS_TIME or even UDS_CREATION_TIME 
.RE
.PP
\fBReturns:\fP
.RS 4
the time asked for, (time_t)0 if not available 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBtimeString\fP 
.RE
.PP
Definition at line 293 of file kfileitem.cpp.
.PP
References QValueList::begin(), QFile::encodeName(), QValueList::end(), and KURL::path().
.PP
Referenced by cmp(), KFilePropsPlugin::KFilePropsPlugin(), KFileIconView::setSorting(), and timeString().
.SS "\fBQString\fP KFileItem::timeString (unsigned int which = KIO::UDS_MODIFICATION_TIME) const"
.PP
\fBParameters:\fP
.RS 4
\fIwhich\fP UDS_MODIFICATION_TIME, UDS_ACCESS_TIME or even UDS_CREATION_TIME 
.RE
.PP
\fBReturns:\fP
.RS 4
a formatted string of the requested time.
.RE
.PP
\fBSee also:\fP
.RS 4
\fBtime\fP 
.RE
.PP
Definition at line 762 of file kfileitem.cpp.
.PP
References KLocale::formatDateTime(), KGlobal::locale(), QDateTime::setTime_t(), and time().
.PP
Referenced by getToolTipText(), and KFileListViewItem::init().
.SS "bool KFileItem::isLocalFile () const\fC [inline]\fP"
.PP
Returns true if the file is a local file. Definition at line 195 of file kfileitem.h.
.PP
Referenced by KPropsDlgPlugin::isDesktopFile().
.SS "const \fBQString\fP& KFileItem::text () const\fC [inline]\fP"
.PP
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.
.PP
Referenced by getStatusBarInfo(), KFileListViewItem::init(), KFileIconView::insertItem(), KDirLister::matchesFilter(), and KFileIconView::setSorting().
.SS "const \fBQString\fP& KFileItem::name (bool lowerCase = false) const\fC [inline]\fP"
.PP
\fBReturns:\fP
.RS 4
the name of the file item (without a path) Similar to \fBtext\fP(), but unencoded, i.e. the original name If \fClowerCase\fP is true, the name will be returned in lower case, which is useful to speed up sorting by name, case insensitively. 
.RE
.PP
Definition at line 209 of file kfileitem.h.
.PP
References QString::isNull(), and QString::lower().
.PP
Referenced by KFileDialog::multiSelectionChanged(), KDirOperator::prepareCompletionObjects(), and KFileView::setCurrentItem().
.SS "\fBQString\fP KFileItem::mimetype () const"
.PP
Returns the mimetype of the file item. If determineMimeTypeOnDemand was used, this will determine the mimetype first. Equivalent to \fBdetermineMimeType()\fP->\fBname()\fP Definition at line 371 of file kfileitem.cpp.
.PP
References determineMimeType().
.PP
Referenced by acceptsDrops(), KPropsDlgPlugin::isDesktopFile(), KDirLister::matchesMimeFilter(), and metaInfo().
.SS "\fBKMimeType::Ptr\fP KFileItem::determineMimeType ()"
.PP
Returns the mimetype of the file item. If determineMimeTypeOnDemand was used, this will determine the mimetype first. Definition at line 377 of file kfileitem.cpp.
.PP
References KMimeType::findByURL().
.PP
Referenced by assign(), getStatusBarInfo(), getToolTipText(), iconName(), mimeComment(), and mimetype().
.SS "\fBKMimeType::Ptr\fP KFileItem::mimeTypePtr () const\fC [inline]\fP"
.PP
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.
.SS "\fBQString\fP KFileItem::mimeComment ()"
.PP
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.
.PP
References determineMimeType(), and QString::isEmpty().
.PP
Referenced by KFilePropsPlugin::KFilePropsPlugin().
.SS "\fBQString\fP KFileItem::iconName ()"
.PP
Returns the full path name to the icon that represents this mime type. Definition at line 407 of file kfileitem.cpp.
.PP
References determineMimeType().
.SS "\fBQPixmap\fP KFileItem::pixmap (int _size, int _state = 0) const"
.PP
Returns a pixmap representing the file. \fBParameters:\fP
.RS 4
\fI_size\fP Size for the pixmap in pixels. Zero will return the globally configured default size. 
.br
\fI_state\fP The state of the icon: \fBKIcon::DefaultState\fP, \fBKIcon::ActiveState\fP or \fBKIcon::DisabledState\fP. 
.RE
.PP
\fBReturns:\fP
.RS 4
the pixmap 
.RE
.PP
Definition at line 439 of file kfileitem.cpp.
.PP
References KURL::fileName(), KMimeType::findByURL(), KServiceType::icon(), QString::isEmpty(), QPixmap::isNull(), QString::left(), QString::length(), KMimeType::mimeType(), overlays(), KURL::path(), QString::right(), and KGlobal::staticQString().
.PP
Referenced by KFileListViewItem::init(), KFileIconView::insertItem(), and KFileDetailView::updateView().
.SS "int KFileItem::overlays () const"
.PP
Returns the overlays (bitfield of \fBKIcon\fP::*Overlay flags) that are used for this item's pixmap. Definition at line 412 of file kfileitem.cpp.
.PP
References KURL::fileName(), KIcon::HiddenOverlay, KFileShare::isDirectoryShared(), isReadable(), KIcon::LinkOverlay, KIcon::LockOverlay, KURL::path(), QString::right(), KIcon::ShareOverlay, and KIcon::ZipOverlay.
.PP
Referenced by pixmap().
.SS "\fBQString\fP KFileItem::getStatusBarInfo ()"
.PP
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.
.PP
References QString::arg(), determineMimeType(), QString::isEmpty(), linkDest(), size(), and text().
.SS "\fBQString\fP KFileItem::getToolTipText (int maxcount = 6)"
.PP
\fBParameters:\fP
.RS 4
\fImaxcount\fP the maximum number of entries shown
.RE
.PP
\fBReturns:\fP
.RS 4
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 
.RE
.PP
Definition at line 571 of file kfileitem.cpp.
.PP
References QString::arg(), KIO::convertSize(), determineMimeType(), KStdAccel::end(), QStyleSheet::escape(), group(), QString::isEmpty(), KFileMetaInfo::isEmpty(), KFileMetaInfoItem::isValid(), KFileMetaInfo::isValid(), KFileMetaInfo::item(), QString::left(), QString::length(), metaInfo(), parsePermissions(), KFileMetaInfo::preferredKeys(), size(), KFileMetaInfoItem::string(), timeString(), KFileMetaInfoItem::translatedKey(), and user().
.SS "bool KFileItem::acceptsDrops ()"
.PP
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.
.PP
References QFile::encodeName(), mimetype(), mode(), and KURL::path().
.SS "void KFileItem::run ()"
.PP
Let's 'KRun' this file ! (e.g. when file is clicked or double-clicked or return is pressed) Definition at line 639 of file kfileitem.cpp.
.PP
References linkDest(), and url().
.SS "const \fBKIO::UDSEntry\fP& KFileItem::entry () const\fC [inline]\fP"
.PP
Returns the UDS entry. Used by the tree view to access all details by position. Definition at line 298 of file kfileitem.h.
.PP
References KIO::UDSEntry.
.SS "bool KFileItem::cmp (const \fBKFileItem\fP & item)"
.PP
Somewhat like a comparison operator, but more explicit. Definition at line 650 of file kfileitem.cpp.
.PP
References m_bIsLocalURL, m_bLink, m_fileMode, m_group, m_permissions, m_strName, m_user, size(), and time().
.SS "void KFileItem::setExtraData (const void * key, void * value)\fC [virtual]\fP"
.PP
This allows to associate some 'extra' data to a KFileItem. As one KFileItem 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 KFileItem.
.PP
That way a KFileItem can hold and provide access to all those views separately.
.PP
I.e. a \fBKFileIconView\fP that associates a \fBKFileIconViewItem\fP (an item suitable for use with \fBQIconView\fP) does
.PP
.PP
.nf

 kfileItem->setExtraData( this, iconViewItem );
 
.PP
.PP
and can later access the iconViewItem by doing
.PP
.PP
.nf

 \fBKFileIconViewItem\fP *iconViewItem = static_cast<KFileIconViewItem*>( kfileItem->extraData( this ));
 
.PP
.PP
This is usually more efficient then having every view associate data to items by using a separate \fBQDict\fP or \fBQMap\fP.
.PP
Note: you have to remove and destroy the data you associated yourself when you don't need it anymore!
.PP
\fBSee also:\fP
.RS 4
\fBextraData\fP 
.PP
\fBremoveExtraData\fP 
.RE
.PP
Definition at line 691 of file kfileitem.cpp.
.PP
References KStdAccel::key().
.PP
Referenced by KFileIconView::insertItem(), and KFileDetailView::insertItem().
.SS "const  void * KFileItem::extraData (const void * key) const\fC [virtual]\fP"
.PP
\fBReturns:\fP
.RS 4
the extra data associated to an item with \fCkey\fP via \fBsetExtraData\fP. Returns 0L if nothing was associated with \fCkey\fP.
.RE
.PP
\fBSee also:\fP
.RS 4
\fBextraData\fP 
.RE
.PP
Definition at line 699 of file kfileitem.cpp.
.PP
References QMapConstIterator::data(), and KStdAccel::key().
.PP
Referenced by KFileDetailView::ensureItemVisible(), KFileTreeView::findItem(), KFileTreeBranch::findTVIByURL(), KFileDetailView::isSelected(), KFileDetailView::removeItem(), KFileDetailView::setCurrentItem(), and KFileDetailView::setSelected().
.SS "void * KFileItem::extraData (const void * key)\fC [virtual]\fP"
.PP
The non-const version of the previous \fC\fBextraData()\fP\fP method. Definition at line 707 of file kfileitem.cpp.
.PP
References QMapIterator::data(), and KStdAccel::key().
.SS "void KFileItem::removeExtraData (const void * key)\fC [virtual]\fP"
.PP
Removes the extra data associated with an item via \fCkey\fP. Definition at line 715 of file kfileitem.cpp.
.PP
References KStdAccel::key().
.SS "void KFileItem::setMetaInfo (const \fBKFileMetaInfo\fP & info)"
.PP
Sets the metainfo of this item to \fCinfo\fP. Definition at line 769 of file kfileitem.cpp.
.PP
Referenced by KFileMetaPropsPlugin::KFileMetaPropsPlugin().
.SS "const  \fBKFileMetaInfo\fP & KFileItem::metaInfo (bool autoget = true, int what = KFileMetaInfo::Fastest) const"
.PP
Returns the metainfo of this item. If \fCautoget\fP is true, it will automatically be created Definition at line 774 of file kfileitem.cpp.
.PP
References KURL::isLocalFile(), KFileMetaInfo::isValid(), mimetype(), and KURL::path().
.PP
Referenced by getToolTipText(), and KFileMetaPropsPlugin::KFileMetaPropsPlugin().
.SS "void KFileItem::assign (const \fBKFileItem\fP & item)"
.PP
Somewhat like an assignment operator, but more explicit. Note: extra-data set with \fBsetExtraData\fP() is not copied, so be careful what you do!
.PP
I.e. \fBKDirLister\fP uses it to update existing items from a fresh item. Definition at line 663 of file kfileitem.cpp.
.PP
References determineMimeType(), m_access, m_bIsLocalURL, m_bLink, m_bMimeTypeKnown, m_entry, m_fileMode, m_group, m_guessedMimeType, m_metaInfo, m_permissions, m_pMimeType, m_size, m_strLowerCaseName, m_strName, m_strText, m_time, m_url, and m_user.
.PP
Referenced by KFileItem().
.SS "void KFileItem::init (bool _determineMimeTypeOnDemand)\fC [protected]\fP"
.PP
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.
.PP
References KMimeType::defaultMimeType(), QFile::encodeName(), KMimeType::findByURL(), KURL::isLocalFile(), mode(), and KURL::path().
.PP
Referenced by KFileItem(), refresh(), and refreshMimeType().
.SS "\fBQString\fP KFileItem::parsePermissions (mode_t perm) const\fC [protected]\fP"
.PP
Parses the given permission set and provides it for \fBaccess\fP(). Definition at line 728 of file kfileitem.cpp.
.PP
References QString::fromLatin1(), isDir(), and isLink().
.PP
Referenced by getToolTipText(), and permissionsString().

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