Commit graph

900 commits

Author SHA1 Message Date
Ivailo Monev
f987d060a2 kio: remove unused async data sending feature
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-17 21:37:09 +03:00
Ivailo Monev
bce5621ae2 kio: remove unused and private KIO::TransferJobPrivate members
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-17 21:19:25 +03:00
Ivailo Monev
bccf27bfe0 kio: compare the items via KFileItem::cmp() too in KDirListerPrivate::_k_slotUpdateResult()
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>
2023-07-16 08:11:12 +03:00
Ivailo Monev
888f1bec7c generic: drop support for sequenced thumbnails
unused

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-15 00:24:33 +03:00
Ivailo Monev
2c647b3eee kio: initialize the KIO::PreviewJob members from already created config instance
no point to delay it and re-open config

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-15 00:07:17 +03:00
Ivailo Monev
16950e124e kio: remove unused KIO::PreviewJobPrivate member
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-15 00:04:33 +03:00
Ivailo Monev
084a03fb5e kio: iterate over a copy of the watched URLs list in KDirLister::openUrl()
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>
2023-07-14 08:09:28 +03:00
Ivailo Monev
f8871a44ff kio: remove reference to non-existing drag-n-drop format
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-13 07:05:27 +03:00
Ivailo Monev
71bfaa374e kio: always create KDirNotify isntance for KDirLister
for emblem icon on shared directories for example (file property change)

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-09 20:53:39 +03:00
Ivailo Monev
16f575c7e9 kio: do not emit refresh for the root item on KDirLister update
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>
2023-07-07 18:15:41 +03:00
Ivailo Monev
cf207aaa67 kio: remove redundant KDirNotify signals
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>
2023-07-06 18:29:56 +03:00
Ivailo Monev
49e58e0380 kio: emit deleted before added items from KDirLister
fixes dolphin model inconsistency

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-06 18:00:56 +03:00
Ivailo Monev
7e035dbe90 kio: additional note about the refresh of .desktop files on KDirLister update
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-06 17:12:10 +03:00
Ivailo Monev
2116909445 kio: KDirLister update optimization
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>
2023-07-06 08:35:36 +03:00
Ivailo Monev
7ca48a2806 kio: check if the local watcher exists before attempting to remove entries from it in KDirListerPrivate::unwatchUrl()
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>
2023-07-06 08:06:15 +03:00
Ivailo Monev
6deb136bad kio: remove unused constant in KDirListerPrivate::unwatchUrl()
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-06 07:36:33 +03:00
Ivailo Monev
8e6b9e3b28 kio: do not set KFile::LocalOnly in KFileDialog::getExistingDirectoryUrl()
KFileDialog::getExistingDirectoryUrl() is used to get remote directories
too

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-06 05:57:11 +03:00
Ivailo Monev
3caf682ebb kio: watch/unwatch on KDirLister update
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-06 05:01:47 +03:00
Ivailo Monev
b5df13055c kio: correct desktop items pair in KDirListerPrivate::_k_slotUpdateResult()
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-06 05:00:00 +03:00
Ivailo Monev
092de4a493 kio: note in the KDirLister documentation that some signals are emitted on update
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-06 04:24:27 +03:00
Ivailo Monev
b05beace42 kio: replace KDirLister::doNameFilter() and KDirLister::doMimeFilter() with their body
KDirLister::matchesFilter() and KDirLister::matchesMimeFilter() overloads
are virtual already

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-06 02:28:49 +03:00
Ivailo Monev
a1c2742223 kio: KDirLister overhaul to update via KIO::ListJob
passes practical, dolphin and gwenview tests. moveover KDirLister will
now emit partial updates

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-06 01:25:12 +03:00
Ivailo Monev
d3aa5356fd kio: do not emit KDirLister::itemsDeleted() from KDirLister::openUrl()
if anything expected signals should be adjusted in tests,
KDirLister::clear() is emitted anyway

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-05 08:43:16 +03:00
Ivailo Monev
2e682648c9 kio: update comments about KFile::Mode enums
KFileWidget now handles directories properly - booyah!

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-05 06:24:48 +03:00
Ivailo Monev
b0d0a4ee18 kio: do not convert the element attribute to latin1 in KBookmark::url()
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>
2023-07-05 05:47:03 +03:00
Ivailo Monev
74dc070da5 kfile: remove duplicate header inclusion
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-05 02:31:52 +03:00
Ivailo Monev
db4190995a kio: check if the currently set URL is valid before updating in KDirLister::updateDirectory()
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-05 00:39:04 +03:00
Ivailo Monev
7762ec727b kio: KDirListerPrivate::_k_slotEntries() optiomization
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>
2023-07-05 00:38:16 +03:00
Ivailo Monev
9767ce8fc4 kio: watch the sub-directories when listing recursively
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-05 00:00:14 +03:00
Ivailo Monev
5d60973ab4 kio: implement recursive listing for KDirLister
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>
2023-07-04 21:17:30 +03:00
Ivailo Monev
5ab5a82907 kio: use KFileItem::isDesktopFile() method instead of KDesktopFile::isDesktopFile() in KDirLister
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>
2023-07-04 17:10:30 +03:00
Ivailo Monev
268eac6790 kio: fix KFileItem::isReadable()
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>
2023-07-04 16:06:26 +03:00
Ivailo Monev
471df42df0 kio: remove now non-operational KDirLister::OpenUrlFlags
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-03 13:34:54 +03:00
Ivailo Monev
888926984f kio: const-ify KFileItem object in KDirListerPrivate::_k_slotEntries()
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-03 13:16:16 +03:00
Ivailo Monev
d45061c006 kio: remove redundant KRecentDocument::add() calls in KEncodingFileDialog methods
already done by KFileDialog, wasn't done by all KEncodingFileDialog methods
tho

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-03 11:42:19 +03:00
Ivailo Monev
85205ccecf kio: log KRecentDirs and KRecentDocument actions
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-03 11:28:00 +03:00
Ivailo Monev
8e0c1f8dfc kio: test KDirLister::findByUrl() and KDirLister::findByName()
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-03 10:38:20 +03:00
Ivailo Monev
d965f23721 kio: format and indent
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-03 10:03:53 +03:00
Ivailo Monev
ee0d50c901 generic: purge most manual tests
long overdue, have no use for them

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-03 07:03:28 +03:00
Ivailo Monev
693febf429 kio: remove redundant KDirNotify calls in KAutoMount and KAutoUnmount
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>
2023-07-03 05:43:10 +03:00
Ivailo Monev
4cc96022e8 generic: drop KFile::Tree and KFile::DetailTree modes
is interesting how things are all over kio and kfile for this

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-03 03:26:43 +03:00
Ivailo Monev
55458f706c kfile: purge KDirSelectDialog
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>
2023-07-03 03:25:54 +03:00
Ivailo Monev
ead63e29f6 kio: move the KDirLister redirection proxy where it belongs
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-02 10:35:34 +03:00
Ivailo Monev
12745a92d7 kio: remove unused KDirModel and KFileItemDelegate feature
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>
2023-07-02 07:34:49 +03:00
Ivailo Monev
9aa8b4fd14 kio: re-use code for remote directory slots
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>
2023-07-02 07:27:29 +03:00
Ivailo Monev
bedf3b590c kio: fix possible infinite loop on KDirLister::isFinished()
in case the listing has been canceled for example

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-02 07:12:20 +03:00
Ivailo Monev
5a2393001a kio: de-virtualize the public KDirLister methods
there are virtual protected methods for filters and error handler, nothing
else should be needed

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-02 00:16:22 +03:00
Ivailo Monev
2c494b1bf3 kio: KDirLister documentation correction
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-02 00:00:47 +03:00
Ivailo Monev
e1a223501d kio: KDirLister documentation update
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-01 23:55:11 +03:00
Ivailo Monev
a51d53e0af kio: call org::kde::KDirNotify::emitLeftDirectory() for every watched remote URL
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-01 23:54:23 +03:00