#include <kfileitem.h>
Public Methods | |
| KFileItem (const KIO::UDSEntry &_entry, const KURL &_url, bool _determineMimeTypeOnDemand=false, bool _urlIsDirectory=false) | |
| KFileItem (mode_t _mode, mode_t _permissions, const KURL &_url, bool _determineMimeTypeOnDemand=false) | |
| KFileItem (const KURL &url, const QString &mimeType, mode_t mode) | |
| KFileItem (const KFileItem &item) | |
| virtual | ~KFileItem () |
| void | refresh () |
| void | refreshMimeType () |
| const KURL & | url () const |
| void | setURL (const KURL &url) |
| mode_t | permissions () const |
| QString | permissionsString () const |
| mode_t | mode () const |
| QString | user () const |
| QString | group () const |
| bool | isLink () const |
| bool | isDir () const |
| bool | isFile () const |
| bool | isReadable () const |
| QString | linkDest () const |
| KIO::filesize_t | size () const |
| time_t | time (unsigned int which) const |
| QString | timeString (unsigned int which=KIO::UDS_MODIFICATION_TIME) const |
| bool | isLocalFile () const |
| const QString & | text () const |
| const QString & | name (bool lowerCase=false) const |
| QString | mimetype () const |
| KMimeType::Ptr | determineMimeType () |
| KMimeType::Ptr | mimeTypePtr () const |
| QString | mimeComment () |
| QString | iconName () |
| QPixmap | pixmap (int _size, int _state=0) const |
| int | overlays () const |
| QString | getStatusBarInfo () |
| QString | getToolTipText (int maxcount=6) |
| bool | acceptsDrops () |
| void | run () |
| const KIO::UDSEntry & | entry () const |
| bool | cmp (const KFileItem &item) |
| virtual void | setExtraData (const void *key, void *value) |
| virtual const void * | extraData (const void *key) const |
| virtual void * | extraData (const void *key) |
| virtual void | removeExtraData (const void *key) |
| void | setMetaInfo (const KFileMetaInfo &info) |
| const KFileMetaInfo & | metaInfo (bool autoget=true, int what=KFileMetaInfo::Fastest) const |
| void | assign (const KFileItem &item) |
Protected Methods | |
| void | init (bool _determineMimeTypeOnDemand) |
| QString | parsePermissions (mode_t perm) const |
Definition at line 40 of file kfileitem.h.
|
||||||||||||||||||||
|
Creates an item representing a file, from a UDSEntry. This is the preferred constructor when using KIO::listDir().
|
|
||||||||||||||||||||
|
Creates an item representing a file, from all the necessary info for it.
|
|
||||||||||||||||
|
Creates an item representing a file, for which the mimetype is already known.
|
|
|
Copy constructor. Note that extra-data set via setExtraData() is not deeply copied -- just the pointers are copied. |
|
|
Destructs the KFileItem. Extra data set via setExtraData() is not deleted. |
|
|
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. |
|
|
Somewhat like an assignment operator, but more explicit. Note: extra-data set with setExtraData() is not copied, so be careful what you do! I.e. KDirLister uses it to update existing items from a fresh item. |
|
|
Somewhat like a comparison operator, but more explicit |
|
|
Returns the mimetype of the file item. If determineMimeTypeOnDemand was used, this will determine the mimetype first. |
|
|
Returns the UDS entry. Used by the tree view to access all details by position. Definition at line 298 of file kfileitem.h. |
|
|
The non-const version of the previous |
|
|
|
|
|
Returns the string to be displayed in the statusbar, e.g. when the mouse is over this item |
|
|
|
|
|
Returns the group of the file. |
|
|
Returns the full path name to the icon that represents this mime type. |
|
|
Computes the text, mode, and mimetype from the UDSEntry Called by constructor, but can be called again later |
|
|
Returns true if this item represents a directory. Referenced by KFileViewSignaler::activate(), and isFile(). |
|
|
Returns true if this item represents a file (and not a a directory) Definition at line 158 of file kfileitem.h. References isDir(). |
|
|
Returns true if this item represents a link in the UNIX sense of a link. Definition at line 148 of file kfileitem.h. |
|
|
Returns true if the file is a local file. Definition at line 195 of file kfileitem.h. |
|
|
|
|
|
Returns the link destination if isLink() == true. |
|
||||||||||||
|
Returns the metainfo of this item. If |
|
|
Returns the descriptive comment for this mime type, or the mime type itself if none is present. |
|
|
Returns the mimetype of the file item. If determineMimeTypeOnDemand was used, this will determine the mimetype first. Equivalent to determineMimeType()->name() |
|
|
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. |
|
|
Returns the file type (stat.st_mode containing only S_IFDIR, S_IFLNK, ...). Definition at line 132 of file kfileitem.h. |
|
|
Definition at line 209 of file kfileitem.h. |
|
|
Returns the overlays (bitfield of KIcon::*Overlay flags) that are used for this item's pixmap. |
|
|
Parses the given permission set and provides it for access() |
|
|
Returns the permissions of the file (stat.st_mode containing only permissions). Definition at line 122 of file kfileitem.h. |
|
|
Returns the access permissions for the file as a string. |
|
||||||||||||
|
Returns a pixmap representing the file.
|
|
|
Re-reads information (currently only permissions and mimetype). This is called when the _file_ changes. |
|
|
Re-reads mimetype information. This is called when the mimetype database changes. |
|
|
Removes the extra data associated with an item via |
|
|
Let's "KRun" this file ! (e.g. when file is clicked or double-clicked or return is pressed) |
|
||||||||||||
|
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. That way a KFileItem can hold and provide access to all those views separately. I.e. a KFileIconView that associates a KFileIconViewItem (an item suitable for use with QIconView) does
kfileItem->setExtraData( this, iconViewItem ); and can later access the iconViewItem by doing
KFileIconViewItem *iconViewItem = static_cast<KFileIconViewItem*>( kfileItem->extraData( this )); This is usually more efficient then having every view associate data to items by using a separate QDict or QMap. Note: you have to remove and destroy the data you associated yourself when you don't need it anymore!
|
|
|
Sets the metainfo of this item to |
|
|
Sets the item's URL. Do not call unless you know what you are doing! (used for example when an item got renamed). |
|
|
Returns the size of the file, if known. |
|
|
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. |
|
|
|
|
|
|
|
|
Returns the url of the file. Definition at line 111 of file kfileitem.h. |
|
|
Returns the owner of the file. |
1.2.18