From 5f9f6b2d18d693fe695ab46829cb1cf969030887 Mon Sep 17 00:00:00 2001 From: Devin Lin Date: Wed, 13 Mar 2024 11:25:54 -0400 Subject: [PATCH] initialstart: Ensure initial value of 24 hour switch is obtained Otherwise the switch's state is always off. --- initialstart/modules/time/timeutil.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/initialstart/modules/time/timeutil.cpp b/initialstart/modules/time/timeutil.cpp index c369e8fd..47595f8c 100644 --- a/initialstart/modules/time/timeutil.cpp +++ b/initialstart/modules/time/timeutil.cpp @@ -19,6 +19,11 @@ TimeUtil::TimeUtil(QObject *parent) , m_filterModel{new TimeZoneFilterProxy{this}} { m_filterModel->setSourceModel(m_timeZoneModel); + + // retrieve is24HourTime + auto config = KSharedConfig::openConfig(QStringLiteral("kdeglobals"), KConfig::SimpleConfig); + auto group = KConfigGroup(config, "Locale"); + m_is24HourTime = group.readEntry(QStringLiteral("TimeFormat"), FORMAT24H) == FORMAT24H; } bool TimeUtil::is24HourTime() const