initialstart: Ensure initial value of 24 hour switch is obtained

Otherwise the switch's state is always off.
This commit is contained in:
Devin Lin 2024-03-13 11:25:54 -04:00
parent 5169ae7579
commit 5f9f6b2d18

View file

@ -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