Commit graph

1260 commits

Author SHA1 Message Date
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
Ivailo Monev
f8f390c86f kdecore: add "markup" section to the KLocalizedString documentation topics
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-17 23:08:26 +03:00
Ivailo Monev
abf1deffe0 kdecore: oops
automatic sycoca database was disabled while working on
70f9b2f953 for testing purpose

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-17 22:52:36 +03:00
Ivailo Monev
1c6ce50933 kdecore: drop support for overriding numbers localization via numid tag
fun fact: there is CLDR data for ~1000 languages and only ~50 use different
number system (not "latn")

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-17 22:08:20 +03:00
Ivailo Monev
224e42fc3a kdecore: remove unused KLocalizedStringPrivate::substituteSimple() argument
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-17 19:54:31 +03:00
Ivailo Monev
86025d2c8a kdecore: pass the number width and fill character to KuitSemantics from KLocalizedString
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-17 19:43:51 +03:00
Ivailo Monev
528f427c67 kdecore: adjust expected results in KLocalizedString tests
text with "&lt;" in it is considered as rich text by Qt::mightBeRichText()
as special case. also entities are not markup and shall not be handled by
KuitSemantics (there is a class for that - KCharsets). entity is used
only in one place (kde-workspace/kate/part/view/kateviewhelpers.cpp) and it
does not even need special handling by KuitSemantics. so, instead of
slowing the whole markup parsing with redundant and unused feature I've
decided to not support it and even improve Katie's Qt::mightBeRichText()
function

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-17 18:16:26 +03:00
Ivailo Monev
b7b65494a4 kdecore: KuitSemantics optimizations
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-17 14:47:37 +03:00
Ivailo Monev
9a5af1214b kdecore: reimplement KuitSemantics
is interesting how much simpler it can be by assuming that the tags are
strict and by using Qt::mightBeRichText() for the rich text detection.
while mostly compatible (entities are not converted, some tags were not
used and some even did not do anything) it is subject to optimization by
using QStringMatcher or other tricks (like using a separate tag for the
numbers precision)

overall - no regular expression matching, no XML parser is used and does
what the old implementation was doing but with less code. also passes
most tests (the exception is KLocalizedString test case that expect
entities to be replaced)

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-17 01:43:12 +03:00
Ivailo Monev
fd112713d1 kdecore: format and indent
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-16 13:41:23 +03:00
Ivailo Monev
6133f1aaa9 kdecore: PCI IDs database update
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-16 13:31:46 +03:00
Ivailo Monev
70f9b2f953 kdecore: fix KSycoca dummy strategy setup
the device was opened for reading only but for the version to be written
it has to be opened for writing too

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-16 13:27:47 +03:00
Ivailo Monev
8b9b1703aa kdecore: use QPair<T,T> instead of QList<T> for zone coordinates in KSystemTimeZones
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-15 19:55:07 +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
0d2c0aba3f kdecore: remove non-operational KLocalizedString::inContext() method
non-operational since 5185c917de

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-15 01:06:56 +03:00
Ivailo Monev
625373ffa8 kdecore: drop KDateTime
with the rewrite (see f452e2e50b),
KDateTime is just glue-code for compatibility now. the exception is
KDateTime::isNightTime() (written by me) which is used only in one place
(kde-workspace/plasma/dataengines/weather/ions/wetter.com/ion_wettercom.cpp)
and can be moved there

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-14 22:35:08 +03:00
Ivailo Monev
3b4c47d967 kdecore: remove bogus test code
checking for directory existing via QFile::exists() is bogus, also Katana
does not install files in such directory

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-11 18:40:38 +03:00
Ivailo Monev
3ad6579891 kdecore: findLibraryInternal() function optimization
by checking if the unmodified (by makeLibName()) name is absolute first and
by not checking for relative library (if the name is not absolute path
QFileInfo::path() would return "." resulting in a relative lookup for
the library by KStandardDirs::findResource() in "lib" resource) the most
common cases are only looked for by KPluginLoader (either absolute path,
relative module or library but not relative to the current directory)

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-11 18:02:33 +03:00
Ivailo Monev
fe00f4058f kdecore: remove TODO related to KPluginLoader
the property shall not be removed

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-11 17:27:32 +03:00
Ivailo Monev
59b1d3da2d kdecore: format and indent
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-11 17:14:38 +03:00
Ivailo Monev
4d01af27ee kdecore: remove unused KPluginFactoryPrivate member
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-11 17:06:17 +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
c6c05c10b4 kdecore: use KStandardDirs::locate() to check for the existence of catalogs
the catalog file must exist, not just the directory

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-11 09:30:35 +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
5432c47994 kdecore: KMimeTypeRepository::parseMagicFile() optimization
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-09 02:18:59 +03:00
Ivailo Monev
b2a4509b14 kdecore: mimeDataBaseVersion() function optimization
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-09 01:52:22 +03:00
Ivailo Monev
5fb7d39eb2 kdecore: disable KLOCALE_DUMP_UNTRANSLATED by default
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-08 23:42:52 +03:00
Ivailo Monev
4472e87d19 kdecore: add compile-time definition to dump catalogs when translations is not found
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-08 23:41:24 +03:00
Ivailo Monev
33138d4a49 kdecore: effectively revert 6ae96c3c1d
due to Katie changes (see 7c840afcb12096778ecb1539f7baba3e02ba6f85 in the
Katie repo) reading lines is much faster

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-07 17:12:37 +03:00
Ivailo Monev
4d3d7840f2 kdecore: call KLocalizedString::notifyCatalogsUpdated() only when the catalogs were actually updated
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-07 02:15:02 +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
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
31cd95338f kdecore: remove redundant private KMimeTypeRepository::aliases() method
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-08-06 19:53:47 +03:00