Commit graph

213 commits

Author SHA1 Message Date
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
Ivailo Monev
ee1aa40904 kdecore: drop support for KStandardDirs kcfg resource
kcfg files are resources much like .ui files - not ment to be installed,
used only to generate .cpp and .h files from them. they are not used at
runtime altough Plasma::ConfigLoader does use its format to load files
for configuration purposes (files named main.xml shipped by plasmoids)

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-09 05:48:31 +03:00
Ivailo Monev
85205ccecf kio: log KRecentDirs and KRecentDocument actions
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-03 11:28:00 +03:00
Ivailo Monev
fab969cf3e kdecore: remove most of the KUrl compat methods
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-06-23 12:26:07 +03:00
Ivailo Monev
e5f56675d2 generic: call QCoreApplication::applicationName() as static method
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-06-19 01:19:01 +03:00
Ivailo Monev
dc208c52fd generic: update references to shared data directory
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-06-18 00:20:22 +03:00
Ivailo Monev
36c910c653 generic: move stuff from KDE4Internal module to KDELibs4Config
large-scale changes to the build system, nothing a user sees tho - it is
all under the hood

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-06-17 19:01:40 +03:00
Ivailo Monev
e978590acd generic: define KDE_DEFAULT_DEBUG_AREA in the main build file for each library
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-06-09 23:43:20 +03:00
Ivailo Monev
3556eede0f kdeclarative: log script engine exceptions as debug messages
the declarative component logs some as warnings and does not have a
QScriptEngineAgent-like class

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-05-19 06:19:51 +03:00
Ivailo Monev
6dee9f8f51 kdecore: tweak KToolInvocation sleep time
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2022-12-20 15:45:00 +02:00
Ivailo Monev
61709722d0 kdecore: remove now unused no-wait/blind option of KToolInvocation
KToolInvocation processes application events now (see
4fb8a1d674)

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2022-12-20 15:40:32 +02:00
Ivailo Monev
3f6cf6a428 kdecore: KToolInvocation review
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2022-12-19 16:53:33 +02:00
Ivailo Monev
4fb8a1d674 generic: call klauncher methods asynchronously from KToolInvocation
so that application event processing is not blocked by any
KToolInvocation method, the D-Bus service name and PID return arguments
are not used anyway so removing them

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2022-12-19 12:44:44 +02:00
Ivailo Monev
ca434f34d8 generic: remove unused QPL license
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2022-12-15 08:49:46 +02:00
Ivailo Monev
cdebf644b6 kdecore: KAuthorization documentation correction
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2022-12-12 14:09:10 +02:00
Ivailo Monev
0ec4349446 kdecore: process events while the helper method is executed
that way the UI will not freeze while the method is executed, beware
signals and slots if you connect it to one (or even more) tho

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2022-12-12 08:44:32 +02:00
Ivailo Monev
3a7b898045 kdecore: KAuthorization documentation update
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2022-12-12 08:31:20 +02:00
Ivailo Monev
90c57ada83 kdecore: unregister the helper service and object from KAuthorization destructor
I should (ab)use the object name for more things

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2022-12-12 08:19:15 +02:00
Ivailo Monev
860137350d kdecore: typo
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2022-12-11 12:23:37 +02:00
Ivailo Monev
fcdcbe612e kdecore: KAuthorization optimization
calling the stop() adaptor method instead of ping() and then stop() saves a
lot of D-Bus round-trips

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2022-12-11 11:34:53 +02:00
Ivailo Monev
0a67ba2ddd kdecore: partially revert 1bd459a073
dead-lock may happen if QStandardPaths (which KStandardDirs uses and
thus KDebug indirectly) warns about something

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2022-12-11 10:18:46 +01:00
Ivailo Monev
1bd459a073 kdecore: log KAuthorization messages to specialized area
that includes Katie messages

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2022-12-11 10:09:33 +02:00
Ivailo Monev
39f0466cac kdecore: convert the QString to QByteArray only once in KGlobalPrivate::initFakeComponent()
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2022-12-11 09:40:37 +02:00
Ivailo Monev
637366d0a1 kdecore: new KToolInvocation::setLaunchEnv() method
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2022-12-08 06:35:30 +02:00
Ivailo Monev
b0b0f528da kdecore: parent the KAuthorization object to the application instance if parent is null
that way it will be deleted before the application instance is plugging
memory leaks

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2022-12-08 01:29:42 +02:00
Ivailo Monev
aa6b5ea4f0 kinit: klauncher and KCrash rewrite
much simpler and easier to maintain, also it will be proper D-Bus
service now with no sockets, process title hack and whatnot. KCrash
and startkde script (in kde-workspace repo) have to be adjusted for
it tho

note that the internal KIO scheduler already has the functionality to
put slaves on hold but now they will be started as detached process.
eventually they may become plugins (they are loaded as such by kioslave
program) without event loop dispatcher

fixes application startup notification (ASN) and cleanup issues

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2022-12-04 23:20:15 +02:00
Ivailo Monev
9b41127ecb generic: prepare for Katie changes
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2022-11-13 00:40:18 +02:00
Ivailo Monev
1039216fd8 kdecore: delete the KDETranslator instance from removeKDETranslator() function
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2022-11-10 14:53:35 +02:00
Ivailo Monev
0b9281b360 kdecore: install and remove KDETranslator via constructor/deconstructor functions
it has to be done only once (because it calls global static to translate),
does not have thread requirement (QCoreApplication locks when installing
or removing translator) and it checks if KGlobal has locale via
KGlobal::hasLocale() to ensure it is not attempting to call
KGlobal::locale() after KGlobal destruction

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2022-11-10 06:51:36 +02:00
Ivailo Monev
e07fc01227 kdecore: return the value of KGlobal::hasLocale() from KDETranslator::isEmpty() and check it from KDETranslator::translate()
fixes possible crash due to accessing the private KLocale data after
destruction

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2022-11-06 10:10:46 +02:00
Ivailo Monev
b8b37e01a3 kdecore: actually install the KDETranslator
was non-operational code due to QT_NO_TRANSLATION being defined in the
kglobal source file for some reason, it has a huge impact on performance
ofcourse because anything Katie will attempt to translate will go trough it

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2022-11-02 11:02:51 +02:00
Ivailo Monev
dd8d6eec75 kdecore: move org::kde::KLauncher ownership to the global KToolInvocation instance
note that there is no main thread requirement, KToolInvocation has one
signal (which is thread-safe) and KToolInvocation::klauncher() remains as
thread-safe as global static

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2022-10-27 08:20:33 +03:00
Ivailo Monev
b873df8bd2 kdecore: pass the size of QByteArray object to QString constructor in KToolInvocation::startServiceInternal()
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2022-10-27 07:57:09 +03:00
Ivailo Monev
90dcd31b77 kdecore: tune busy loops for more throughput
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2022-10-16 20:39:36 +03:00
Ivailo Monev
9bf6e64f13 kdecore: kmail shall parse the URL like other e-mail clients
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2022-10-15 15:23:23 +03:00
Ivailo Monev
4d4957fad4 kdecore: drop support for bcc
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2022-10-15 12:54:55 +03:00
Ivailo Monev
b8f4e8f820 kdecore: remove unsupported KToolInvocation::invokeMailer() argument
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2022-10-15 05:26:31 +03:00
Ivailo Monev
301bc3a1e5 kutils: new kemail library
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2022-10-15 05:03:10 +03:00
Ivailo Monev
99ec1f4186 kdecore: register cache and tmp resources from KStandardDirs constructor
if QStandardPaths::writableLocation() did not create the directories
KStandardDirs::locateLocal() or KStandardDirs::saveLocation() will

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2022-10-11 09:18:18 +03:00
Ivailo Monev
2fd512e502 generic: install modules in subdirectory of the library directory by default
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2022-10-10 15:05:17 +03:00
Ivailo Monev
24b67a85eb kdecore: ensure the lib and module resource directories are in the Katie library search path
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2022-10-10 15:02:53 +03:00
Ivailo Monev
a869da3645 kdecore: deduplicate code by using KStandardDirs::resourceDirs() in KStandardDirs::saveLocation()
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2022-10-10 13:57:52 +03:00
Ivailo Monev
55699fc8a3 kdecore: remove the unused "html" and hidden "home" standard directory resources
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2022-10-10 04:15:48 +03:00
Ivailo Monev
d24dd98aee kdecore: easier to maintain KStandardDirs resources table
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2022-10-09 23:55:09 +03:00
Ivailo Monev
5b6151074a kdecore: remove unused header inclusions in kstandarddirs source file
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2022-10-09 18:54:04 +03:00