class KFileItem


Definition#include <kfileitem.h>
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Methods

Protected Methods

Protected Members

 KFileItem ( const KIO::UDSEntry& _entry, const KURL& _url, bool _determineMimeTypeOnDemand = false )

Create an item representing a file, from an UDSEntry (see kio/global.h) This is the preferred constructor when using KIO::listDir().

Parameters:
_entrythe KIO entry used to get the file, contains info about it
_urlthe file url
_determineMimeTypeOnDemandspecify if the mimetype of the given URL should be determined immediately or on demand

 KFileItem ( mode_t _mode, mode_t _permissions, const KURL& _url, bool _determineMimeTypeOnDemand = false )

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

Parameters:
_modethe file mode (according to stat()) Set to -1 if unknown. For local files, KFileItem will use stat().
_modethe mode (S_IFDIR...)
_permissionsthe access permissions If you set both the mode and the permissions, you save a ::stat() for local files Set to -1 if you don't know the mode or the permission.
_urlthe file url
_determineMimeTypeOnDemandspecify if the mimetype of the given URL should be determined immediately or on demand

 KFileItem ( const KURL &url, const QString &mimeType, mode_t mode )

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

Parameters:
urlthe file url
mimeTypethe name of the file's mimetype
modethe mode (S_IFDIR...)

KFileItem ()

[virtual]

Destructor

void  refresh ()

Re-read information (currently only permissions and mimetype) This is called when the _file_ changes

void  refreshMimeType ()

Re-read mimetype information This is called when the mimetype database changes

const KURL &  url ()

[const]

Returns: the url of the file

mode_t  permissions ()

[const]

Returns: the permissions of the file (stat.st_mode containing only permissions)

mode_t  mode ()

[const]

Returns: the file type (stat.st_mode containing only S_IFDIR, S_IFLNK, ...)

QString  user ()

[const]

Returns: the owner of the file.

QString  group ()

[const]

Returns: the group of the file.

bool  isLink ()

[const]

Returns: true if this item represents a link in the UNIX sense of a link. If yes, then we have to draw the label with an italic font.

bool  isDir ()

[const]

Returns: true if this item represents a directory

QString  linkDest ()

[const]

Returns: the link destination if isLink() == true

long  size ()

[const]

Returns: the size of the file, if known

time_t  time ( unsigned int which )

[const]

Parameters:
whichUDS_MODIFICATION_TIME, UDS_ACCESS_TIME or even UDS_CREATION_TIME

Returns: the time asked for

bool  isLocalFile ()

[const]

Returns: true if the file is a local file

QString  text ()

[const]

Returns: the text of the file item It's not exactly the filename since some decoding happens ('%2F'->'/')

QString  mimetype ()

[const]

Returns: the mimetype of the file item

KMimeType::Ptr  determineMimeType ()

Returns: the mimetype of the file item If determineMimeTypeOnDemand was used, this will determine the mimetype first.

KMimeType::Ptr  mimeTypePtr ()

Returns: the currently-known mmietype of the file item This will not try to determine the mimetype if unknown.

QString  mimeComment ()

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

QString  iconName ()

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

QPixmap  pixmap ( int _size )

[const]

Returns a pixmap representing the file

Parameters:
sizeKDE-size for the pixmap

Returns: the pixmap

QString  getStatusBarInfo ()

Returns: the string to be displayed in the statusbar e.g. when the mouse is over this item

bool  acceptsDrops ( )

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.

void  run ()

Let's "KRun" this file ! (e.g. when file is clicked or double-clicked or return is pressed)

const KIO::UDSEntry &  entry ()

[const]

Returns: the UDS entry. Used by the tree view to access all details by position.

void  init ( bool _determineMimeTypeOnDemand )

[protected]

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

KIO::UDSEntry m_entry

[protected]

We keep a copy of the UDSEntry since we need it for getStatusBarInfo

KURL m_url

[protected]

The url of the file

bool m_bIsLocalURL

[protected]

True if local file

QString m_strText

[protected]

The text for this item, i.e. the file name without path

mode_t m_fileMode

[protected]

The file mode

mode_t m_permissions

[protected]

The permissions

QString m_user

[protected]

the user and group assigned to the file.

QString m_group

[protected]

the user and group assigned to the file.

bool m_bLink

[protected]

Whether the file is a link

KMimeType::Ptr m_pMimeType

[protected]

The mimetype of the file


Generated by: root@porky.devel.redhat.com on Wed May 10 08:56:52 2000, using kdoc 2.0a35.