KIO
kfileitem.cpp
Go to the documentation of this file.
282 m_bLink = !m_entry.stringValue( KIO::UDSEntry::UDS_LINK_DEST ).isEmpty(); // we don't store the link dest
368 kDebug() << " UDS_EXTENDED_ACL" << (m_entry.stringValue( KIO::UDSEntry::UDS_EXTENDED_ACL ) == item.m_entry.stringValue( KIO::UDSEntry::UDS_EXTENDED_ACL ));
369 kDebug() << " UDS_ACL_STRING" << (m_entry.stringValue( KIO::UDSEntry::UDS_ACL_STRING ) == item.m_entry.stringValue( KIO::UDSEntry::UDS_ACL_STRING ));
370 kDebug() << " UDS_DEFAULT_ACL_STRING" << (m_entry.stringValue( KIO::UDSEntry::UDS_DEFAULT_ACL_STRING ) == item.m_entry.stringValue( KIO::UDSEntry::UDS_DEFAULT_ACL_STRING ));
374 kDebug() << " ModificationTime" << (time(KFileItem::ModificationTime) == item.time(KFileItem::ModificationTime));
375 kDebug() << " UDS_ICON_NAME" << (m_entry.stringValue( KIO::UDSEntry::UDS_ICON_NAME ) == item.m_entry.stringValue( KIO::UDSEntry::UDS_ICON_NAME ));
383 && m_entry.stringValue( KIO::UDSEntry::UDS_EXTENDED_ACL ) == item.m_entry.stringValue( KIO::UDSEntry::UDS_EXTENDED_ACL )
384 && m_entry.stringValue( KIO::UDSEntry::UDS_ACL_STRING ) == item.m_entry.stringValue( KIO::UDSEntry::UDS_ACL_STRING )
385 && m_entry.stringValue( KIO::UDSEntry::UDS_DEFAULT_ACL_STRING ) == item.m_entry.stringValue( KIO::UDSEntry::UDS_DEFAULT_ACL_STRING )
389 && time(KFileItem::ModificationTime) == item.time(KFileItem::ModificationTime) // TODO only if already known!
390 && m_entry.stringValue( KIO::UDSEntry::UDS_ICON_NAME ) == item.m_entry.stringValue( KIO::UDSEntry::UDS_ICON_NAME )
582 int n = readlink( QFile::encodeName(d->m_url.toLocalFile( KUrl::RemoveTrailingSlash )), buf, sizeof(buf)-1 );
699 if ( KDE::lstat( m_url.toLocalFile( KUrl::RemoveTrailingSlash ), &buff ) == 0) // get uid/gid of the link, if it's a link
731 if ( KDE::lstat( m_url.toLocalFile( KUrl::RemoveTrailingSlash ), &buff ) == 0) // get uid/gid of the link, if it's a link
795 if (d->m_delayedMimeTypes) { // if we delayed getting the iconName up till now, this is the right point in time to do so
962 if ( !S_ISDIR( d->m_fileMode ) // Locked dirs have a special icon, use the overlay for files only
1056 if ( mime->name() == "application/x-gzip" && d->m_url.fileName().endsWith( QLatin1String( ".gz" ) ) )
1067 QPixmap p = KIconLoader::global()->loadMimeTypeIcon( mime->iconName( url ), KIconLoader::Desktop, _size, _state );
1090 if ( !(S_IRUSR & d->m_permissions) && !(S_IRGRP & d->m_permissions) && !(S_IROTH & d->m_permissions) )
1120 if ( !(S_IWUSR & d->m_permissions) && !(S_IWGRP & d->m_permissions) && !(S_IWOTH & d->m_permissions) )
1144 return fileName.length() > 1 && fileName[0] == '.'; // Just "." is current directory, not hidden.
1236 const QString mid = " </b></font></nobr></td><td><nobr><font color=\"" + colorName + "\">";
1274 tip += "<tr><td colspan=2><center><s> </s></center></td></tr>";
1669 // If we used the "fast mode" (no sniffing), and we didn't get a perfect (extension-based) match,
1672 //kDebug() << "finding mimetype for" << url << ":" << d->m_pMimeType->name() << "canDoBetter=" << canDoBetter;
An alternative URL (If different from the caption).
Definition: udsentry.h:190
KUrl targetUrl() const
Returns the target url of the file, which is the same as url() in cases where the slave doesn't speci...
Definition: kfileitem.cpp:1610
QString i18n(const char *text)
bool isWritable() const
Checks whether the file or directory is writable.
Definition: kfileitem.cpp:1105
KMimeType::Ptr determineMimeType() const
Returns the mimetype of the file item.
Definition: kfileitem.cpp:779
Definition: kfilemetainfoitem.h:34
This file is a shortcut or mount, pointing to an URL in a different hierarchy.
Definition: udsentry.h:215
KUrl nepomukUri() const
Returns the resource URI to be used for Nepomuk annotations.
Definition: kfileitem.cpp:1622
QPixmap DesktopIcon(const QString &name, int force_size, int state, const QStringList &overlays)
void setExtraData(const void *key, void *value)
This allows to associate some "extra" data to a KFileItem.
Definition: kfileitem.cpp:1377
QString getStatusBarInfo() const
Returns the string to be displayed in the statusbar, e.g.
Definition: kfileitem.cpp:1191
static KIconLoader * global()
The access control list serialized into a single string.
Definition: udsentry.h:203
static List currentMountPoints(DetailsNeededFlags infoNeeded=BasicInfoNeeded)
void setUDSEntry(const KIO::UDSEntry &entry, const KUrl &url, bool delayedMimeTypes=false, bool urlIsDirectory=false)
Reinitialize KFileItem with a new UDSEntry.
Definition: kfileitem.cpp:1341
void removeExtraData(const void *key)
Removes the extra data associated with an item via key.
Definition: kfileitem.cpp:1400
static QString iconFromDesktopFile(const QString &path)
Definition: kfileitem.cpp:855
The default access control list serialized into a single string.
Definition: udsentry.h:206
void refresh()
Throw away and re-read (for local files) all information about the file.
Definition: kfileitem.cpp:512
QString decodeFileName(const QString &str)
Decodes (from the filename to the text displayed) This doesn't do anything anymore, it used to do the opposite of encodeFileName when encodeFileName was using %2F for '/'.
Definition: global.cpp:153
File type, part of the mode returned by stat (for a link, this returns the file type of the pointed i...
Definition: udsentry.h:181
Ptr findByDevice(const QString &device) const
bool isExecutable(const QString &file)
int stat(const QString &path, KDE_struct_stat *buf)
KFileMetaInfo metaInfo(bool autoget=true, int what=KFileMetaInfo::ContentInfo|KFileMetaInfo::TechnicalInfo) const
Returns the metainfo of this item.
Definition: kfileitem.cpp:1455
KConfigGroup group(const QByteArray &group)
QString toLocalFile(AdjustPathOption trailing=LeaveTrailingSlash) const
A local file path if the ioslave display files sitting on the local filesystem (but in another hierar...
Definition: udsentry.h:166
QString comment() const
A comment which can contain anything - even rich text.
Definition: kfileitem.cpp:1011
mode_t permissions() const
Returns the permissions of the file (stat.st_mode containing only permissions).
Definition: kfileitem.cpp:1557
bool operator!=(const KFileItem &other) const
Returns true if both items do not share the same URL.
Definition: kfileitem.cpp:1335
bool isReadable() const
Checks whether the file or directory is readable.
Definition: kfileitem.cpp:1075
static bool checkDesktopFile(const KFileItem &item, bool _determineMimeType)
Returns true if this is a desktop file.
Definition: kfileitem.cpp:931
static QDebug kDebug(bool cond, int area=KDE_DEFAULT_DEBUG_AREA)
Treat the file as a hidden file (if set to 1) or as a normal file (if set to 0).
Definition: udsentry.h:169
Type fileSystemType(const QString &path)
void setPath(const QString &path)
A comment which will be displayed as is to the user.
Definition: udsentry.h:254
User-readable type of file (if not specified, the mimetype's description is used) ...
Definition: udsentry.h:220
A mime type to be used for displaying only.
Definition: udsentry.h:196
static bool isAuthorizedDesktopFile(const QString &path)
KFileItem findByUrl(const KUrl &url) const
Find a KFileItem by URL and return it.
Definition: kfileitem.cpp:1746
Definition: kfileitem.h:48
bool isRegularFile() const
Return true if this item is a regular file, false otherwise (directory, link, character/block device...
Definition: kfileitem.cpp:1783
QString readDevice() const
KFileMetaInfo provides metadata extracted from a file or other resource.
Definition: kfilemetainfo.h:56
KFileItem findByName(const QString &fileName) const
Find a KFileItem by name and return it.
Definition: kfileitem.cpp:1734
Definition: kfileitem.h:58
bool hasDeviceType() const
QString getToolTipText(int maxcount=6) const
Returns the string to be displayed in the tool tip when the mouse is over this item.
Definition: kfileitem.cpp:1223
void run(QWidget *parentWidget=0) const
Let's "KRun" this file ! (e.g.
Definition: kfileitem.cpp:1303
QString protocol() const
QString localPath() const
Returns the local path if isLocalFile() == true or the KIO item has a UDS_LOCAL_PATH atom...
Definition: kfileitem.cpp:602
QString linkDest() const
Returns the link destination if isLink() == true.
Definition: kfileitem.cpp:568
KUrl mostLocalUrl() const
Tries to give a local URL for this file item if possible.
Definition: kfileitem.cpp:1497
const void * extraData(const void *key) const
Retrieves the extra data with the given key.
Definition: kfileitem.cpp:1390
QPixmap loadMimeTypeIcon(const QString &iconName, KIconLoader::Group group, int size=0, int state=KIconLoader::DefaultState, const QStringList &overlays=QStringList(), QString *path_store=0) const
QString mimeComment() const
Returns the user-readable string representing the type of this file, like "OpenDocument Text File"...
Definition: kfileitem.cpp:823
bool acceptsDrops() const
Returns true if files can be dropped over this item.
Definition: kfileitem.cpp:1169
bool operator==(const KFileItem &other) const
Returns true if both items share the same URL.
Definition: kfileitem.cpp:1324
bool isFile() const
Returns true if this item represents a file (and not a a directory)
Definition: kfileitem.cpp:1160
QString readUrl() const
QString iconName() const
Returns the full path name to the icon that represents this mime type.
Definition: kfileitem.cpp:879
QString permissionsString() const
Returns the access permissions for the file as a string.
Definition: kfileitem.cpp:1409
bool hasLinkType() const
bool isDesktopFile() const
Checks whether the file is a readable local .desktop file, i.e.
Definition: kfileitem.cpp:1778
bool isLink() const
Returns true if this item represents a link in the UNIX sense of a link.
Definition: kfileitem.cpp:1573
A comma-separated list of supplementary icon overlays which will be added to the list of overlays cre...
Definition: udsentry.h:241
QString formatDateTime(const QDateTime &dateTime, DateFormat format=ShortDate, bool includeSecs=false) const
int lstat(const QString &path, KDE_struct_stat *buf)
bool hasKey(const QString &key) const
What
This is used to specify what a KFileMetaInfo object should read, so you can specify if you want to re...
Definition: kfilemetainfo.h:64
KMimeType::Ptr mimeTypePtr() const
Returns the currently known mimetype of the file item.
Definition: kfileitem.cpp:1655
KLocale * locale()
bool hasExtendedACL() const
Tells if the file has extended access level information ( Posix ACL )
Definition: kfileitem.cpp:618
KDateTime time(FileTimes which) const
Requests the modification, access or creation time, depending on which.
Definition: kfileitem.cpp:655
Access permissions (part of the mode returned by stat)
Definition: udsentry.h:171
QString fileName(const DirectoryOptions &options=IgnoreTrailingSlash) const
KACL defaultACL() const
Returns the default access control list for the directory.
Definition: kfileitem.cpp:642
int access(const QString &path, int mode)
QString name(bool lowerCase=false) const
Return the name of the file item (without a path).
Definition: kfileitem.cpp:1597
Filename - as displayed in directory listings etc.
Definition: udsentry.h:163
Name of the file where the link points to Allows to check for a symlink (don't use S_ISLNK !) ...
Definition: udsentry.h:184
Definition: kfileitem.h:60
bool cmp(const KFileItem &item) const
Somewhat like a comparison operator, but more explicit, and it can detect that two fileitems differ i...
Definition: kfileitem.cpp:1313
static QDebug kWarning(bool cond, int area=KDE_DEFAULT_DEBUG_AREA)
QString timeString(FileTimes which=ModificationTime) const
Requests the modification, access or creation time as a string, depending on which.
Definition: kfileitem.cpp:1421
If set, contains the label to display instead of the 'real name' in UDS_NAME.
Definition: udsentry.h:211
QString readIcon() const
mode_t mode() const
Returns the file type (stat.st_mode containing only S_IFDIR, S_IFLNK, ...).
Definition: kfileitem.cpp:1565
QString readPath() const
Indicates that the entry has extended ACL entries.
Definition: udsentry.h:201
A mime type; the slave should set it if it's known.
Definition: udsentry.h:192
const QString & staticQString(const char *str)
bool isLocalFile() const
QString convertSize(KIO::filesize_t size)
Converts size from bytes to the string representation.
Definition: global.cpp:53
const KShortcut & end()
void setMetaInfo(const KFileMetaInfo &info) const
Sets the metainfo of this item to info.
Definition: kfileitem.cpp:1447
T readEntry(const QString &key, const T &aDefault) const
KConfigGroup desktopGroup() const
QStringList overlays() const
Returns the overlays (bitfield of KIconLoader::*Overlay flags) that are used for this item's pixmap...
Definition: kfileitem.cpp:952
The URI of the corresponding Nepomuk resource.
Definition: udsentry.h:234
KUrl mostLocalUrl(bool &local) const
Tries to give a local URL for this file item if possible.
Definition: kfileitem.cpp:1476
A KFileItem is a generic class to handle a file, local or remote.
Definition: kfileitem.h:45
QPixmap pixmap(int _size, int _state=0) const
Returns a pixmap representing the file.
Definition: kfileitem.cpp:1020
Name of the icon, that should be used for displaying.
Definition: udsentry.h:151
const KShortcut & begin()
Definition: kfileitem.h:59
const QVariant & value() const
Retrieve the current value of this item.
Definition: kfilemetainfoitem.cpp:66
QDataStream & operator<<(QDataStream &s, const KFileItem &a)
Definition: kfileitem.cpp:1503
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:50:02 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:50:02 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.