Commit graph

540 commits

Author SHA1 Message Date
Ivailo Monev
9fb18a72e5 kutils: drop unused KPasswdRouletteDialog class
was experimental

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-05-18 23:21:27 +03:00
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
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
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
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
fa41515d34 kutils: lock from all KPasswdStore methods
also the implementation internally opens the store if it is not open
already

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-05-12 07:58:51 +03:00
Ivailo Monev
ceaddee1dd kutils: check if the avahi client pointer is null before using it in KDNSSD
should fix crashes due to internal avahi asserts in some cases (e.g. when
the daemon is not running)

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-05-10 23:05:13 +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
b3c1452d4e kutils: attempt to re-open the password store after the timeout
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-05-05 07:34:44 +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
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
103bc5a7d9 kutils: check the read result in KArchivePrivate::writeFile()
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-05-03 20:35:27 +03:00
Ivailo Monev
053420e816 kutils: read data from files and write it to archive in chunks
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-05-03 08:13:57 +03:00
Ivailo Monev
c303467164 kutils: drop unused classes
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-04-17 03:52:20 +03:00
Ivailo Monev
94733df29a kutils: implement Qt::ToolTipRole for the KPluginSelector model
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-04-11 17:21:44 +03:00
Ivailo Monev
f31b45f071 kutils: return the plugin name from the custom role of the KPluginSelector model
that way it can be used for some magic because plugin names are easier and
more reliable to use in comparison

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-04-11 16:31:49 +03:00
Ivailo Monev
3d311955ab kdeui: drop KRichTextEdit and KRichTextWidget
because KTextEdit inherits QTextEdit it is rich text-capable and the
actions that KRichTextEdit and KRichTextWidget provide are not used
anywhere (the actions require explicit setup)

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-04-06 21:01:01 +03:00
Ivailo Monev
bac4fbc947 kutils: do not lookup TXT records from KDNSSD
irrelevant to it

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-04-06 16:52:45 +03:00
Ivailo Monev
6d1d1b7112 kutils: sync password store on write
in case kded crashes for example

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-03-30 14:08:53 +02:00
Ivailo Monev
cf842d6705 kutils: ensure the initial KDecompressor buffer size is never zero
fixes decoding of long xz data

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-03-23 08:51:49 +02:00
Ivailo Monev
75b9cfddd3 generic: const-ify private data pointers where copying is disabled
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-03-23 06:49:59 +02:00
Ivailo Monev
39ebfa6fd4 kutils: disable copying of KEMailSettings
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-03-23 06:49:09 +02:00
Ivailo Monev
70d01331b7 kutils: KCompressor and KDecompressor optimizations
notably for the case of processing data multiple times with the same
KCompressor/KDecompressor object

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-03-22 12:25:43 +02:00
Ivailo Monev
6063b39cb2 kutils: easier to change KDecompressor limit
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-03-22 12:18:41 +02:00
Ivailo Monev
ecd08e8f97 kutils: remove reference to dead links
have to keep an eye on those, servers tend to die

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-03-22 01:46:50 +02:00
Ivailo Monev
6b5605a0a0 kutils: KDecompressor optimization
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-03-21 19:10:31 +02:00
Ivailo Monev
b9deac7325 kutils: use KSettings to get the cookie type from getCookie() function
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-03-21 04:01:23 +02:00
Ivailo Monev
1a3f533744 kutils: do not reparse the kpasswdstore config on get and set
with password stores being giant-locked (so that opening password stores
happens once even with multiple attempts to open before the first has
finished) it can be assumed that kpasswdstore has not been tempered with
even tho that may not hold true (it can be manually edited via text editor
but do not expect support for that)

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-03-21 03:56:04 +02:00
Ivailo Monev
5064d34b04 kutils: correct placeholders in getLockName() function
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-03-16 21:20:41 +02:00
Ivailo Monev
a72d1f48ce kutils: adjust to Katie changes
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-11-05 00:29:10 +02:00
Ivailo Monev
47c8c442c2 kutils: rename kpasswdstore data file
not ending with "rc" as such files are config files while the kpasswdstore
is stored data file (like kweatherdata of plasma weather applet)

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-10-23 12:18:46 +03:00
Ivailo Monev
e5557c33dc kutils: set the audio-client-name property for KAudioPlayer and KMediaPlayer to the player ID
see the mpv options manual about it

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-09-20 16:18:36 +03:00
Ivailo Monev
c4ae9e0460 kdecore: save lock files in the global temporary directory
O_CLOEXEC won't do it but saving the locks in /tmp or other directory that
is purged across reboot will remove stale locks

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-09-09 21:16:04 +03:00
Ivailo Monev
086e08f00a kutils: start counting from 1 in KPowerManagerInhibitImpl::Inhibit()
because 0 should be invalid cookie, much like the inhibition cookie of the
org.freedesktop.ScreenSaver interface

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-09-03 16:56:56 +03:00
Ivailo Monev
9195193191 kutils: log debug messages when there is no valid inhibition interface
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-09-03 16:33:03 +03:00
Ivailo Monev
a39e7777ea kutils: show notification after switching power management profile
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-09-03 04:00:12 +03:00
Ivailo Monev
e482da9067 kded: rework phases logic to take any desktop session into account
much like XDG autostart except for KDED modules, requires adjustments to
modules that are automatically loaded in phase-1

in the future the logic may apply not only to modules during startup but
also when attempting to load a module in general

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-31 23:01:34 +03:00
Ivailo Monev
099f49db36 generic: replace QLabel with the new KPixmapWidget class
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-29 18:06:09 +03:00
Ivailo Monev
6f03a3127c kutils: typo
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-27 03:09:25 +03:00
Ivailo Monev
856b853b89 kutils: de-duplicate KAudioPlayerModule code
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-26 20:15:29 +03:00
Ivailo Monev
4a40419a35 kutils: disable copying of KAudioPlayer, KMediaPlayer and KMediaWidget
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-26 17:15:38 +03:00
Ivailo Monev
11f6e4b586 kutils: set the ID of the KAudioPlayer from the KDED module
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-25 22:08:15 +03:00
Ivailo Monev
450120097d kdeui: reimplement KNotification
cleaning up the mess, everything but KNotificationConfigWidget is
implemented.

not only does it not require additional D-Bus service (knotify) to
function but also does not transmit pixmaps over D-Bus, the features
to execute command or log to file are dropped and will not be
implemented.

also about markup support in notifications - if the server does not
support markup then it is supposed to strip it, see the spec:
https://specifications.freedesktop.org/notification-spec/notification-spec-latest.html#backwards-compat
meaning nothing should be done by KNotification itself because it is not
a server, it is just a proxy.

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-25 09:01:39 +03:00
Ivailo Monev
79b9c8d634 kutils: check if there is plugin for the images from the KExiv2 test
fixes test failures in case the jpg plugin is not installed

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-23 01:43:38 +03:00
Ivailo Monev
553608ca41 kutils: someone's typo
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-11 18:25:19 +03:00
Ivailo Monev
fa51ecdfaf kdecore: remove unused KAboutData methods and redundant constructor arguments
the homepage and the bugs email address shall always be defined in
kglobalsettings header for official Katana applications, libraries, etc.
the option to override them is still a thing

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-10 17:41:54 +03:00
Ivailo Monev
6a07ac897c kutils: typos
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-09 16:17:27 +03:00
Ivailo Monev
b596272f8a kutils: static analyzer warning fix
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-09 14:50:34 +03:00
Ivailo Monev
6d0274d417 generic: adjust to Katie changes
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-06 23:37:03 +03:00