Commit graph

17 commits

Author SHA1 Message Date
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
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
d02d2b3fa4 kdecore: implement precision field for KuitSemantics
otherwise KLocale::formatNumber() has to guess the precision that was
passed to KLocalizedString::subs() and make up a localized integer string
with a magic wand, the precision for precise number types (e.g. ulong,
qlonglong, etc.) remains -1

fixes KSignalPlotter test case failure

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-28 15:45:04 +03:00
Ivailo Monev
1af12047e6 kdecore: remove unused KLocalizedString semantics
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2022-11-03 01:06:07 +02:00
Ivailo Monev
8d9978f7e5 kdecore: remove unused KLocalizedString semantics
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2022-11-03 00:47:26 +02:00
Ivailo Monev
169e338449 kdecore: convert KuitFormats functions to static
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2022-11-03 02:37:11 +02:00
Ivailo Monev
48f25f1fb5 kdecore: replace KuitSemantics::escape() with Qt::escape()
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2021-03-18 09:46:22 +02:00
Ivailo Monev
9f33f0a2da kdecore: correct argument number in KuitSemanticsPrivate::parseOpenEl()
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2021-01-10 12:57:13 +02:00
Ivailo Monev
ceabb2ead0 kdecore: adjust to Katie changes
Signed-off-by: Ivailo Monev <xakepa10@laimg.moc>
2019-05-08 04:28:58 +00:00
Ivailo Monev
b5b1aaed22 kdecore: fix some compiler warnings
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2016-05-26 14:48:40 +00:00
Ivailo Monev
d9cc003262 kdecore: remove unused KuitSemantics::mightBeRichText
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2016-05-26 14:45:59 +00:00
Ivailo Monev
f4f2c7bc75 generic: misc cleanups 2015-09-04 22:56:23 +00:00
Ivailo Monev
21ad0df488 generic: make changes required for building against katie 2015-08-11 05:56:07 +03:00
Ivailo Monev
814163a8dc initial import 2014-11-13 01:04:59 +02:00