Commit graph

257 commits

Author SHA1 Message Date
Ivailo Monev
d1733d8914 kdecore: keep reference to the QByteArray object in KStandardDirs::realFilePath()
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-05-23 12:00:08 +03:00
Ivailo Monev
4621f48a1c kdecore: rework KThreadPool::waitForDone() to not lock
also active and queued threads remain unchanged by the method, events
processing continues too (at a certain interval)

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-05-19 10:22:28 +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
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
ec7b5bd959 kdeui: new KDebugger class
I've had the idea about it in my head for years

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-04-26 07:43:17 +03:00
Ivailo Monev
9d2994fad0 kdecore: start as many threads as possible from the queue of KThreadPool
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-04-20 17:32:44 +03:00
Ivailo Monev
e75bf1747a kdecore: const-ify KThreadPool::setMaxThreadCount() argument
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-04-19 22:59:09 +03:00
Ivailo Monev
941a85507b kdecore: reject invalid threads count from KThreadPool::setMaxThreadCount()
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-04-19 22:57:35 +03:00
Ivailo Monev
5f23665baa kdecore: use regular integer for the active threads counter in KThreadPool
with KThreadPool being mutex-locked it should not be subject to
race-condition

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-04-18 07:06:00 +03:00
Ivailo Monev
632dd982df plasma: remove redundant KThreadPool::setMaxThreadCount() call
KThreadPool uses the same value by default

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-04-18 06:40:49 +03:00
Ivailo Monev
ecd57181ea kdecore: delete the threads from KThreadPool
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-04-18 06:37:12 +03:00
Ivailo Monev
2f485d5376 generic: replace QThreadPool and QRunnable with custom class
on a side note it does not solve any thread-safety issues, such are out
of the scope of the class

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-04-18 03:05:03 +03:00
Ivailo Monev
f4c2f5c84e generic: drop stylesheet support
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-04-16 04:31:21 +03:00
Ivailo Monev
b9ccbf8b72 kdecore: take a shortcut in kInitAddLibraryAndPluginPaths() function
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-04-15 07:07:39 +03: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
6b75a23901 kdecore: remove warning about kglobal header
I do not guarantee compatibility between releases, no file should be copied
without the tought that the person that does it takes over maintainership
(i.e. I take no responsibility for what someone else does)

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-03-22 11:04:18 +02:00
Ivailo Monev
5aedcbe444 kdecore: log debug message from KAuthorization::isAuthorized() to the proper debug area
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2024-03-14 22:35:40 +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
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
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
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
acdc2e7acf kdecore: typo
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-27 21:09:07 +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
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
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
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
468c9dc431 kdecore: KAboutLicense::byKeyword() optimization
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-15 01:42:07 +03:00
Ivailo Monev
300da74a3f kdeui: drop support for restoring more than one KMainWindow-dervice classes
unused feature

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-11 12:12:59 +03:00
Ivailo Monev
7dee8c8183 kdecore: remove TODOs for KAboutData enums
unless KAboutLicense is merged into KAboutData that cannot happen because
KAboutData has getters that use the enums

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-11 11:52:31 +03:00
Ivailo Monev
ca00fba4ed kdecore: format and indent
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-10 21:03:14 +03:00
Ivailo Monev
ab05f3c60d kdecore: format and indent
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-10 20:47:11 +03:00
Ivailo Monev
d181c8678c kdecore: do not deep-copy the QString objects in KAboutData::translators()
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-10 20:10:09 +03:00
Ivailo Monev
d55f6589fb kdecore: remove custom license support leftovers
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-10 20:08:54 +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
bd063c8b56 generic: remove dead and irrelevant links references
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-10 14:26:19 +03:00
Ivailo Monev
ef262ab3bd kdecore: remove unused variable in lookupPrefix() function
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-06 20:11:24 +03:00
Ivailo Monev
2647be1ab2 kdeui: KCrash rewrite
a crashed program trying to restart itself is very unreliable,
especially program that uses KUniqueApplication instance. so, instead
all the information about the crash shall be written to a file on the
disk (in the temporary directory) and read by external kcrash KDED
module that will report the crash (possibily even upload the crash
details somewhere) and restart the program as necessarry.

this also opens up possibility for per-application configuration for
things such as the automatic restart feature but that shall be done by the
kcrash KDED module instead (parsing a config from a crashed program is
not a good idea)

KCrash::NoRestart will be unused but kept for future expansion

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-03 11:21:41 +03:00
Ivailo Monev
899f789b07 kdecore: move KToolInvocation to kdeui
to get rid of the KApplication signal which is a hack really

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-31 08:09:02 +00:00
Ivailo Monev
1e3041061a kdecore: fix regression since 0b9281b360
also adjust KLocalizedString test case, "Job" is no longer translated
string in the source code thus not in the french translation

on a side note there are KLocale tests all around - KLocalizedString, KIO
tests, etc. so perhaphs only quircks should be tested by the KLocale
specifiec tests

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-28 06:02:28 +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
382fd80484 kdecore: fix KStandardDirs thread-safety issues
managed to bust it with some proper threading (see KFilePreviewJob on the
kfilepreview branch)

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-19 09:06:47 +03:00
Ivailo Monev
cd8ab8d93e kdeui: do not fork from KUniqueApplication
simplifies startup notification for example, external applications that
pass the "nofork" argument may fail (not uncommon to be passed to
konsole)

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-13 17:32:37 +03:00