tdefileitem.cpp
86 KFileItem::KFileItem( mode_t _mode, mode_t _permissions, const KURL& _url, bool _determineMimeTypeOnDemand ) :
520 if ( KDE_lstat( TQFile::encodeName(m_url.path( -1 )), &buff ) == 0) // get uid/gid of the link, if it's a link
536 if ( KDE_lstat( TQFile::encodeName(m_url.path( -1 )), &buff ) == 0) // get uid/gid of the link, if it's a link
703 if ( mime->name() == "application/x-executable" || mime->name() == "application/x-pie-executable" ) {
766 p.loadFromData(static_cast<uchar*>(static_cast<void*>(icondata)), icon_data_length); // EVIL CAST
930 text.replace('\n', " "); // replace any newlines with a space, so the statusbar doesn't get a two-line string which messes the display up, Alex
979 tip += "<tr><td colspan=2><center><s> </s></center></td></tr>";
1038 && time(TDEIO::UDS_MODIFICATION_TIME, hasTime1) == item.time(TDEIO::UDS_MODIFICATION_TIME, hasTime2)
void setUDSEntry(const TDEIO::UDSEntry &entry, const KURL &url, bool determineMimeTypeOnDemand=false, bool urlIsDirectory=false)
Reinitialize KFileItem with a new UDSEntry.
Definition: tdefileitem.cpp:1090
void refresh()
Throw away and re-read (for local files) all information about the file.
Definition: tdefileitem.cpp:285
KMimeType::Ptr determineMimeType()
Returns the mimetype of the file item.
Definition: tdefileitem.cpp:572
@ SqueezeText
If the text for this item is very long, it should be squeezed to the size of the widget where it's di...
Definition: tdefilemetainfo.h:79
void init(bool _determineMimeTypeOnDemand)
Computes the text, mode, and mimetype from the UDSEntry Called by constructor, but can be called agai...
Definition: tdefileitem.cpp:142
virtual const void * extraData(const void *key) const
Retrieves the extra data with the given key.
Definition: tdefileitem.cpp:1139
time_t time(unsigned int which) const
Requests the modification, access or creation time, depending on which.
Definition: tdefileitem.cpp:456
KFileItem & operator=(const KFileItem &)
Assignment operator, calls assign()
Definition: tdefileitem.cpp:131
TQPixmap pixmap(int _size, int _state=0) const
Returns a pixmap representing the file.
Definition: tdefileitem.cpp:660
void setMetaInfo(const KFileMetaInfo &info)
Sets the metainfo of this item to info.
Definition: tdefileitem.cpp:1219
TQValueList< UDSAtom > UDSEntry
An entry is the list of atoms containing all the information for a file or URL.
Definition: global.h:507
static Ptr findByURL(const KURL &_url, mode_t _mode=0, bool _is_local_file=false, bool _fast_mode=false)
Finds a KMimeType with the given _url.
Definition: kmimetype.cpp:165
KFileMetaInfoItem item(const TQString &key) const
Returns the KFileMetaInfoItem with the given key.
Definition: tdefilemetainfo.cpp:614
void assign(const KFileItem &item)
Somewhat like an assignment operator, but more explicit.
Definition: tdefileitem.cpp:1047
@ UDS_DEFAULT_ACL_STRING
The default access control list serialized into a single string.
Definition: global.h:351
TQString string(bool mangle=true) const
Returns a string containing the value, if possible.
Definition: tdefilemetainfo.cpp:187
bool hasExtendedACL() const
Tells if the file has extended access level information ( Posix ACL )
Definition: tdefileitem.cpp:412
TQString mimeComment()
Returns the descriptive comment for this mime type, or the mime type itself if none is present.
Definition: tdefileitem.cpp:595
@ UDS_FILE_TYPE
File type, part of the mode returned by stat (for a link, this returns the file type of the pointed i...
Definition: global.h:366
TQString parsePermissions(mode_t perm) const
Parses the given permission set and provides it for access()
Definition: tdefileitem.cpp:1168
TDEIO_EXPORT TQString convertSize(TDEIO::filesize_t size)
Converts size from bytes to the string representation.
Definition: global.cpp:53
virtual void setExtraData(const void *key, void *value)
This allows to associate some "extra" data to a KFileItem.
Definition: tdefileitem.cpp:1131
bool isReadable() const
Checks whether the file or directory is readable.
Definition: tdefileitem.cpp:783
TQString getStatusBarInfo()
Returns the string to be displayed in the statusbar, e.g.
Definition: tdefileitem.cpp:889
bool isLink() const
Returns true if this item represents a link in the UNIX sense of a link.
Definition: tdefileitem.h:200
bool isWritable() const
Checks whether the file or directory is writable.
Definition: tdefileitem.cpp:810
const KFileMetaInfo & metaInfo(bool autoget=true, int what=KFileMetaInfo::Fastest) const
Returns the metainfo of this item.
Definition: tdefileitem.cpp:1224
TDEIO_EXPORT TQString decodeFileName(const TQString &str)
Decodes (from the filename to the text displayed) This translates %2[fF] into /, %% into %,...
Definition: global.cpp:191
KURL mostLocalURL(bool &local) const
Tries to give a local URL for this file item if possible.
Definition: tdefileitem.cpp:1238
TQString getToolTipText(int maxcount=6)
Returns the string to be displayed in the tool tip when the mouse is over this item.
Definition: tdefileitem.cpp:934
TQString linkDest() const
Returns the link destination if isLink() == true.
Definition: tdefileitem.cpp:332
static Ptr mimeType(const TQString &_name)
Retrieve a pointer to the mime type _name or a pointer to the default mime type "application/octet-st...
Definition: kmimetype.cpp:141
KMimeType::Ptr mimeTypePtrFast()
Returns the mimetype of the file item.
Definition: tdefileitem.cpp:567
bool isEmpty() const
Returns false if the object contains data, true if it's empty.
Definition: tdefilemetainfo.cpp:523
TQStringList preferredKeys() const
Returns a list of all preferred keys.
Definition: tdefilemetainfo.cpp:428
TDEIO::filesize_t size() const
Returns the size of the file, if known.
Definition: tdefileitem.cpp:450
@ UDS_LOCAL_PATH
A local file path if the ioslave display files sitting on the local filesystem (but in another hierar...
Definition: global.h:338
@ UDS_HIDDEN
Treat the file as a hidden file or as a normal file, regardless of (the absence of) a leading dot in ...
Definition: global.h:341
TQString timeString(unsigned int which=TDEIO::UDS_MODIFICATION_TIME) const
Requests the modification, access or creation time as a string, depending on which.
Definition: tdefileitem.cpp:1208
void readUDSEntry(bool _urlIsDirectory)
Extracts the data from the UDSEntry member and updates the KFileItem accordingly.
Definition: tdefileitem.cpp:209
KACL defaultACL() const
Returns the default access control list for the directory.
Definition: tdefileitem.cpp:438
void setFileMode(mode_t m)
Sets the file type (stat.st_mode containing only S_IFDIR, S_IFLNK, ...).
Definition: tdefileitem.cpp:1121
void setMimeType(const TQString &mimetype)
Sets new mimetype for item.
Definition: tdefileitem.cpp:1126
TQString translatedKey() const
Returns a translation of the key for displaying to the user.
Definition: tdefilemetainfo.cpp:170
mode_t mode() const
Returns the file type (stat.st_mode containing only S_IFDIR, S_IFLNK, ...).
Definition: tdefileitem.h:181
TQString permissionsString() const
Returns the access permissions for the file as a string.
Definition: tdefileitem.cpp:1160
TQString iconName()
Returns the full path name to the icon that represents this mime type.
Definition: tdefileitem.cpp:621
KFileItem(const TDEIO::UDSEntry &_entry, const KURL &_url, bool _determineMimeTypeOnDemand=false, bool _urlIsDirectory=false)
Creates an item representing a file, from a UDSEntry.
Definition: tdefileitem.cpp:68
virtual void removeExtraData(const void *key)
Removes the extra data associated with an item via key.
Definition: tdefileitem.cpp:1155
TQString localPath() const
Returns the local path if isLocalFile() == true or the TDEIO item has a UDS_LOCAL_PATH atom.
Definition: tdefileitem.cpp:355
@ UDS_LINK_DEST
Name of the file where the link points to Allows to check for a symlink (don't use S_ISLNK !...
Definition: global.h:369
bool cmp(const KFileItem &item)
Somewhat like a comparison operator, but more explicit.
Definition: tdefileitem.cpp:1024
A KFileItem is a generic class to handle a file, local or remote.
Definition: tdefileitem.h:41
TDEIO_EXPORT TQString convertSizeWithBytes(TDEIO::filesize_t size)
Converts size from bytes to a string representation with includes the size in bytes.
Definition: global.cpp:45
const TQString & name(bool lowerCase=false) const
Return the name of the file item (without a path).
Definition: tdefileitem.h:312
int overlays() const
Returns the overlays (bitfield of TDEIcon::*Overlay flags) that are used for this item's pixmap.
Definition: tdefileitem.cpp:632
bool acceptsDrops()
Returns true if files can be dropped over this item.
Definition: tdefileitem.cpp:862
TQString icon() const
Returns the icon associated with this service type.
Definition: kservicetype.h:94