Commit graph

236 commits

Author SHA1 Message Date
Ivailo Monev
ed8815b5c9 kio: pass the full path to KIO::pixmapForUrl() from KFileWidgetPrivate::setLocationText()
for best MIME type determination results the content of the file may have
to be read and relative path (only the filename in this case) does not cut
it

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-06-04 15:49:55 +03:00
Ivailo Monev
c18bacba12 kio: make KIO::UDSEntry::UDS_URL required/mandatory
if the slaves do not know what URL is being stat()-ed, listed, etc. then
what? this may make the URL different than the one originally requested (as
it should be) in case of redirection(s) for example

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-05-31 16:30:03 +03:00
Ivailo Monev
175aba2477 kio: format and indent
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-05-30 13:56:27 +03:00
Ivailo Monev
278d608836 kio: properly initialize KUrlRequester::KUrlRequesterPrivate members
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-05-30 13:49:12 +03:00
Ivailo Monev
10f13e8bab kio: remove unused private KUrlComboRequester member
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-05-30 13:34:54 +03:00
Ivailo Monev
aa5fa71ef2 kio: replace KMimeType::iconNameForUrl() with KIO::pixmapForUrl() in KFilePlaceEditDialog
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-05-30 02:51:12 +03:00
Ivailo Monev
4f3da48844 kio: use the KFileItem icon instead of determening it in KFilePropsPlugin
otherwise the icon does not match the one that dolphin shows for example,
not to mention KMimeType::findByUrl() can only guess from the name for
remote URLs instead of using the info KFileItem already has

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-05-30 02:49:47 +03:00
Ivailo Monev
fe6daca7c7 kio: replace KMimeType::iconNameForUrl() with KIO::pixmapForUrl() where possible
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-05-28 10:34:23 +03:00
Ivailo Monev
cd0bf16803 kio: rework KIO::pixmapForUrl() to use KFileItem
for overlays and overall icon consistency (where possible, KHistoryComboBox
still cannot use it)

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-05-28 10:16:47 +03:00
Ivailo Monev
e88a8bd627 kio: do not cache the name in lower case from KFileItem::name()
case-insensitive comparison is faster and is already done by
KDirSortFilterProxyModel

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-05-27 20:08:38 +03:00
Ivailo Monev
edbdb6dfbe kio: drop redundant KFileItem constructors and arguments
never set to anything other than empty QString or KFileItem::Unknown

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-05-27 18:26:44 +03:00
Ivailo Monev
825763d73f kio: drop the feature to delay MIME type determination
it shall be delayed without the feature (which it was anyway)

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-05-27 17:10:04 +03:00
Ivailo Monev
75cf57aac5 kio: drop support for "most local URL"
was used by some slaves (e.g. the archive slave which is no more).

lets see if you can find it jira:
https://ivailo-monev.atlassian.net/browse/KDE-12

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-05-24 20:46:17 +03:00
Ivailo Monev
bd3345543d kio: reuse variable in KFilePropsPlugin
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-05-12 22:45:15 +03:00
Ivailo Monev
779f3b5635 kio: update placeholders references in KOpenWithDialog
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-05-12 14:44:36 +03:00
Ivailo Monev
25d81b76b9 kio: slightly better exec extraction in KOpenWithDialog
the matching could try basename and possibly second argument match tho,
e.g. the Exec key value could be relative or full path and interpreter may
be the first argument with the actual program (or script rather) second
making the matching kinda hard to get right

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-05-12 14:40:26 +03:00
Ivailo Monev
aee3b7b3da kio: log debug messages to a valid debug area
250 is not a registered one

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-05-12 14:25:51 +03:00
Ivailo Monev
b90f90905b kio: move most of the KRun bits to KLauncher
two things doing the same thing - one has to go away. also KRun does not
fork and the launched service/application lifetime was bound to the
process launching it, that is not the case with klauncher - it is bound
to the session (in the usual case)

a few things on the TODO list but mostly for services/applications
lacking features

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-05-12 03:21:17 +03:00
Ivailo Monev
d45c3a867b kio: remove unused variable
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-05-04 21:59:13 +03:00
Ivailo Monev
559411bd09 generic: optimize MIME type detection
KRun already had such optimization in place for example, that makes the
file slave kinda special tho as it will determine MIME type only from mode
but the goal is to not even spin a job and a slave for local files

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-05-04 21:26:18 +03:00
Ivailo Monev
817b7a4aab kdecore: rework KMimeType
more accurate probing then before, notably by probing the file content
from the file slave (only the name was checked before because the
filepath was not a full path in some cases and the file could not be
open)

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-05-04 20:14:53 +03:00
Ivailo Monev
c4eb95672e kio: pass the device to KMimeType::findByNameAndContent()
it reads more than 1024 because it is unknown how much data the rules need

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-05-03 09:38:02 +03:00
Ivailo Monev
e273741fdb kio: drop MIME type feature of slaves
the specialized one, stat() does it now because emitting MIME type while
also emitting data (in or out) interrupts the data flow

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-05-03 05:26:56 +03:00
Ivailo Monev
540ee2cde7 kio: rework the job scheduler
thread-safe and private

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-05-02 02:16:50 +03:00
Ivailo Monev
956cfc5a59 generic: prepare for Katie changes
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-04-26 22:38:19 +03:00
Ivailo Monev
843463c95d kdeui: drop KSortcut
missing proper configuration interface for the shortcuts, the old one
was borked anyway

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-04-24 10:19:03 +03:00
Ivailo Monev
671d45fe1d generic: adjust to Katie changes
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-04-22 04:29:48 +03:00
Ivailo Monev
f53d175e6b kio: handle non-local URLs in KRecentDocument and reject URLs with empty filename
this is mostly for KIO jobs that, for example, get remote URLs

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-04-20 16:28:28 +03:00
Ivailo Monev
d4ab9eae6c kio: KRecentDocument optimization
the bug report was related to the resources system that Katie does not
support

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-04-19 04:35:28 +03:00
Ivailo Monev
9bab635b46 kio: remove redundant spacing override
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-04-10 03:51:12 +03:00
Ivailo Monev
1eaf89824e generic: make use of the new QPixmap comparison operators
requires the following commit from the Katie repo:
e28900041a4e78589f3ba28c36fda5bfd6e0f150

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-03-30 13:07:11 +02:00
Ivailo Monev
1eaf3dab61 kio: remove kfilemodule leftovers
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-03-27 06:12:57 +02:00
Ivailo Monev
4df06d8f7a generic: adjust to Katie changes
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-03-24 02:43:33 +02:00
Ivailo Monev
6e654af2b3 kio: implement KFileWidget::setConfirmOverwrite() and KFileWidget::setInlinePreviewShown()
no idea why those methods were stubs but KFileWidgetPrivate had a method
for it

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-03-24 02:32:50 +02:00
Ivailo Monev
7dd0200d8f kio: de-virtualize KFileWidget methods
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-03-24 02:28:43 +02:00
Ivailo Monev
a65bd3b685 kfile: merge it into kio
once upon a time it was either part of it or was separated from it

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-03-24 01:19:59 +02:00
Ivailo Monev
fbfb374b9c generic: drop scripting and tray support
after changes to multiple sub-projects (Katie, kdelibs, kde-workspace
and kde-extraapps) that finally happened, can write lots about it but I
will keep it short - by rewriting parts that were using js/qml (e.g. the
plasma applets) the desktop startup was reduced to half, also the legacy
tray thing shall be no more (anything that needs tray icon shall be a
plasma applet now) thus some applications and features will be dropped
aswell. see all repositories for the changes done

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-10-21 08:06:58 +03:00
Ivailo Monev
96de1ec99f kio: check only the number of maximum recent document entries to decide if adding should be disabled
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-09-20 11:53:53 +03:00
Ivailo Monev
88598523d0 kdeui: new KPixmapWidget
the idea for QImage/QPixmap-optimized widget occurred to me while
writing kimageviewer (see the kde-playground repo), unlike the widget I
wrote for kimageviewer this one supports drag-n-drop tho and is drop-in
replacement for QLabel when showing only a pixmap is required. the
widget also shows a small image while dragging ala ksnapshot

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-29 08:59:51 +03:00
Ivailo Monev
80d185a980 kio: rename X-KDE-SysTray to X-KDE-HasTrayOption
the tray feature of KApplication works like a charm:
https://ibb.co/sbqxjVr

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-24 16:30:40 +03:00
Ivailo Monev
4b632fcae6 kdeui: implement status notifier for any KApplication instance
optional feature that requires "-tray" command line argument and replaces
what the `ksystraycmd` program was doing. requires "X-KDE-SysTray" entry
in the desktop file as indicator that the application supports "-tray"
argument, unlike `ksystraycmd` does not spawn extra process and even
session management will work properly for it (the argument is manually
added to the restart command)

the feature is very much tide to KMainWindow (and derived classes) but the
overhead is next to none when the "-tray" argument is not specified (the
status notifier is not created in such case) however if created an
expensive tooltip update is done whenever a window changes (may have to
look into optimizing it but then again - most of the code does nothing
unless the "-tray" argument is specified)

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-24 01:41:02 +03:00
Ivailo Monev
14b62a7d3d kio: implement interface to change the "StartupWMClass" key of .desktop files
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-20 03:03:09 +03:00
Ivailo Monev
a50c72de91 generic: drop support for startup notification via D-Bus service
just another way to do what ASN does, the KService::DBusWait mode was
not used too. with this change however all of the process setup code is
moved to a seperate class and the responsibility of KLauncher about ASN
is reduced (ASN now works better for process that fork but if application
claims ASN support and does not send ASN finish then the timeout will be
reached)

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-19 19:53:14 +03:00
Ivailo Monev
07660bf9cd kio: drop support for X-KDE-WMClass and X-KDE-StartupNotify
see the following commit in kde-workspace repo:
f1f6ae7a3ec35e289df1f45cd47e71bd3c696fbe

on a side note the default for StartupNotify should probably be false as it
is unknown if the application actually supports startup notification is one
of the reasons why currently KLauncher does more than merely set an
environment variable and assume applications know what to do with it

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-18 18:21:58 +03:00
Ivailo Monev
625373ffa8 kdecore: drop KDateTime
with the rewrite (see f452e2e50b),
KDateTime is just glue-code for compatibility now. the exception is
KDateTime::isNightTime() (written by me) which is used only in one place
(kde-workspace/plasma/dataengines/weather/ions/wetter.com/ion_wettercom.cpp)
and can be moved there

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-14 22:35:08 +03:00
Ivailo Monev
1177b5d671 kio: replace KFileMetaDataWidget::Private::initMetaInfoSettings() with its body
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-30 04:49:10 +03:00
Ivailo Monev
7098b9d98e kio: remove unused and private KFileMetaDataWidget slots
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-30 04:46:07 +03:00
Ivailo Monev
964f78287f kio: call QMimeData constructor in KUrlDragPushButton::dragObject()
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-29 20:54:14 +03:00
Ivailo Monev
1a45508306 kdecore: reimplement KLocale
by using QLocale in KLocale and separating the date, time and numbers
conversion from translation KLocale actually gets extended locale
support from QLocale (which uses CLDR data v43 currently). translation
remains unaffected. for comparison here is the result of two function
calls the result of which should explain the whole change:
KLocale::allLanguagesList().size() = 669
KLocale::installedLanguages().size() = 68

the first number is locales Katie supports, the second being the
number of languages Katana is translated into

KSwitchLanguageDialog needs a rewrite but that is on the TODO

also copyrighting KCatalog to me because I rewrote it, for reference:
881b47b8ea

KCalendarSystem gets the middle finger - batteries not included for date
and time. extra calendar systems can, but are unlikely to be, supported
in the future

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-26 23:50:18 +03:00
Ivailo Monev
53a5c81a3a kio: minor KRecentDocument::recentDocuments() optimization
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-21 01:46:20 +03:00