Commit graph

228 commits

Author SHA1 Message Date
Ivailo Monev
5e95db910f kdecore: magic bits for numbers formatting
people really messed up the precisions, look at what kcalc does with the
constants:
kde-extraapps/kcalc/kcalcdisplay.cpp

zero precision is essentially rounding the constants! also setlocale() no
longer has effect on Katie and thus Katana so updated the method to
override locale in KLocalizedString test while at it (tests pass after one
adjustment for the french locale case)

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-28 04:59:57 +03:00
Ivailo Monev
12f3ffd120 kdecore: remove redundant KLocale::translateRaw() methods
context can be null now

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-27 21:21:57 +03:00
Ivailo Monev
aa9e5b7066 kdecore: fix and adjust tests
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-27 03:32:39 +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
ffa856e1b8 kdecore: test KTimeZone from and to UTC conversion
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-24 01:24:08 +03:00
Ivailo Monev
de31c50479 kdecore: drop support for all but gregorian and julian calendars
additional calendar systems can be supported via ICU in the future but
for now that will be more than enough considering other things such as
QDateTime and QCalendarWidget, the gregorian and julian calendars being
common, etc.

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-23 22:58:43 +03:00
Ivailo Monev
2cf411e2ed kdecore: remove unused and deprecated KLocale/KCalendarSystem setters and getters
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-23 08:04:44 +03:00
Ivailo Monev
714b6f2021 kdecore: remove unused KLocalizedDate class
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-23 06:54:53 +03:00
Ivailo Monev
061a11fd43 kdeui: replace KDatePicker/KDateTable with new KCalendarWidget class
interestingly QLocale is not used for many things but that is about to
change, Katie uses it a lot internally (e.g. for QDateTime formatting
and such) so instead of bolting a calendar system on top of KLocale
perhaps a QLocale wrapped around in KLocale will fit the general idea
of using QLocale in widgets when necessary (as does QCalendarWidget).

that however means no way to specify a calendar system (in general,
other than changing the widgets locale itself) but the QDateTime and
related classes are tied to gregorian calendar already - the system
time itself carries no information about the calendar and any
conversions from one calendar to another are basically made up stuff
(there is the time zone thing ofcourse but that is not a calendar)

another interesting thing to note is that KLocale was written such that
it is read-write - changing the date formats for example is possible
because there are public KLocale methods for that.

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-23 06:16:56 +03:00
Ivailo Monev
9af650bb6a kdecore: rewrite KTimeZone to use the transition data
turned out easier than expected

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-22 10:27:21 +03:00
Ivailo Monev
89ca9c774d kdecore: copyright KSystemTimeZones, KTimeZone and the tests for the classes to me
rewritten by me

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-22 04:00:09 +03:00
Ivailo Monev
f2f37377e3 kdecore: reimplement KTimeZone
simpler, cleaner and most importantly - thread-safe (more than the
previous implementation anyway).

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-22 03:53:20 +03:00
Ivailo Monev
f452e2e50b kdecore: reimplement KDateTime via QDateTime
KDateTime shall be used only for storing date and time while KLocale
shall be used to display such, not even going to test what KDateTime
does because it is basically a few methods on top of QDateTime now.

and because QDateTime knows not much about calendar systems while
KLocale supports several it makes sense for KDateTime to not be used for
displaying date and time thus the TODOs for KLocale are simply removed

note that KLocale still uses its own parser and formatter which means
that the change affects only KDateTime and its uses, not KLocale

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-21 07:51:13 +03:00
Ivailo Monev
f90c94dae7 kdecore: strip the trailing slash when passing the URL path to kPathDirectory() from KUrl::upUrl()
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-10 06:52:30 +03:00
Ivailo Monev
e512f4af70 kdecore: remove unused qtextstream header inclusion in qtest_kde header
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-06 09:06:18 +03:00
Ivailo Monev
9767ce8fc4 kio: watch the sub-directories when listing recursively
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-05 00:00:14 +03:00
Ivailo Monev
bce72b0b24 kdecore: safety-net for KUrl::upUrl(), also append trailing slash from KUrl::directory()
relative paths are tricky

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-03 20:39:14 +03:00
Ivailo Monev
a051b1b284 kdecore: append trailing slash from kPathDirectory() function
while it does not matter for comparison, for KUrl::setFileName() to produce
correct results it has to be there after KUrl::upUrl()

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-03 17:09:54 +03:00
Ivailo Monev
ee0d50c901 generic: purge most manual tests
long overdue, have no use for them

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-03 07:03:28 +03:00
Ivailo Monev
5290bf44e0 kdecore: deal with KMimeType TODO
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-06-29 19:51:10 +03:00
Ivailo Monev
37d9ca4f71 kdecore: rename KUrl test for consistency
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-06-26 07:47:18 +03:00
Ivailo Monev
f1bd676623 kdecore: test relative vs relative local file URLs
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-06-26 07:44:41 +03:00
Ivailo Monev
5bf76a5f3a kdecore: compare the clean paths of local file URLs
things are getting complicated for local files but that is how it should be

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-06-26 07:36:59 +03:00
Ivailo Monev
181e119ecc kdecore: KUrl::equals() rework to use KUrl::url() for the comparison
same thing (all URL components are compared) except the trailing slash
option can be re-used for it essentially adding one more option (to add
trailing slash when comparing)

also fixed and tested KUrl::upUrl() for some cases

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-06-26 01:30:23 +03:00
Ivailo Monev
180f34d2e3 kdecore: fix null/empty KUrl comparison and test it
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-06-26 00:34:45 +03:00
Ivailo Monev
b1c7c3b392 kdecore: move KUrl code where it belongs
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-06-26 00:10:11 +03:00
Ivailo Monev
db7fb2a8ee kdecore: add comment about the re-construction of the URL in KUrlTest::testHash()
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-06-25 23:59:40 +03:00
Ivailo Monev
47d0b5a297 kdecore: remove unused KUrl metadata
was used to pass the referrer and while it is still possible to
reimplement it realisticly speaking it is impossible to preserve the
referrer (and other HTTP(S) header metadata) because it will be lost in
transition in some cicumstances such as when drag-n-drop is done to
application unaware of application/x-kio-metadata

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-06-25 21:13:59 +03:00
Ivailo Monev
1c25006049 kdecore: typo in KUrl tests comment
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-06-25 18:51:44 +03:00
Ivailo Monev
40da298881 kdecore: never output file:// for local files
there is a fix for that legacy thing

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-06-25 18:15:06 +03:00
Ivailo Monev
5b90bcb8ea kdecore: test hashing of KUrl with different port
now that it is taken into account, see:
7e056ee4a1

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-06-25 17:22:48 +03:00
Ivailo Monev
54ee8ee1cd kdecore: clarfication on the note in KUrl test
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-06-25 16:50:36 +03:00
Ivailo Monev
f1df519d20 kdecore: test qHash() for KUrl
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-06-25 06:31:53 +03:00
Ivailo Monev
a7fe953ca9 kdecore: ensure KUrl::url() handles only full paths to local files specially
it's dirty, it's magic, it's a fix

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-06-25 03:15:21 +03:00
Ivailo Monev
ef02376c35 kdecore: add KUrl query and fragment test
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-06-24 21:25:20 +03:00
Ivailo Monev
67d6fa8588 generic: adjust expected tests data
QUrl::StripTrailingSlash removes all trailing slashes and KUrl does not
convert to percentage encoding - local file URLs remain the same when
passed around.

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-06-24 20:57:21 +03:00
Ivailo Monev
30cd526513 kdecore: set the scheme to file when it KUrl is constructor from string and it is empty
the test case for it is "local file 3" case of KUrl::cleanPath() test and
the KUrlNavigator test

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-06-23 17:53:20 +03:00
Ivailo Monev
ed4ae48705 kdecore: KUrl test-anew
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-06-23 14:44:33 +03:00
Ivailo Monev
34b75e4f7f kdecore: different take on KUrl::upUrl()
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-06-23 13:08:49 +03:00
Ivailo Monev
c44c545b1a kdecore: add FIXME for KUrl::isRelativeUrl()
I do not know where the logic behind that was

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-06-23 08:15:33 +03:00
Ivailo Monev
9e301c4a49 kdecore: disable KUrl test
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-06-23 04:09:56 +03:00
Ivailo Monev
a424284337 kdecore: remove unused and redundant KUrl methods
plus some disabled bits

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-06-22 13:42:25 +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
5613e5483c generic: remove redundant build varibles
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-06-17 20:25:52 +03:00
Ivailo Monev
f965a1edb8 kdecore: testing build fix
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-06-16 20:31:44 +03:00
Ivailo Monev
add0b2cad3 kdecore: drop KProcess channel forward feature
was used only by klipper, also a program writing something ment for
stderr to stdout (and vice versa) is doing something wrong already

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-06-14 23:44:38 +03:00
Ivailo Monev
6ba957038d kdecore: KLockFile optimization
also not storing the host name because it serves no real purpose other than
being a possible source of problem (hostname change?), copyrighting it to
me because there is nothing relevant left of the original implementation

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-06-14 03:34:48 +03:00
Ivailo Monev
8609952af1 generic: replace use of QTime as timer with QElapsedTimer
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-06-07 12:21:32 +03:00
Ivailo Monev
4966846ed7 generic: drop sub-URL support
was used by the archive KIO slave for example (which is no longer
maintained)

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-06-06 08:34:19 +03:00
Ivailo Monev
636f533297 kdecore: discard leap second adjustments, standard/wall and UTC/local time indicators timezone data
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-06-01 00:49:15 +03:00