https://bugs.kde.org/show_bug.cgi?id=404292

--- Comment #1 from Chris Holland <zrenf...@gmail.com> ---
Why the heck is this config property an unsigned int instead of a bool? Oooooh
right. It's a tri-state button that defaults to whatever the system locale
chooses.

    // config/main.xml
    <entry name="use24hFormat" type="UInt">
      <label>Force the clock to use 12/24 hour time, instead of following the
user locale.</label>
      <default>1</default>
    </entry>


    // ui/configAppearance.qml
    QtControls.CheckBox {
        id: use24hFormat
        text: i18nc("Checkbox label; means 24h clock format, without am/pm",
"Use 24-hour Clock")
    }

    // ui/DigitalClock.qml
    property int use24hFormat: plasmoid.configuration.use24hFormat


*
https://github.com/KDE/plasma-workspace/blame/master/applets/digital-clock/package/contents/ui/configAppearance.qml


It looks like during the QQC2/Kirigami migration, the tri-state button property
`checkedState` was changed to `checked`.

https://github.com/KDE/plasma-workspace/commit/39e812d57fd6a52e6c8596f823564a241d9ae696#diff-26b9a772d0004bc6a0622b47b3cbfd09L46

Since `bool checked` when cast to an integer is 0=off, and 1=on, it's basically
changing between Qt::Unchecked=0 and Qt::PartiallyChecked=1. So when the 24h
button is "checked=true", it's cast as Qt::PartiallyChecked=1 and ends up using
the system locale. Since in en_US defaults to 12h clock, it has no visible
effect.

If the dev who wrote the code migration developed in a 24h system locale, it'd
"work" during testing.

* https://doc.qt.io/qt-5/qml-qtquick-controls-checkbox.html#checkedState-prop
* https://doc.qt.io/archives/qt-5.10/qt.html#CheckState-enum

It's a bit odd that Qt::PartiallyChecked is 1, instead of 2. But I guess that
was intentional by the Qt devs.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to