Commit graph

1248 commits

Author SHA1 Message Date
Ivailo Monev
ff97198317 kdecore: unit conversion classes optimization
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-09-27 20:50:15 +03:00
Ivailo Monev
2cdc9837a9 kdecore: compare units case-insensitively in unit conversion classes
on a side note: the old KUnitConversion implementation was not thread-safe
and was causing plasma-desktop crashes because it was used in the weather
and unit conversion applets, that is no longer the case tho

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-09-26 14:27:13 +03:00
Ivailo Monev
34ac1b5863 kdecore: PCI IDs database update
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-09-24 00:23:55 +03:00
Ivailo Monev
ca2afde49f kdecore: use qHash() to make lock name
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-09-20 12:13:01 +03:00
Ivailo Monev
88394f1a7f kdecore: use QCryptographicHash::hash() to make lock name
converting the file to hex can result in way too long file name and
infinite loop in KLockFile::lock()

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-09-20 12:04:51 +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
32f73a6c6f kdecore: remove now unused KAUTHORIZATION_TIMEOUT and header inclusion
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-09-09 07:16:04 +03:00
Ivailo Monev
5cd906e4f9 kdecore: do not call the helper asynchronously from KAuthorization::execute()
racy-racy..

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-09-09 07:10:38 +03:00
Ivailo Monev
85d6590693 kdecore: remove unused system signal header inclusion in klockfile_unix source file
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-09-09 01:06:54 +03:00
Ivailo Monev
95a8be4470 kdecore: rewrite KLockFile
the PID check was racy, bonus points for not writing data at all to the
lock and not reading it meaning less disk I/O

oh, yes - by using O_CLOEXEC the lock is stale-safe

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-09-09 00:46:42 +03:00
Ivailo Monev
8d3250d896 kdecore: log debug message before and after the call in KAuthorization::execute()
otherwise it is bombardment of messages if the KAuthorization area is enabled

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-09-08 06:24:09 +03:00
Ivailo Monev
3e5ec11092 kdecore: use KLockFile instead of service check in KAuthorization
the service check is racy, KLockFile is as not (assuming the combination of
O_EXCL and O_CREAT is not racy which is not KLockFile's responsibility)

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-09-08 03:14:17 +03:00
Ivailo Monev
60a5b15a39 kdecore: reduce the KAuthorization helper delayed stop time to 100ms
the sooner the better

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-09-08 00:08:21 +03:00
Ivailo Monev
8ac9b27855 generic: don't sleep while waiting for D-Bus replies
waiting for D-Bus replies to finish is enough business

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-09-07 21:44:47 +03:00
Ivailo Monev
d254c051ed kdecore: do not insert the solid_qt catalog by default
that means to get the translations linking to solid library or calling
KGlobal::locale()->insertCatalog("solid_qt") is required

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-09-03 02:20:43 +03:00
Ivailo Monev
387bdaa93f generic: drop support for BrowserApplication config option
browser shall be determinted by the preferred service for "text/html",
"application/xhtml+xml" or any other MIME type for it (that includes
scheme handlers)

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-31 21:22:56 +03:00
Ivailo Monev
7f628f95f6 kdecore: pass the QByteArray objects size to QString constructors in KCmdLineOptions and KLocalizedString
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-30 21:23:50 +03:00
Ivailo Monev
a09cf5455a kdecore: remove references to khotkeys
note the check if khotkeys is automatically started - it was a KDED module
not started because of XDG autostart desktop file

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-30 00:08:53 +03:00
Ivailo Monev
7cb0785160 kdecore: add note about QDialog::exec() to the alarm() call in KDebugMessageBoxDevice::writeData()
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-29 00:24:31 +03:00
Ivailo Monev
ac69de425c kdecore: create the global KDirWatch instance on demand
Q_GLOBAL_STATIC() no longer creates instance on demand

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-28 20:59:11 +03:00
Ivailo Monev
cc6903476e kdecore: new KDirWatch methods to get and set the poll interval
requires the following commit from the Katie repo:
4795a577bff4f9db89c77195df763575a602bcc3

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-28 20:58:06 +03:00
Ivailo Monev
6c5b16e503 kdecore: remove unused and redundant KStringHandler::isUtf8() and KStringHandler::from8Bit() methods
use QTextCodec::codecForText() and QTextConverter instead

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-28 03:32:57 +03:00
Ivailo Monev
7145876ebd generic: format and indent
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-28 03:25:39 +03:00
Ivailo Monev
acdc2e7acf kdecore: typo
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-27 21:09:07 +03:00
Ivailo Monev
453680e04d kdecore: do not store the KCatalog object as KuitSemantics member
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-27 20:46:25 +03:00
Ivailo Monev
97b1ea46c1 kdecore: log KSystemTimeZones and KTimeZone messages to the correct debug area
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-27 05:45:50 +03:00
Ivailo Monev
b2db2e1c36 kdecore: update description of kpty debug area
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-27 05:41:32 +03:00
Ivailo Monev
ef013e9da7 kdecore: add debug area for kglobalaccel
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-27 05:08:19 +03:00
Ivailo Monev
930066e070 kdecore: KTimeZone documentation review
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-26 08:42:49 +03:00
Ivailo Monev
0bb76f27f9 kdecore: KService::mimeTypes() and KServicePrivate::serviceTypes() optimization
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-26 04:55:42 +03:00
Ivailo Monev
78493ea034 kdecore: USB IDs database update
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-26 01:18:31 +03:00
Ivailo Monev
5cc7e3255b kdecore: log debug message from KDBusConnectionPool::isServiceRegistered() when service is registered
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-25 20:33:41 +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
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
6fe3dbfa76 kdecore: remove reference to non-existing command line options
KUniqueApplication no longer has additional command line options

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-23 21:58:05 +03:00
Ivailo Monev
d281fc7b64 kdecore: create the initial KTimeZone transition date in UTC spec
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-23 00:15:19 +07:00
Ivailo Monev
3dbd7b1da9 kdeui: do not apply style and palette from KGlobalSettings
palette and style shall be applied by the platform plugin, the font is
independant of the full Katana session (look for
KGlobalSettings::generalFont() for example, font from config is used here
and there because the config and thus KGlobalSettings offer fine grained
font selection for different purposes)

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-21 17:42:31 +03:00
Ivailo Monev
7694eb70ba kdecore: bump ksycoca version
because a50c72de91

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-20 19:30:40 +03:00
Ivailo Monev
8bc18c9962 kdecore: do not output entities from KCmdLineArgsStatic::parseAllArgs()
the output goes to the TTY and there is no rich text handler there, note
that the plain format for the "email" tag also contained entities (even
before the KuitSemantics reimplementation)

because the plain format for the "email" tag

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-20 19:20:12 +03:00
Ivailo Monev
f56c50e41a kdecore: drop redundant "emphasis" markup tag
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-19 23:28:54 +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
ddc3476e83 kdecore: KuitSemantics::format() optimization
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-18 23:38:25 +03:00
Ivailo Monev
5e6bc849e0 kdecore: break once format matches the context in KuitSemantics::format()
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-18 23:31:36 +03:00
Ivailo Monev
76ced36171 kdecore: KuitSemantics::format() optimization
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-18 20:04:16 +03:00
Ivailo Monev
591849f4e2 kdecore: KLocalizedString documentation review
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-18 18:55:51 +03:00
Ivailo Monev
53cef8e793 kdecore: break the tag search on bogus tag in KuitSemantics::format()
because the tag will not be replaced in that case and will result in
infinite loop otherwise

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-18 01:02:51 +03:00
Ivailo Monev
cef5ea6e46 kdecore: drop non-operational "application" markup tag
it was not applying any formatting before the reimplementation thus it is
simply redundant

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-18 00:55:14 +03:00
Ivailo Monev
686ba65a7e kdecore: drop redundant "para" markup tag
not used in plain context, same as "p" in rich context. also now Katie will
detect the paragraphs as rich text

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-18 00:39:06 +03:00
Ivailo Monev
ae66400fc7 kdecore: drop redundant "nl" markup tag
not used in plain context, same as "br" in rich text

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-17 23:34:50 +03:00
Ivailo Monev
f1217c0e64 kdecore: likely KuitSemantics::format() branch optimization
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-17 23:08:48 +03:00