Commit graph

5536 commits

Author SHA1 Message Date
Ivailo Monev
7697b90bb2 kutils: implement KArchive::data() argument to limit the data size
to be used (for example) in MIME type determination, i.e. read only a small
chunk of the data

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-05-18 05:13:02 +03:00
Ivailo Monev
6f968d6f03 kutils: skip the data when the path does not match in KArchive::data()
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-05-18 05:12:00 +03:00
Ivailo Monev
969f3e428e kdecore: optimize KMimeType::findByContent()
read once, match until match is found or otherwise. that means less disk
I/O

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-05-18 05:02:20 +03:00
Ivailo Monev
ddbcca439d kutils: implement option to not show the message box about passwords not being stored permanently
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-05-17 16:05:09 +03:00
Ivailo Monev
198997f5e1 kdecore: interrupt lock attempts from KLockFile destructor
every while loop should have interrupt point, this one did not

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-05-17 14:39:15 +03:00
Ivailo Monev
922d02660b kdecore: cache KMimeType pointers
that means less parsing of the xml files overall, trading memory usage for
processing

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-05-17 08:33:57 +03:00
Ivailo Monev
11b5a43a53 kio: MOC warning fix
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-05-17 08:14:42 +03:00
Ivailo Monev
3ebc020de4 kio: remove methods that are not implemented
the compiler is supposed to catch such errors (e.g. wrong type passed to
the method)

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-05-17 07:46:17 +03:00
Ivailo Monev
7e3698a667 kparts: move variable to the scope it is used in
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-05-17 07:45:32 +03:00
Ivailo Monev
06654a1bbd kinit: ensure the startup timeout is atleast 1 second
has to be done in the KCM too

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-05-17 07:32:55 +03:00
Ivailo Monev
50a9aa403b plasma: proxy QTreeWidget instead of QTreeView
much more convenient, already testing it via experimental lsof applet

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-05-17 05:01:42 +03:00
Ivailo Monev
c72478ab01 kinit: check the process exit code on state change
for flexibility

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-05-16 06:33:13 +03:00
Ivailo Monev
71704a410d kparts: query the part to close from KParts::MainWindow
because KParts::ReadWritePart::closeUrl() is not called from the
KParts::ReadWritePart destructor (and even if it is bad stuff may happen)
for most rw parts (exception being okular which does its own query, maybe
some other parts too) saving was not actually done (e.g. for ark). now the
part will be queried to close, if the upload job fails (e.g. because of
insufficient access) the application/part will not close (intentionally)
tho and no error is reported via message box which is something that needs
to be looked into

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-05-16 06:31:19 +03:00
Ivailo Monev
8c8855d9a6 generic: drop temporary file option
any program launched with temporary file (as per the spec) argument
(because it does not support %u or %U) should not be responsible for
deleting the file, klauncher already handles that thus the option is
redundant. I don't know how other implemenatations (of program launchers)
do it but I cannot say I care either

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-05-16 01:37:20 +03:00
Ivailo Monev
c91e594827 kutils: start kcmshell4 via KToolInvocation::startProgram()
for consistency

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-05-16 01:21:02 +03:00
Ivailo Monev
a32a58d0fc kdeui: remove redundant check for appIconName property
not set now

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-05-14 12:12:43 +03:00
Ivailo Monev
381ab0a324 kio: wake up the slave before terminating it
otherwise (apparently) sending SIGTERM is not doing anything

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-05-14 11:54:19 +03:00
Ivailo Monev
9530356389 kio: use smaller type for sending KIO::JobUiDelegate::MessageBoxType type
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-05-14 09:02:23 +03:00
Ivailo Monev
e4ce49f138 kio: use the macro for sending data in KIO::SlaveInterface::setConfig()
no functional change

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-05-14 08:58:36 +03:00
Ivailo Monev
be70ca9e8c kdeui: use KKeyServer::keyQtToCodeX() for the key to keycode conversion in kGrabKey()
libhotkeys was using it and it does some tricks such as adding shift mod
for captical letters

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-05-14 02:30:14 +03:00
Ivailo Monev
76537cfbf6 kutils: make it clear that it is inhibition reply in the warning message
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-05-14 00:50:56 +03:00
Ivailo Monev
24336de9b9 kio: KIO::NetAccess review
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-05-13 23:25:10 +03:00
Ivailo Monev
7f261aca95 kdecore: new KTemporaryFile::urlPath() method
based on the bits in kparts/part.cpp

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-05-13 22:52:30 +03:00
Ivailo Monev
75eeefb652 kio: format and indent
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-05-13 08:50:41 +03:00
Ivailo Monev
c40e6014ce kio: preserve the extension from KIO::NetAccess::download()
it was done by kioexec which KRun was using but now everything that uses
KIO::NetAccess::download() benefits from better MIME type detection (e.g.
inkscape used to fail to detect the image format because the temporary file
was lacking extension)

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-05-13 08:30:31 +03:00
Ivailo Monev
c8304a4da7 kinit: do not use the program arguments to check for remote URLs
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-05-13 08:04:39 +03:00
Ivailo Monev
cfceb37f62 kio: log debug messages when terminal or kdesudo is not found
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-05-13 07:53:16 +03:00
Ivailo Monev
292b85fb94 kio: rename KRun::isExecutable() argument
it is not service type, is it?

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-05-13 07:51:10 +03:00
Ivailo Monev
2ab6930a94 kio: KRun documentation review
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-05-13 07:44:48 +03:00
Ivailo Monev
3523b1baa9 kinit: de-duplicate code
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-05-13 07:44:30 +03:00
Ivailo Monev
bc9f3cf339 kinit: download remote URLs for services lacking support for such
now klauncher has all required features (by the spec) and then some

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-05-13 07:32:39 +03:00
Ivailo Monev
3fb2096129 kio: remove redundant KDesktopFileActions::userDefinedServices() overload
there is one convenience overload already

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-05-13 06:14:23 +03:00
Ivailo Monev
0364baa81f kio: remove unused KDesktopFileActions::userDefinedServices() argument
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-05-13 05:53:13 +03:00
Ivailo Monev
9874c20d80 kinit: report failure to start program based on its exit code
assuming 0 means success and anything else failure, unifdef for example
exits with exit code 1 if the output is different tho so there are
exceptions to it

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-05-13 05:14:10 +03:00
Ivailo Monev
39320266cc kinit: error out when services do not support remote URLs and one is detected
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-05-13 04:47:21 +03:00
Ivailo Monev
85cf5851bd kio: handle terminal and UID substitution options in KRun::processDesktopExec()
much like the old implementation except that empty QStringList is returned
if either terminal or kdesudo is required but not found, ideally errors
should be reported by klauncher when that is the case

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-05-12 21:53:27 +03:00
Ivailo Monev
7c88e24338 kdecore: debug areas update
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-05-12 21:00:39 +03:00
Ivailo Monev
576547a069 kdecore: debug areas update
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-05-12 20:59:45 +03:00
Ivailo Monev
95bdfc72a7 plasma: setup icons for the next and previous widget containment actions
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-05-12 23:36:05 +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
3c96458087 kio: rework KRun::processDesktopExec() to account for empty list of URLs and not join the URLs into single argument
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-05-12 18:28:08 +03:00
Ivailo Monev
fdc8dc967b kdecore: KMimeType compat bits
from the following commit:
817b7a4aab

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-05-12 17:57:55 +03:00
Ivailo Monev
9a996146af kdeui: check the filter pointer before using it in KGlobalAccel
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-05-12 17:25:56 +03:00
Ivailo Monev
e19f1d01f5 kinit: check only if the MIME type is executable
to be able to run services for files that have the executable bit set but
are not actually programs

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-05-12 16:30:19 +03:00
Ivailo Monev
3dc31e41cb kdeui: KToolInvocation review
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-05-12 15:22:30 +03:00
Ivailo Monev
ae72f73768 kdeui: simplify KToolInvocation::invokeMailer()
thunderbird for one accepts a single URL (which probably is split into bits
and checked for query items). it does not have "t", "s", etc. placeholders
in its .desktop file so that whole map thing is not really working well

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-05-12 15:04:52 +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
ecef0ed675 kinit: remove exec_blind method from the D-Bus interface
no longer used by any other program

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-05-12 14:08:08 +03:00