contrary to common sense the KFileItem comparison operator does not compare
the item attributes, only the URL
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
because KDirListerPrivate::unwatchUrl() modifies the list, fixes possible
crash (if the watched URLs list was not empty)
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
dolphin for example assumes that signals are emitted only for the filtered
items, not for the root too
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
see 693febf429, and since mount points are
local directories (or rather not a KIO thing) KDirWatch will notify
about the changes when the mount point directory no longer contains
entries
bonus points for reducung the D-Bus traffic
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
one more thing to (possibly) optimize - KDirListerPrivate::_k_slotFileRenamed(),
after that its hammer (test) time and I already have something in mind
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
for the rare case of currently listing remote protocol (such as
filenamesearch:/) and local file that is not watched being deleted (the
signal is emitted by KDirNotify)
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
that will only convert it back to QString in the KUrl constructor but it
will not be from UTF-8 bytes - the attribute string is converted to latin1,
duh
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
only for the case when not automatically updating (not adding to the URL
list to save memory and computation)
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
to be used by the gwenview recursive model, note that recursive listing via
KIO::listRecursive() does not follow links
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
KDesktopFile::isDesktopFile() checks only the extension (if the file ends with .desktop) while
KFileItem::isDesktopFile() checks the MIME type which is a bit more
expensive but more correct too (the desktoppaths KCM copies links such that
the files do not end with .desktop for example)
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
this will make it call access() to do a permission check if S_IRUSR,
S_IRGRP and S_IROTH are not all set which is more reliable check (much like
the one done by KFileItem::isWritable())
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
can't mount directories on network:/, trash:/, etc. - just not a thing.
also org::kde::KDirNotify should not be used for local files and
directories
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
that way file and directory dialogs will be consistent, not to mention
there were things that KDirSelectDialog was lacking such as resizable
places area.
more changes are needed to account for the directory mode
(KFile::Directory), currently for directory only mode the filter is set
to "All Folders" but it can be changed (the filter widget is not
disabled). also when an attempt to open non-existing directory by name
(via the name input widget) the error says "the file cannot be found"
- it should be "the directory cannot be found" for directory mode
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
other than starting kuiserver it does nothing, the kuiserver program is
already started by other classes (such as job tracker classes) on demand
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
note to self: signal is emited for the local file too when the trash is
emptied, meaning any currently listed directories which had files moved to
the trash will be updated too
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>