org.kde.koala
public class KFileItem extends Object implements QtSupport
UNKNOWN: A KFileItem is a generic class to handle a file, local or remote.
Field Summary | |
---|---|
static int | Access |
static int | Creation |
static int | Modification |
static int | NumFlags |
static int | Unknown |
Constructor Summary | |
---|---|
protected | KFileItem(Class dummy) |
KFileItem(long _mode, long _permissions, KURL _url, boolean _determineMimeTypeOnDemand)
Creates an item representing a file, from all the necessary info for it. | |
KFileItem(long _mode, long _permissions, KURL _url) | |
KFileItem(KURL url, String mimeType, long mode)
Creates an item representing a file, for which the mimetype is already known. | |
KFileItem(KFileItem item)
Copy constructor. |
Method Summary | |
---|---|
boolean | acceptsDrops()
Returns true if files can be dropped over this item.
|
void | assign(KFileItem item)
Somewhat like an assignment operator, but more explicit.
|
boolean | cmp(KFileItem item)
Somewhat like a comparison operator, but more explicit. |
void | dispose() Delete the wrapped C++ instance ahead of finalize() |
protected void | finalize() Deletes the wrapped C++ instance |
String | getStatusBarInfo()
Returns the string to be displayed in the statusbar,
e.g. when the mouse is over this item |
String | getToolTipText(int maxcount)
Returns the string to be displayed in the tool tip when the mouse
is over this item. |
String | getToolTipText() |
String | group()
Returns the group of the file. |
boolean | hasExtendedACL()
Tells if the file has extended access level information ( Posix ACL ) |
String | iconName()
Returns the full path name to the icon that represents
this mime type. |
protected void | init(boolean _determineMimeTypeOnDemand)
Computes the text, mode, and mimetype from the UDSEntry
Called by constructor, but can be called again later |
boolean | isDir()
Returns true if this item represents a directory. |
boolean | isDisposed() Has the wrapped C++ instance been deleted? |
boolean | isFile()
Returns true if this item represents a file (and not a a directory) |
boolean | isHidden()
Checks whether the file is hidden. |
boolean | isLink()
Returns true if this item represents a link in the UNIX sense of
a link. |
boolean | isLocalFile()
Returns true if the file is a local file. |
boolean | isMarked()
Used when updating a directory. marked == seen when refreshing. |
boolean | isMimeTypeKnown()
Returns the currently known mimetype of the file item.
|
boolean | isReadable()
Checks whether the file or directory is readable. |
boolean | isWritable()
Checks whether the file or directory is writable. |
String | linkDest()
Returns the link destination if isLink() == true. |
String | localPath()
Returns the local path if isLocalFile() == true or the KIO item has
a UDS_LOCAL_PATH atom. |
void | mark()
Marks the item. |
KFileMetaInfo | metaInfo(boolean autoget, int what)
Returns the metainfo of this item. |
KFileMetaInfo | metaInfo(boolean autoget) |
KFileMetaInfo | metaInfo() |
String | mimeComment()
Returns the descriptive comment for this mime type, or
the mime type itself if none is present. |
String | mimetype()
Returns the mimetype of the file item.
|
long | mode()
Returns the file type (stat.st_mode containing only S_IFDIR, S_IFLNK, ...). |
KURL | mostLocalURL(boolean local)
Tries to give a local URL for this file item if possible.
|
String | name(boolean lowerCase)
Return the name of the file item (without a path).
|
String | name() |
int | overlays()
Returns the overlays (bitfield of KIcon.Overlay flags) that are used
for this item's pixmap. |
protected String | parsePermissions(long perm)
Parses the given permission set and provides it for access() |
long | permissions()
Returns the permissions of the file (stat.st_mode containing only permissions). |
String | permissionsString()
Returns the access permissions for the file as a string. |
QPixmap | pixmap(int _size, int _state)
Returns a pixmap representing the file. |
QPixmap | pixmap(int _size) |
protected void | readUDSEntry(boolean _urlIsDirectory)
Extracts the data from the UDSEntry member and updates the KFileItem
accordingly. |
void | refresh()
Throw away and re-read (for local files) all information about the file.
|
void | refreshMimeType()
Re-reads mimetype information.
|
void | run()
Let's "KRun" this file !
|
void | setFileMode(long m)
Sets the file type (stat.st_mode containing only S_IFDIR, S_IFLNK, ...). |
void | setMetaInfo(KFileMetaInfo info)
Sets the metainfo of this item to info. |
void | setMimeType(String mimetype)
Sets new mimetype for item |
void | setName(String name)
Sets the item's name (i.e. the filename).
|
void | setURL(KURL url)
Sets the item's URL. |
long | size()
Returns the size of the file, if known. |
long | size(boolean hasSize)
Returns the size of the file, if known, and sets hasSize to false if not known |
String | text()
Returns the text of the file item.
|
int | time(int which)
Requests the modification, access or creation time, depending on which. |
int | time(int which, boolean hasTime)
Requests the modification, access or creation time, depending on which. |
String | timeString(int which)
Requests the modification, access or creation time as a string, depending
on which. |
String | timeString() |
void | unmark()
Unmarks the item. |
KURL | url()
Returns the url of the file. |
String | user()
Returns the owner of the file. |
Parameters: _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 _determineMimeTypeOnDemand specify if the mimetype of the given URL should be determined immediately or on demand
UNKNOWN: Creates an item representing a file, from all the necessary info for it.
Parameters: url the file url mimeType the name of the file's mimetype mode the mode (S_IFDIR...)
UNKNOWN: Creates an item representing a file, for which the mimetype is already known.
UNKNOWN: Copy constructor.
Returns: true if you can drop files over the item
UNKNOWN: Returns true if files can be dropped over this item.
Parameters: item the item to copy
UNKNOWN: Somewhat like an assignment operator, but more explicit.
Parameters: item the item to compare
Returns: true if all values are equal
UNKNOWN: Somewhat like a comparison operator, but more explicit.
Returns: the status bar information
UNKNOWN: Returns the string to be displayed in the statusbar, e.
Parameters: maxcount the maximum number of entries shown
Returns: the tool tip string
UNKNOWN: Returns the string to be displayed in the tool tip when the mouse is over this item.
Returns: the file's group
UNKNOWN: Returns the group of the file.
Returns: true if the file has extend ACL information or false if it hasn't
UNKNOWN: Tells if the file has extended access level information ( Posix ACL )
Returns: iconName the name of the file's icon
UNKNOWN: Returns the full path name to the icon that represents this mime type.
UNKNOWN: Computes the text, mode, and mimetype from the UDSEntry Called by constructor, but can be called again later
Returns: true if the item is a directory
UNKNOWN: Returns true if this item represents a directory.
Returns: true if the item is a file
UNKNOWN: Returns true if this item represents a file (and not a a directory)
Returns: true if the file is hidden.
UNKNOWN: Checks whether the file is hidden.
Returns: true if the file is a link
UNKNOWN: Returns true if this item represents a link in the UNIX sense of a link.
Returns: true if the file is local, false otherwise
UNKNOWN: Returns true if the file is a local file.
Returns: true if the file item is marked
UNKNOWN: Used when updating a directory.
Returns: the known mime type
UNKNOWN: Returns the currently known mimetype of the file item.
Returns: true if the file can be read - more precisely, false if we know for sure it can't
UNKNOWN: Checks whether the file or directory is readable.
Returns: true if the file or directory can be written to - more precisely, false if we know for sure it can't
UNKNOWN: Checks whether the file or directory is writable.
Returns: the link destination. null if the item is not a link
UNKNOWN: Returns the link destination if isLink() == true.
Returns: the item local path, or null if not known
UNKNOWN: Returns the local path if isLocalFile() == true or the KIO item has a UDS_LOCAL_PATH atom.
See Also: KFileItem
UNKNOWN: Marks the item.
Parameters: autoget if true, the metainfo will automatically be created what ignored
UNKNOWN: Returns the metainfo of this item.
Returns: the mime type description, or the mime type itself
UNKNOWN: Returns the descriptive comment for this mime type, or the mime type itself if none is present.
_determineMimeTypeOnDemand
was used in the constructor, this will determine
the mimetype first. Equivalent to determineMimeType().name()Returns: the mime type of the file
UNKNOWN: Returns the mimetype of the file item.
Returns: the file type
UNKNOWN: Returns the file type (stat.
UNKNOWN: Tries to give a local URL for this file item if possible.
Parameters: 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
UNKNOWN: Return the name of the file item (without a path).
Returns: the overlays of the pixmap
UNKNOWN: Returns the overlays (bitfield of KIcon. Overlay flags) that are used for this item's pixmap.
UNKNOWN: Parses the given permission set and provides it for access()
Returns: the permissions of the file
UNKNOWN: Returns the permissions of the file (stat.
Returns: the access persmission as string
UNKNOWN: Returns the access permissions for the file as a string.
Parameters: _size Size for the pixmap in pixels. Zero will return the globally configured default size. _state The state of the icon: KIcon.DefaultState, KIcon.ActiveState or KIcon.DisabledState.
Returns: the pixmap
UNKNOWN: Returns a pixmap representing the file.
UNKNOWN: Extracts the data from the UDSEntry member and updates the KFileItem accordingly.
UNKNOWN: Throw away and re-read (for local files) all information about the file.
UNKNOWN: Re-reads mimetype information.
UNKNOWN: Let's "KRun" this file ! (e.
Parameters: m the new file type
UNKNOWN: Sets the file type (stat.
info.
Parameters: info the new meta info
UNKNOWN: Sets the metainfo of this item to info.
Parameters: mimetype the new mimetype
UNKNOWN: Sets new mimetype for item
Parameters: name the item's name
UNKNOWN: Sets the item's name (i.
Parameters: url the item's URL
UNKNOWN: Sets the item's URL.
Returns: the file size, or 0 if not known
UNKNOWN: Returns the size of the file, if known.
hasSize
to false if not knownParameters: @hasSize This is set to true if the size is known, and false if not known
Returns: the file size, or 0 if not known
UNKNOWN: Returns the size of the file, if known, and sets hasSize
to false if not known @param @hasSize This is set to true if the size is known, and false if not known
Returns: the text of the file item
UNKNOWN: Returns the text of the file item.
which.
Parameters: which UDS_MODIFICATION_TIME, UDS_ACCESS_TIME or UDS_CREATION_TIME
Returns: the time asked for, (time_t)0 if not available
See Also: KFileItem
UNKNOWN: Requests the modification, access or creation time, depending on which.
which.
Parameters: which UDS_MODIFICATION_TIME, UDS_ACCESS_TIME or UDS_CREATION_TIME hasTime This is set to true is the time is known, and false if not known
Returns: the time asked for, (time_t)0 if not known/available
See Also: KFileItem
UNKNOWN: Requests the modification, access or creation time, depending on which.
which.
Parameters: which UDS_MODIFICATION_TIME, UDS_ACCESS_TIME or UDS_CREATION_TIME
Returns: a formatted string of the requested time, null if time is not known
See Also: KFileItem
UNKNOWN: Requests the modification, access or creation time as a string, depending on which.
See Also: KFileItem
UNKNOWN: Unmarks the item.
Returns: the url of the file
UNKNOWN: Returns the url of the file.
Returns: the file's owner
UNKNOWN: Returns the owner of the file.