Commit graph

4534 commits

Author SHA1 Message Date
Ivailo Monev
938d0dd7e0 generic: remove KCalendarSystem leftovers
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-27 03:01:17 +03:00
Ivailo Monev
26258999ed cmake: correct kde4_translate() macro documentation
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-27 01:36:14 +03:00
Ivailo Monev
fc4c832b3d kdecore: KLocale::translateRaw() methods optimization
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-27 00:07:52 +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
cd7162688c Merge branch 'master' of https://scm.osdn.net/gitroot/kde/kdelibs 2023-07-24 22:39:14 +03:00
Ivailo Monev
0fa46d60db kdecore: remove declaration of non-existing KLocale::setEncoding() method
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-24 21:44:30 +03:00
Ivailo Monev
b7d67374be plasma: focus hack for Plasma::CalendarWidget
as is done by Plasma::LineEdit

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-24 20:51:50 +03:00
Ivailo Monev
6cb0ae1239 plasma: call Plasma::ThemedWidgetInterface::initTheming() from Plasma::CalendarWidget constructor
to apply palette and font instantly instead of relying on it to happen due
to external events

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-24 08:39:14 +03:00
Ivailo Monev
97372f70af plasma: Plasma::CalendarWidget documentation correction
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-24 06:38:43 +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
ce03856f54 plasma: theme the Plasma::CalendarWidget via the internal Plasma::ThemedWidgetInterface class
what that does - the general application color scheme applies to the native
widget and any Plasma::Theme overrides are applied on top of that making it
slightly less native looking and more plasma-themed.

also that allows to not just hide the calendar month button but disable it,
the colors for disabled widget as slightly lighter than the usual color
scheme so its not a big difference visually with that change

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-23 20:55:55 +03:00
Ivailo Monev
0560ab5550 plasma: sligthly better workaround for Plasma::CalendarWidget navigation bar
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-23 13:06:57 +03:00
Ivailo Monev
6d3811054d kdeui: adapt KCalendarWidget to locale and language changes
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-23 12:02:13 +03:00
Ivailo Monev
7e78f97d61 plasma: new Plasma::CalendarWidget class
to be used by the clock and calendar applets

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-23 11:30:15 +03:00
Ivailo Monev
3c697cf8ce kdeui: implement setter and getter for KCalendarWidget to use a specifiec KCalendarSystem
maybe temporary tho but for now the minimum and maximum date will be that
of the KCalendarSystem

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-23 11:29:06 +03:00
Ivailo Monev
8f8865db62 kdeui: do not warn from setupCalendarWidget() if the system locale name is "C"
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-23 08:21:55 +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
6c2c0efda8 kdeui: remove unused klocale header inclusion in kcalendarwidget header
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-23 06:20:32 +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
e84a04fa67 kdeui: remove forward-declaration of now non-existing KTimeZones class
replaced with KTimeZoneList

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-23 02:50:53 +03:00
Ivailo Monev
000c8af989 kdeui: remove unused date and time related widget classes
some of the classes date back to 2001 and 2002, still unused

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-23 02:48:22 +03:00
Ivailo Monev
645cc4e5cf kdecore: KTimeZone documentation update
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-22 10:53:55 +03:00
Ivailo Monev
c411c09c16 kdecore: KTimeZone review
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-22 10:49:24 +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
be09f602d2 kdecore: check if the time zone file exists from KTimeZone::isValid()
this was not done in the previous implementation but it is now, it will
allow to detect tzdata changes and fallback to UTC in the plasma time
data engine during system upgrades for example. that ofcourse is only
theoretical and preperation for worst-case-scenario type of situation but
good to have anyway

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-22 06:45:52 +03:00
Ivailo Monev
34c7498702 kdecore: minor KTimeZone parsing optimization
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-22 06:33:18 +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
199278af4a kdecore: document the two important methods of KDateTime
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-22 00:51:24 +03:00
Ivailo Monev
798a73eb0b kdecore: de-virtualize KDateTimeFormatter, KDateTimeParser and KDayPeriod
the classes are private and the methods are no reimplemented

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-21 10:55:09 +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
3795893cdf kdecore: remove code for always true condition
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-21 02:14:32 +03:00
Ivailo Monev
e00c726455 kdecore: remove unused KTimeZoneBackend::type() method
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-21 02:14:17 +03:00
Ivailo Monev
53a5c81a3a kio: minor KRecentDocument::recentDocuments() optimization
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-21 01:46:20 +03:00
Ivailo Monev
da154d3195 kio: replace KFileItemPrivate::readUDSEntry() with its body
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-21 01:30:56 +03:00
Ivailo Monev
8475feef40 kio: format and indent
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-21 01:26:19 +03:00
Ivailo Monev
1f028422e8 kio: remove unused KIO::StandardFieldTypes::UDS_HIDDEN enum
UNIX being UNIX the leading dot meaning a file/directory is hidden is not
going anywhere, the private KFileItem hidden member is always set to
KFileItemPrivate::Auto too

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-21 00:29:10 +03:00
Ivailo Monev
3251c5eb1b kio: replace KFileItemPrivate::size() and KFileItemPrivate::cmp() with their body
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-21 00:14:18 +03:00
Ivailo Monev
a990de2b93 kio: KFileItemList::urlList() and KFileItemList::targetUrlList() optimization
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-21 00:08:22 +03:00
Ivailo Monev
ea56b1c92f kio: KFileItem::mimeComment() optimization
KFileItem::mimeTypePtr() is lesser version of
KFileItem::determineMimeType() and if KFileItem::determineMimeType() did
not return valid KMimeType::Ptr then neither will KFileItem::mimeTypePtr()
but calling KFileItem::::mimeTypePtr() after KFileItem::determineMimeType()
is redundant

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-20 23:57:46 +03:00
Ivailo Monev
632f5e52de kio: make the internal KIO::CopyInfo actually private, remove unused KIO::CopyJob signal
the signal is actually not used, see the following commit in kde-workspace:
45bbcd5e5e963d029974e09fd66edc454e7e9dc4

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-20 23:23:05 +03:00
Ivailo Monev
903e15327d kio: remove unused headers inclusions in kfileitem source file
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-20 22:45:14 +03:00
Ivailo Monev
29a6bc934a kio: convert KFileItem::permissionsString() to proper getter
way too much private and mutable KFileItem members, not used a lot so the
performance impact is next to none

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-20 22:08:35 +03:00
Ivailo Monev
a487c9edc6 kio: drop KFileItem metadata related getter and setter
first thing first - KFileMetaInfo does not support non-local files and
KFileItem is ment to be wrapper for both local and (most importantly)
remote (including virtual KIO) files. KIO::UDSEntry does not carry metadata
either so having a metadata getter and setter in KFileItem is simply
redundant, both are not tested and used only by plasma folderview applet
(see kde-workspace/plasma/applets/folderview/tooltipwidget.cpp)

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-20 21:03: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
39daa5baf3 kio: check if the KMimeType pointer is null in KFileItem::mimetype()
fixes possible crash (in the unusual case when the MIME type cannot be
determinted)

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-19 07:38:04 +03:00
Ivailo Monev
757ac43baf kio: do not attempt to get metadata for non-local file URLs
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-18 03:48:11 +03:00
Ivailo Monev
4e1fc45705 kio: remove unused KFileMetaInfo flags
when it comes to KFileMetaInfo its bottleneck is determening what plugin to
use for the given URL/path - determening MIME type, matching globs, etc.
and it still is quite fast to the point where the flags are simply
redundant

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2023-07-18 03:36:06 +03:00