class KFileItem |
|
|
A KFileItem is a generic class to handle a file, local or remote. In particular, it makes it easier to handle the result of KIO.listDir (UDSEntry isn't very friendly to use). It includes many file attributes such as mimetype, icon, text, mode, link... KFileItem is implicitly shared, i.e. it can be used as a value and copied around at almost no cost. |
|
|
|
Tells if the file has extended access level information ( Posix ACL ) Returns true if the file has extend ACL information or false if it hasn't |
|
Null KFileItem. Doesn't represent any file, only exists for convenience. NOTE KDE 4.0 KFileItem* => KFileItem& conversion: '(KFileItem*)a==0' maps to '(KFileItem)a==KFileItem()' |
|
Creates an item representing a file, from a UDSEntry. This is the preferred constructor when using KIO.listDir().
entry - the KIO entry used to get the file, contains info about it url - the file url delayedMimeTypes - specifies if the mimetype of the given URL should be determined immediately or on demand. See the bool delayedMimeTypes in the KDirLister constructor. urlIsDirectory - specifies if the url is just the directory of the fileitem and the filename from the UDSEntry should be used. |
|
Creates an item representing a file, from all the necessary info for it. mode - the file mode (according to stat() (e.g. S_IFDIR...) Set to KFileItem.Unknown if unknown. For local files, KFileItem will use stat(). permissions - 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. url - the file url
delayedMimeTypes - specify if the mimetype of the given URL should be determined immediately or on demand |
|
Creates an item representing a file, for which the mimetype is already known. url - the file url mimeType - the name of the file's mimetype mode - the mode (S_IFDIR...) |
|
Copy constructor |
|
|
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. Returns true if you can drop files over the item Deprecated This logic is application-dependent, the behavior described above mostly makes sense for file managers only. KDirModel has setDropsAllowed for similar (but configurable) logic. |
|
Deprecated simply use '=' |
|
Somewhat like a comparison operator, but more explicit, and it can detect that two kfileitems are equal even when they do not share the same internal pointer - e.g. when KDirLister compares fileitems after listing a directory again, to detect changes. item - the item to compare Returns true if all values are equal |
|
Returns the default access control list for the directory. Returns the default access control list as a KACL |
|
Returns the mimetype of the file item. If delayedMimeTypes was used in the constructor, this will determine the mimetype first. Returns the mime type |
|
Returns the UDS entry. Used by the tree view to access all details by position. Returns the UDS entry |
|
Retrieves the extra data with the given key. key - the key of the extra data Returns the extra data associated to an item with key via setExtraData. 0L if nothing was associated with key. See also extraData Deprecated use model/view (KDirModel) and you won't need this anymore |
|
Returns the string to be displayed in the statusbar, e.g. when the mouse is over this item Returns the status bar information |
|
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.
maxcount - the maximum number of entries shown Returns the tool tip string |
|
Returns the group of the file. Returns the file's group |
|
Tells if the file has extended access level information ( Posix ACL ) Returns true if the file has extend ACL information or false if it hasn't |
|
Returns the full path name to the icon that represents this mime type. Returns iconName the name of the file's icon |
|
Returns true if this item represents a directory. Returns true if the item is a directory |
|
Returns true if this item represents a file (and not a a directory) Returns true if the item is a file |
|
Checks whether the file is hidden. Returns true if the file is hidden. |
|
Returns true if this item represents a link in the UNIX sense of a link. Returns true if the file is a link |
|
Returns true if the file is a local file. Returns true if the file is local, false otherwise |
|
Used when updating a directory. marked == seen when refreshing. Returns true if the file item is marked |
|
Returns true if we have determined the mimetype of this file already, i.e. if determineMimeType() will be fast. Otherwise it will have to find what the mimetype is, which is a possibly slow operation; usually this is delayed until necessary. |
|
Return true if default-constructed |
|
Checks whether the file or directory is readable. In some cases (remote files), we may return true even though it can't be read. Returns true if the file can be read - more precisely, false if we know for sure it can't |
|
Checks whether the file or directory is writable. In some cases (remote files), we may return true even though it can't be written to. Returns true if the file or directory can be written to - more precisely, false if we know for sure it can't |
|
Returns the link destination if isLink() == true. Returns the link destination. QString() if the item is not a link |
|
Returns the local path if isLocalFile() == true or the KIO item has a UDS_LOCAL_PATH atom. Returns the item local path, or QString() if not known |
|
Marks the item. See also isMarked() |
|
Returns the metainfo of this item. autoget - if true, the metainfo will automatically be created what - ignored |
|
Returns the descriptive comment for this mime type, or the mime type itself if none is present. Returns the mime type description, or the mime type itself |
|
Returns the currently known mimetype of the file item. This will not try to determine the mimetype if unknown. Returns the known mime type |
|
Returns the mimetype of the file item. If delayedMimeTypes was used in the constructor, this will determine the mimetype first. Equivalent to determineMimeType()->name() Returns the mime type of the file |
|
Returns the file type (stat.st_mode containing only S_IFDIR, S_IFLNK, ...). Returns the file type |
|
Tries to give a local URL for this file item if possible. The given boolean indicates if the returned url is local or not. |
|
Return the name of the file item (without a path). Similar to text(), but unencoded, i.e. the original name. lowerCase - if true, the name will be returned in lower case, which is useful to speed up sorting by name, case insensitively. Returns the file's name |
|
Returns the overlays (bitfield of K3Icon.*Overlay flags) that are used for this item's pixmap. Overlays are used to show for example, whether a file can be modified. Returns the overlays of the pixmap |
|
Returns the permissions of the file (stat.st_mode containing only permissions). Returns the permissions of the file |
|
Returns the access permissions for the file as a string. Returns the access persmission as string |
|
Returns a pixmap representing the file. _size - Size for the pixmap in pixels. Zero will return the globally configured default size. _state - The state of the icon: K3Icon.DefaultState, K3Icon.ActiveState or K3Icon.DisabledState. Returns the pixmap |
|
Throw away and re-read (for local files) all information about the file. 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 key. key - the key of the extra data to remove Deprecated use model/view (KDirModel) and you won't need this anymore |
|
Let's "KRun" this file ! (e.g. when file is clicked or double-clicked or return is pressed) |
|
|
Sets the metainfo of this item to info. Made const to avoid deep copy. info - the new meta info |
|
Sets the item's name (i.e. the filename). This is automatically done by setUrl, to set the name from the URL's fileName(). This method is provided for some special cases like relative paths as names (KFindPart) name - the item's name |
|
Reinitialize KFileItem with a new UDSEntry. Note: extra-data set with setExtraData() is not changed or deleted, so be careful what you do! KDirListerCache uses it to save new/delete calls by updating existing items that are otherwise not needed anymore.
entry - the UDSEntry to assign to this KFileItem url - the file url delayedMimeTypes - specifies if the mimetype of the given URL should be determined immediately or on demand urlIsDirectory - specifies if the url is just the directory of the fileitem and the filename from the UDSEntry should be used. Deprecated why not just create another KFileItem and use operator=, now that it's a value class? |
|
Sets the item's URL. Do not call unless you know what you are doing! (used for example when an item got renamed). url - the item's URL |
|
Returns the size of the file, if known. Returns the file size, or 0 if not known |
|
Returns the text of the file item. It's not exactly the filename since some decoding happens ('%2F'->'/'). Returns the text of the file item |
|
Requests the modification, access or creation time, depending on which. which - the timestamp Returns the time asked for, (time_t)0 if not available See also timeString() |
|
|
Requests the modification, access or creation time as a string, depending on which. which - the timestamp Returns a formatted string of the requested time. See also time |
|
|
Unmarks the item. See also isMarked() |
|
Returns the url of the file. Returns the url of the file |
|
Returns the owner of the file. Returns the file's owner |
Unknown | - |
ModificationTime | - | ||
AccessTime | - | ||
CreationTime | - |