KIO
kfileitem.cpp
216 const bool shouldStat = (m_fileMode == KFileItem::Unknown || m_permissions == KFileItem::Unknown || m_entry.count() == 0) && m_url.isLocalFile();
237 } else { // link pointing to nowhere (see FileProtocol::createUDSEntry() in ioslaves/file/file.cpp)
247 m_entry.replace(KIO::UDSEntry::UDS_MODIFICATION_TIME, buf.st_mtime); // TODO: we could use msecs too...
304 m_bLink = !m_entry.stringValue(KIO::UDSEntry::UDS_LINK_DEST).isEmpty(); // we don't store the link dest
309 if (_urlIsDirectory && !UDS_URL_seen && !m_strName.isEmpty() && m_strName != QLatin1String(".")) {
398 qDebug() << " group" << (m_entry.stringValue(KIO::UDSEntry::UDS_GROUP) == otherEntry.stringValue(KIO::UDSEntry::UDS_GROUP));
399 qDebug() << " user" << (m_entry.stringValue(KIO::UDSEntry::UDS_USER) == otherEntry.stringValue(KIO::UDSEntry::UDS_USER));
401 qDebug() << " UDS_EXTENDED_ACL" << (m_entry.stringValue(KIO::UDSEntry::UDS_EXTENDED_ACL) == otherEntry.stringValue(KIO::UDSEntry::UDS_EXTENDED_ACL));
402 qDebug() << " UDS_ACL_STRING" << (m_entry.stringValue(KIO::UDSEntry::UDS_ACL_STRING) == otherEntry.stringValue(KIO::UDSEntry::UDS_ACL_STRING));
404 << (m_entry.stringValue(KIO::UDSEntry::UDS_DEFAULT_ACL_STRING) == otherEntry.stringValue(KIO::UDSEntry::UDS_DEFAULT_ACL_STRING));
414 qDebug() << " UDS_ICON_NAME" << (m_entry.stringValue(KIO::UDSEntry::UDS_ICON_NAME) == otherEntry.stringValue(KIO::UDSEntry::UDS_ICON_NAME));
438 && m_entry.stringValue(KIO::UDSEntry::UDS_GROUP) == item.m_entry.stringValue(KIO::UDSEntry::UDS_GROUP)
439 && m_entry.stringValue(KIO::UDSEntry::UDS_USER) == item.m_entry.stringValue(KIO::UDSEntry::UDS_USER)
440 && m_entry.stringValue(KIO::UDSEntry::UDS_EXTENDED_ACL) == item.m_entry.stringValue(KIO::UDSEntry::UDS_EXTENDED_ACL)
441 && m_entry.stringValue(KIO::UDSEntry::UDS_ACL_STRING) == item.m_entry.stringValue(KIO::UDSEntry::UDS_ACL_STRING)
442 && m_entry.stringValue(KIO::UDSEntry::UDS_DEFAULT_ACL_STRING) == item.m_entry.stringValue(KIO::UDSEntry::UDS_DEFAULT_ACL_STRING)
446 && m_entry.numberValue(KIO::UDSEntry::UDS_MODIFICATION_TIME) == item.m_entry.numberValue(KIO::UDSEntry::UDS_MODIFICATION_TIME)
447 && m_entry.stringValue(KIO::UDSEntry::UDS_ICON_NAME) == item.m_entry.stringValue(KIO::UDSEntry::UDS_ICON_NAME)
448 && m_entry.stringValue(KIO::UDSEntry::UDS_TARGET_URL) == item.m_entry.stringValue(KIO::UDSEntry::UDS_TARGET_URL)
449 && m_entry.stringValue(KIO::UDSEntry::UDS_LOCAL_PATH) == item.m_entry.stringValue(KIO::UDSEntry::UDS_LOCAL_PATH));
564 KFileItem::KFileItem(const KIO::UDSEntry &entry, const QUrl &itemOrDirUrl, bool delayedMimeTypes, bool urlIsDirectory)
577 : d(new KFileItemPrivate(KIO::UDSEntry(), mode, permissions, url, false, delayedMimeTypes, KFileItem::NormalMimeTypeDetermination))
583 : d(new KFileItemPrivate(KIO::UDSEntry(), mode, KFileItem::Unknown, url, false, false, KFileItem::NormalMimeTypeDetermination))
593 : d(new KFileItemPrivate(KIO::UDSEntry(), KFileItem::Unknown, KFileItem::Unknown, url, false, false, mimeTypeDetermination))
878 if (d->m_delayedMimeTypes) { // if we delayed getting the iconName up till now, this is the right point in time to do so
1123 QStringList names = d->m_entry.stringValue(KIO::UDSEntry::UDS_ICON_OVERLAY_NAMES).split(QLatin1Char(','), Qt::SkipEmptyParts);
1167 if (KSambaShare::instance()->isDirectoryShared(path) || KNFSShare::instance()->isDirectoryShared(path)) {
1241 if (!(S_IWUSR & d->m_permissions) && !(S_IWGRP & d->m_permissions) && !(S_IWOTH & d->m_permissions)) {
1270 return fileName.length() > 1 && fileName[0] == QLatin1Char('.'); // Just "." is current directory, not hidden.
void append(const T &value)
T & first()
bool inherits(const QString &mimeTypeName) const const
void setLocalPath(const QString &path)
Sets the item's local path (UDS_LOCAL_PATH).
Definition: kfileitem.cpp:665
QString readEntry(const char *key, const char *aDefault=nullptr) const
@ UDS_DEFAULT_ACL_STRING
The default access control list serialized into a single string.
Definition: udsentry.h:292
QString symLinkTarget() const const
void refresh()
Throw away and re-read (for local files) all information about the file.
Definition: kfileitem.cpp:610
KIOCORE_EXPORT QString convertSize(KIO::filesize_t size)
Converts size from bytes to the string representation.
Definition: global.cpp:43
Q_INVOKABLE QDateTime time(FileTimes which) const
Requests the modification, access or creation time, depending on which.
Definition: kfileitem.cpp:796
QMimeType mimeTypeForUrl(const QUrl &url) const const
QVariant fromValue(const T &value)
KFileItem findByUrl(const QUrl &url) const
Find a KFileItem by URL and return it.
Definition: kfileitem.cpp:1728
Type type(const QSqlDatabase &db)
QString scheme() const const
QCA_EXPORT void init()
int count(const T &value) const const
@ UDS_ACCESS_TIME
The last time the file was opened. Required time format: seconds since UNIX epoch.
Definition: udsentry.h:261
@ 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:255
QByteArray encodeName(const QString &fileName)
QDebug & nospace()
Definition: udsentry.h:77
QStringView mid(qsizetype start) const const
static bool isAuthorizedDesktopFile(const QString &path)
Ptr findByDevice(const QString &device) const
Returns the mount point associated with device, i.e.
Definition: kmountpoint.cpp:453
@ UDS_TARGET_URL
This file is a shortcut or mount, pointing to an URL in a different hierarchy.
Definition: udsentry.h:301
@ 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:270
QDataStream & operator<<(QDataStream &out, const KDateTime &dateTime)
KCOREADDONS_EXPORT Type fileSystemType(const QString &path)
bool operator==(const KFileItem &other) const
Returns true if both items share the same URL.
Definition: kfileitem.cpp:1389
Dirs
@ 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:267
QString permissionsString() const
Returns the access permissions for the file as a string.
Definition: kfileitem.cpp:1431
Definition: ksslerroruidata.h:17
QString simplified() const const
static List currentMountPoints(DetailsNeededFlags infoNeeded=BasicInfoNeeded)
Returns a list of all current mountpoints.
Definition: kmountpoint.cpp:285
bool hasExtendedACL() const
Tells if the file has extended access level information ( Posix ACL )
Definition: kfileitem.cpp:753
Q_INVOKABLE QString timeString(FileTimes which=ModificationTime) const
Requests the modification, access or creation time as a string, depending on which.
Definition: kfileitem.cpp:1447
void reserve(int alloc)
bool isValid() const const
void setName(const QString &name)
Sets the item's name (i.e. the filename).
Definition: kfileitem.cpp:675
QLocale system()
int size() const const
bool isExecutable() const const
QString i18n(const char *text, const TYPE &arg...)
KIOCORE_EXPORT QString decodeFileName(const QString &str)
Decodes (from the filename to the text displayed) This doesn't do anything anymore,...
Definition: global.cpp:146
StripTrailingSlash
bool acceptsDrops() const
Returns true if files can be dropped over this item.
Definition: kfileitem.cpp:1314
QMimeType mimeTypeForName(const QString &nameOrAlias) const const
KFileItem findByName(const QString &fileName) const
Find a KFileItem by name and return it.
Definition: kfileitem.cpp:1719
SkipEmptyParts
bool isEmpty() const const
QUrl fromLocalFile(const QString &localFile)
QString fileName(QUrl::ComponentFormattingOptions options) const const
int length() const const
QString toDisplayString(QUrl::FormattingOptions options) const const
QString toString(qlonglong i) const const
QString name() const
bool isEmpty() const const
name
QString toLocalFile() const const
qint64 size() const const
QList::const_iterator cend() const const
KIO::filesize_t recursiveSize() const
For folders, its recursive size: the size of its files plus the recursiveSize of its folder.
Definition: kfileitem.cpp:744
bool hasKey(const char *key) const
QString loginName() const
comment
AKONADI_CALENDAR_EXPORT QString displayName(Akonadi::ETMCalendar *calendar, const Akonadi::Collection &collection)
QDateTime toLocalTime() const const
bool operator<(const KFileItem &other) const
Returns true if this item's URL is lexically less than other's URL; otherwise returns false.
Definition: kfileitem.cpp:1407
KCOREADDONS_EXPORT QString tildeCollapse(const QString &path)
bool startsWith(const QString &s, Qt::CaseSensitivity cs) const const
qint64 toSecsSinceEpoch() const const
long long numberValue(uint field, long long defaultValue=0) const
Definition: udsentry.cpp:381
LongFormat
QString path(QUrl::ComponentFormattingOptions options) const const
@ UDS_LOCAL_PATH
A local file path if the KIO worker display files sitting on the local filesystem (but in another hie...
Definition: udsentry.h:252
@ UDS_MODIFICATION_TIME
The last time the file was modified. Required time format: seconds since UNIX epoch.
Definition: udsentry.h:259
const char * constData() const const
QString arg(qlonglong a, int fieldWidth, int base, QChar fillChar) const const
QString path(const QString &relativePath)
QString fromLatin1(const char *str, int size)
@ UDS_DISPLAY_TYPE
User-readable type of file (if not specified, the MIME type's description is used)
Definition: udsentry.h:306
KACL defaultACL() const
Returns the default access control list for the directory.
Definition: kfileitem.cpp:781
bool isWritable() const const
bool isLocalFile() const const
QList::const_iterator cbegin() const const
QDateTime fromSecsSinceEpoch(qint64 secs, Qt::TimeSpec spec, int offsetSeconds)
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:1376
QMimeType mimeTypeForFile(const QString &fileName, QMimeDatabase::MatchMode mode) const const
QStringList mimeTypes(Mode mode=Writing)
mode_t mode() const
Returns the file type (stat.st_mode containing only S_IFDIR, S_IFLNK, ...).
Definition: kfileitem.cpp:1576
QUrl mostLocalUrl(bool *local=nullptr) const
Tries to return a local URL for this file item if possible.
Definition: kfileitem.cpp:1482
@ UDS_DISPLAY_NAME
If set, contains the label to display instead of the 'real name' in UDS_NAME.
Definition: udsentry.h:297
bool operator!=(const KFileItem &other) const
Returns true if both items do not share the same URL.
Definition: kfileitem.cpp:1402
iconName
mode_t permissions() const
Returns the permissions of the file (stat.st_mode containing only permissions).
Definition: kfileitem.cpp:1565
QDataStream & operator>>(QDataStream &in, KDateTime &dateTime)
SimpleConfig
Definition: kfileitem.h:35
QList< QMimeType > mimeTypesForFileName(const QString &fileName) const const
MostLocalUrlResult isMostLocalUrl() const
Returns a MostLocalUrlResult, with the local Url for this item if possible (otherwise an empty Url),...
Definition: kfileitem.cpp:1495
static bool supportsWriting(const QUrl &url)
Returns whether the protocol can store data to URLs.
Definition: kprotocolmanager.cpp:1050
void setDelayedMimeTypes(bool b)
Sets MIME type determination to be immediate or on demand.
Definition: kfileitem.cpp:646
QUrl fromUserInput(const QString &userInput)
bool isReadable() const const
@ UDS_CREATION_TIME
The time the file was created. Required time format: seconds since UNIX epoch.
Definition: udsentry.h:263
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Tue Nov 28 2023 03:55:13 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2023 The KDE developers.
Generated on Tue Nov 28 2023 03:55:13 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.