Commit graph

920 commits

Author SHA1 Message Date
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
Ivailo Monev
3c4b99b7cc kio: org::kde::KDirNotify::emitEnteredDirectory() for all remote URLs
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-01 22:54:11 +03:00
Ivailo Monev
194ea5edda kio: pass the correct URL to org::kde::KDirNotify::emitEnteredDirectory()
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-01 22:10:23 +03:00
Ivailo Monev
e9f07fdea4 kio: magick bits to watch the URL of desktop files from KDirLister
this essentially will watch the .desktop file URL which is, say, "trash:/"
and emit changes as if the .desktop file itself was modified (to update the
icon for example). that's what the KIO desktop slave was doing essentially
but now it is implemented into KDirLister itself so anything using that
class will get it!

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-01 21:49:05 +03:00
Ivailo Monev
db09be602a kio: set the internal complete variable to true just before emitting KDirLister::complete()
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-01 20:56:39 +03:00
Ivailo Monev
3af55964f6 kio: set the KDirLister pending updates timer to be single-shot
KDirLister::stop() will stop it anyway tho

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-01 20:55:58 +03:00
Ivailo Monev
7edf0b6141 kio: delay automatic KDirLister updates caused by directory watch
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-01 20:38:00 +03:00
Ivailo Monev
90e5a4a087 kio: unwatch the directory before listing new one in KDirLister
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-01 20:14:52 +03:00
Ivailo Monev
aafc5e9e02 kio: remove redundant KDirModel::sort() reimplementation
QAbstractItemModel::sort() does nothing

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-01 19:46:30 +03:00
Ivailo Monev
4e0c236efe kio: KDirListerPrivate::_k_slotFileRenamed() optimization
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-01 19:46:02 +03:00
Ivailo Monev
70b373514b kio: stop listing before anything else in KDirLister::openUrl()
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-01 12:18:24 +03:00
Ivailo Monev
8d249d0b7d kio: implemented but disabled partial updates for local directories
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-01 11:50:52 +03:00
Ivailo Monev
68e45cdb69 kio: test KDirLister::items()
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-01 07:24:14 +03:00
Ivailo Monev
3849efb2b0 kio: test KDirLister::openUrl()
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-01 07:14:12 +03:00
Ivailo Monev
ce3c7b0195 kio: include required headers in kiotesthelper header
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-01 07:13:47 +03:00
Ivailo Monev
cf582314f8 kio: register KFileItemList as metatype
used by KDirLister signals for example

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-01 07:13:31 +03:00
Ivailo Monev
6d73fbab66 kio: fix the KDirModelTest test and copyright KDirLister to me
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-01 07:01:59 +03:00
Ivailo Monev
087c38ad42 kio: KDirLister hacks for remote directories
see kde-workspace/kioslave/trash/ktrash.cpp for example

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-01 06:37:19 +03:00
Ivailo Monev
fd93fbbecc kio: reimplement KDirLister
has to be done to fix the caching issues, bonus points for being much
simpler and cleaner

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-01 06:18:59 +03:00
Ivailo Monev
82998dfd97 kio: format and indent
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-06-30 17:59:50 +03:00
Ivailo Monev
6a738b1bbe kdecore: merge KFolderMimeType into KMimeType
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-06-30 00:09:28 +03:00
Ivailo Monev
3ff69a4d6b kio: format and indent
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-06-29 04:22:57 +03:00
Ivailo Monev
a1e03f282b kio: return the result from SlaveBase::waitForAnswer()
fixes possible compiler warning (if the inner-loop code is changed)

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-06-29 04:17:07 +03:00
Ivailo Monev
ee9ca6e533 kio: register KIO::Task as metatype
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-06-28 23:58:07 +03:00
Ivailo Monev
fb379862b2 kio: format and indent
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-06-28 07:12:03 +03:00
Ivailo Monev
bf62c2b69d generic: consistent RFC references
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-06-26 23:02:40 +03:00
Ivailo Monev
eac8fd79cc kdecore: re-use KUrl::AdjustPathOption for KUrl::fileName() and KUrl::directory()
so that it is clear that the options shall affect only the result, also for
local files the correct thing can be done regardless of the trailing slash
as is done in KUrl::upUrl()

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-06-26 20:47:38 +03:00
Ivailo Monev
181e119ecc kdecore: KUrl::equals() rework to use KUrl::url() for the comparison
same thing (all URL components are compared) except the trailing slash
option can be re-used for it essentially adding one more option (to add
trailing slash when comparing)

also fixed and tested KUrl::upUrl() for some cases

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-06-26 01:30:23 +03:00
Ivailo Monev
84d5b447d3 kio: add the kurlcompletiontest header
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-06-26 00:00:54 +03:00
Ivailo Monev
47d0b5a297 kdecore: remove unused KUrl metadata
was used to pass the referrer and while it is still possible to
reimplement it realisticly speaking it is impossible to preserve the
referrer (and other HTTP(S) header metadata) because it will be lost in
transition in some cicumstances such as when drag-n-drop is done to
application unaware of application/x-kio-metadata

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-06-25 21:13:59 +03:00
Ivailo Monev
40da298881 kdecore: never output file:// for local files
there is a fix for that legacy thing

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-06-25 18:15:06 +03:00