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
1050 if ( mime->name() == "application/x-gzip" && d->m_url.fileName().endsWith( QLatin1String( ".gz" ) ) )
1061 QPixmap p = KIconLoader::global()->loadMimeTypeIcon( mime->iconName( url ), KIconLoader::Desktop, _size, _state );
1084 if ( !(S_IRUSR & d->m_permissions) && !(S_IRGRP & d->m_permissions) && !(S_IROTH & d->m_permissions) )
1114 if ( !(S_IWUSR & d->m_permissions) && !(S_IWGRP & d->m_permissions) && !(S_IWOTH & d->m_permissions) )
1138 return fileName.length() > 1 && fileName[0] == '.'; // Just "." is current directory, not hidden.
1230 const QString mid = " </b></font></nobr></td><td><nobr><font color=\"" + colorName + "\">";
1268 tip += "<tr><td colspan=2><center><s> </s></center></td></tr>";
1663 // If we used the "fast mode" (no sniffing), and we didn't get a perfect (extension-based) match,
1666 //kDebug() << "finding mimetype for" << url << ":" << d->m_pMimeType->name() << "canDoBetter=" << canDoBetter;
KConfigGroup group(const char *group)
QString readEntry(const char *key, const char *aDefault=0) const
SimpleConfig
QString readPath() const
bool hasDeviceType() const
bool hasLinkType() const
KConfigGroup desktopGroup() const
QString readUrl() const
QString readIcon() const
static bool isAuthorizedDesktopFile(const QString &path)
QString readDevice() const
KFileItem findByUrl(const KUrl &url) const
Find a KFileItem by URL and return it.
Definition: kfileitem.cpp:1740
KFileItem findByName(const QString &fileName) const
Find a KFileItem by name and return it.
Definition: kfileitem.cpp:1728
A KFileItem is a generic class to handle a file, local or remote.
Definition: kfileitem.h:46
QString comment() const
A comment which can contain anything - even rich text.
Definition: kfileitem.cpp:1005
QString iconName() const
Returns the full path name to the icon that represents this mime type.
Definition: kfileitem.cpp:879
KMimeType::Ptr determineMimeType() const
Returns the mimetype of the file item.
Definition: kfileitem.cpp:779
KFileMetaInfo metaInfo(bool autoget=true, int what=KFileMetaInfo::ContentInfo|KFileMetaInfo::TechnicalInfo) const
Returns the metainfo of this item.
Definition: kfileitem.cpp:1449
KDateTime time(FileTimes which) const
Requests the modification, access or creation time, depending on which.
Definition: kfileitem.cpp:655
bool isWritable() const
Checks whether the file or directory is writable.
Definition: kfileitem.cpp:1099
const void * extraData(const void *key) const
Retrieves the extra data with the given key.
Definition: kfileitem.cpp:1384
bool operator==(const KFileItem &other) const
Returns true if both items share the same URL.
Definition: kfileitem.cpp:1318
void setExtraData(const void *key, void *value)
This allows to associate some "extra" data to a KFileItem.
Definition: kfileitem.cpp:1371
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:1604
KUrl mostLocalUrl(bool &local) const
Tries to give a local URL for this file item if possible.
Definition: kfileitem.cpp:1470
bool acceptsDrops() const
Returns true if files can be dropped over this item.
Definition: kfileitem.cpp:1163
bool operator!=(const KFileItem &other) const
Returns true if both items do not share the same URL.
Definition: kfileitem.cpp:1329
void setMetaInfo(const KFileMetaInfo &info) const
Sets the metainfo of this item to info.
Definition: kfileitem.cpp:1441
KMimeType::Ptr mimeTypePtr() const
Returns the currently known mimetype of the file item.
Definition: kfileitem.cpp:1649
bool isLink() const
Returns true if this item represents a link in the UNIX sense of a link.
Definition: kfileitem.cpp:1567
void setUDSEntry(const KIO::UDSEntry &entry, const KUrl &url, bool delayedMimeTypes=false, bool urlIsDirectory=false)
Reinitialize KFileItem with a new UDSEntry.
Definition: kfileitem.cpp:1335
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:1307
bool hasExtendedACL() const
Tells if the file has extended access level information ( Posix ACL )
Definition: kfileitem.cpp:618
KACL defaultACL() const
Returns the default access control list for the directory.
Definition: kfileitem.cpp:642
void removeExtraData(const void *key)
Removes the extra data associated with an item via key.
Definition: kfileitem.cpp:1394
bool isReadable() const
Checks whether the file or directory is readable.
Definition: kfileitem.cpp:1069
mode_t permissions() const
Returns the permissions of the file (stat.st_mode containing only permissions).
Definition: kfileitem.cpp:1551
QString getStatusBarInfo() const
Returns the string to be displayed in the statusbar, e.g.
Definition: kfileitem.cpp:1185
bool isRegularFile() const
Return true if this item is a regular file, false otherwise (directory, link, character/block device,...
Definition: kfileitem.cpp:1777
bool isFile() const
Returns true if this item represents a file (and not a a directory)
Definition: kfileitem.cpp:1154
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:1491
QString localPath() const
Returns the local path if isLocalFile() == true or the KIO item has a UDS_LOCAL_PATH atom.
Definition: kfileitem.cpp:602
KUrl nepomukUri() const
Returns the resource URI to be used for Nepomuk annotations.
Definition: kfileitem.cpp:1616
mode_t mode() const
Returns the file type (stat.st_mode containing only S_IFDIR, S_IFLNK, ...).
Definition: kfileitem.cpp:1559
bool isDesktopFile() const
Checks whether the file is a readable local .desktop file, i.e.
Definition: kfileitem.cpp:1772
QString permissionsString() const
Returns the access permissions for the file as a string.
Definition: kfileitem.cpp:1403
QString name(bool lowerCase=false) const
Return the name of the file item (without a path).
Definition: kfileitem.cpp:1591
QString timeString(FileTimes which=ModificationTime) const
Requests the modification, access or creation time as a string, depending on which.
Definition: kfileitem.cpp:1415
QPixmap pixmap(int _size, int _state=0) const
Returns a pixmap representing the file.
Definition: kfileitem.cpp:1014
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:1217
QString mimeComment() const
Returns the user-readable string representing the type of this file, like "OpenDocument Text File".
Definition: kfileitem.cpp:823
QStringList overlays() const
Returns the overlays (bitfield of KIconLoader::*Overlay flags) that are used for this item's pixmap.
Definition: kfileitem.cpp:952
void refresh()
Throw away and re-read (for local files) all information about the file.
Definition: kfileitem.cpp:512
Definition: kfilemetainfoitem.h:34
const QVariant & value() const
Retrieve the current value of this item.
Definition: kfilemetainfoitem.cpp:66
KFileMetaInfo provides metadata extracted from a file or other resource.
Definition: kfilemetainfo.h:56
What
This is used to specify what a KFileMetaInfo object should read, so you can specify if you want to re...
Definition: kfilemetainfo.h:65
@ UDS_ICON_OVERLAY_NAMES
A comma-separated list of supplementary icon overlays which will be added to the list of overlays cre...
Definition: udsentry.h:241
@ UDS_HIDDEN
Treat the file as a hidden file (if set to 1) or as a normal file (if set to 0).
Definition: udsentry.h:169
@ UDS_LINK_DEST
Name of the file where the link points to Allows to check for a symlink (don't use S_ISLNK !...
Definition: udsentry.h:184
@ UDS_LOCAL_PATH
A local file path if the ioslave display files sitting on the local filesystem (but in another hierar...
Definition: udsentry.h:166
@ 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: udsentry.h:181
@ UDS_DISPLAY_TYPE
User-readable type of file (if not specified, the mimetype's description is used)
Definition: udsentry.h:220
@ UDS_DISPLAY_NAME
If set, contains the label to display instead of the 'real name' in UDS_NAME.
Definition: udsentry.h:211
@ UDS_DEFAULT_ACL_STRING
The default access control list serialized into a single string.
Definition: udsentry.h:206
@ UDS_TARGET_URL
This file is a shortcut or mount, pointing to an URL in a different hierarchy.
Definition: udsentry.h:215
Desktop
static KIconLoader * global()
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 formatDateTime(const KDateTime &dateTime, DateFormat format=ShortDate, DateTimeFormatOptions options=0) const
static Ptr mimeType(const QString &name, FindByNameOption options=ResolveAliases)
KSharedPtr< KMimeType > Ptr
static Ptr findByUrl(const KUrl &url, mode_t mode=0, bool is_local_file=false, bool fast_mode=false, int *accuracy=0)
Ptr findByDevice(const QString &device) const
static List currentMountPoints(DetailsNeededFlags infoNeeded=BasicInfoNeeded)
RemoveTrailingSlash
bool isLocalFile() const
void setPath(const QString &path)
QString fileName(const DirectoryOptions &options=IgnoreTrailingSlash) const
QString protocol() const
QString toLocalFile(AdjustPathOption trailing=LeaveTrailingSlash) const
#define kDebug
#define kWarning
QDataStream & operator<<(QDataStream &s, const KFileItem &a)
Definition: kfileitem.cpp:1497
static QString iconFromDesktopFile(const QString &path)
Definition: kfileitem.cpp:855
static bool checkDesktopFile(const KFileItem &item, bool _determineMimeType)
Returns true if this is a desktop file.
Definition: kfileitem.cpp:931
QPixmap DesktopIcon(const QString &name, int force_size, int state, const QStringList &overlays)
QString i18n(const char *text)
int lstat(const QString &path, KDE_struct_stat *buf)
int stat(const QString &path, KDE_struct_stat *buf)
int access(const QString &path, int mode)
Unknown
Type fileSystemType(const QString &path)
const QString & staticQString(const char *str)
KLocale * locale()
QString convertSize(KIO::filesize_t size)
Converts size from bytes to the string representation.
Definition: global.cpp:53
QString decodeFileName(const QString &str)
Decodes (from the filename to the text displayed) This doesn't do anything anymore,...
Definition: global.cpp:153
group
const char * name(StandardAction id)
const KShortcut & begin()
const KShortcut & end()
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.