Commit graph

1073 commits

Author SHA1 Message Date
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
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
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
06cafdba67 kio: default to the locale encoding in KIO::SlaveBase
as is done in KIO::Scheduler

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-05-12 12:45:30 +03:00
Ivailo Monev
6af1008bc5 kio: kill slaves from KIO::Scheduler destructor
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-05-12 09:13:21 +03:00
Ivailo Monev
45324eac58 kio: show stat() progress after 3 seconds for remote files
the magic of timers! continue from 5ae8fe637e

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-05-12 08:34:43 +03:00
Ivailo Monev
5ae8fe637e kio: hide of progress of stat() jobs done by KIO::NetAccess
now that stat() is used for MIME type determination it is used in lots of
places and progress should not be shown more often than it should

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-05-12 07:20:35 +03:00
Ivailo Monev
dfd76bcd04 kio: remove the job from the queue and unlock the mutex on failure to create the slave
if the mutex is not unlocked deadlock occurs, if the job is not removed
from the queue it will be attempted to start it again

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-05-12 06:10:08 +03:00
Ivailo Monev
5f43d4a86c kio: KRun documentation update
other misc changes were made while at it, .gitexcludes had executable
bit set..

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-05-12 05:50:57 +03:00
Ivailo Monev
1a29d6bb3b kio: check if the URL is directory before checking permissions in KRun::isExecutableFile()
as the KRun::isExecutableFile() method name implies - it is only for
checking files

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-05-12 04:26:15 +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
e6666ee203 kio: remove now unused KCModuleInit service type
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-05-10 03:36:35 +03:00
Ivailo Monev
0e0db0b815 kdeui: move session management to KApplicaiton
every comment about X11 and session management in general claims it was
broken, not going to claim otherwise. everything that does not use
KApplication shall not be involved into session management now and gets
the middle finger (SIGTERM or SIGKILL) after 5 sec by klauncher when the
session is done

also session management has to be explicitly enabled by applications
now, disabled by default

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-05-09 08:29:51 +03:00
Ivailo Monev
3716b1ffe5 kutils: allow storing and retreiving of temporary passwords via KPasswdStore
the implementation supports it and KIO now uses that feature

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-05-05 07:22:39 +03:00
Ivailo Monev
dfc39666d2 kio: remove unused member
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-05-05 04:48:20 +03:00
Ivailo Monev
22c025def4 kio: reduce the job queue timeout
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-05-04 22:35:16 +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
6820e4e63c kioslave: different take on MIME type determination in curl slave
because FTP and SFTP are special about it so is the MIME type
determination

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-05-04 04:03:02 +03:00
Ivailo Monev
954e45641e kio: format and indent
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-05-03 20:35:43 +03:00
Ivailo Monev
59f92c0970 generic: compiler warning fixes
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-05-03 20:21:35 +03:00
Ivailo Monev
71151f9f6f kio: PasteDialog review
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-05-03 20:05:39 +03:00
Ivailo Monev
19a06b0e06 kio: add the missing PasteDialog bits
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-05-03 20:02:25 +03:00
Ivailo Monev
eae52fd950 kio: log the job priority in KIO::Scheduler
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-05-03 19:55:21 +03:00
Ivailo Monev
b75ced4491 kio: drop redundant KMessageBoxWrapper class
KRun for one uses KMessageBox here and there anyway

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-05-03 19:44:36 +03:00
Ivailo Monev
e4fbbef130 kio: move private KIO::PasteDialog class where it belongs
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-05-03 11:27:37 +03:00
Ivailo Monev
da0271810a kio: minor KIO::Scheduler optimization
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-05-03 10:24:36 +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
6f38be8580 kio: remove unused typedefs
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-05-03 09:27:45 +03:00
Ivailo Monev
f88f9f9b13 kio: KIO::SlaveInterface review
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-05-03 09:27:34 +03:00
Ivailo Monev
da1448658a kio: suspend slaves to prevent data going in or out
that design flaw needs a proper fix but it will not happen until I rewrite
everything job-related

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-05-03 09:13:47 +03:00
Ivailo Monev
c560428d0d kio: remove KIO::SlaveBase compat bits
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-05-03 07:30:00 +03:00
Ivailo Monev
4cbd252f74 kio: require all KIO::SlaveBase::send() arguments
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-05-03 07:25:04 +03:00
Ivailo Monev
1fc61ea965 kio: easier to cope job and scheduler commands
commands are integers and logged as such from debug messages for example

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-05-03 07:18:42 +03:00
Ivailo Monev
25bcc606ca kio: merge enums for communication between KIO::SlaveBase and KIO::SlaveInterface
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-05-03 07:12:15 +03:00
Ivailo Monev
fa38c2ec13 kio: bring back the slaves reusability feature
only this time the missing feature to unmark slaves as idle and not mess
up the command queue is there

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-05-03 06:21:18 +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
8f72524923 kio: remove non-operational KIO::FileUndoManager bits
yep, half of that class was non-operationl

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-05-03 01:23:47 +03:00
Ivailo Monev
f598f0efbf kio: emit slave processed size data as it arrives
because the speed is based on the processed size, for it to be precisely
calculated for 1sec (or whatever the speed timer may be in the future)
it better be emitted as often as it arives from the slave

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-05-02 22:31:47 +03:00
Ivailo Monev
5cf8aa96b9 kio: rename Charsets metadata to Charset
because in configs (e.g. written by dolphin) it is "Charset", less
confusion

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-05-02 22:19:07 +03:00
Ivailo Monev
374d63e359 kio: remove now unused KIO::SlaveInterface methods
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-05-02 22:06:22 +03:00
Ivailo Monev
6954447bf9 kio: correct metadata check in KIO::SlaveBase
was incorrect even prior to 97e7649bd3

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-05-02 21:57:06 +03:00
Ivailo Monev
dde3b7eb82 kio: do not assume Charset metadata is not empty in KIO:SlaveBase
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-05-02 21:53:40 +03:00
Ivailo Monev
97e7649bd3 kio: drop KRemoteEncoding class
can be done by slaves via custom QTextConverter or whatever, the
converter is using Charset metadata and the KRemoteEncoding class is not
required outside the slaves

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-05-02 21:47:54 +03:00
Ivailo Monev
1a5f247e86 kio: remove redundant KIO::SlaveBase methods
assume there is no metadata if empty, otherwise it is 2x the trip - one
time to check and one time to get the metadata

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-05-02 21:27:30 +03:00