Bug 498379 - Digital Clock Widget time zones randomly arranged
Summary: Digital Clock Widget time zones randomly arranged
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Digital Clock widget (show other bugs)
Version: 6.2.5
Platform: openSUSE Linux
: NOR normal
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2025-01-08 08:11 UTC by pallaswept
Modified: 2025-01-09 18:15 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 6.3.0
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description pallaswept 2025-01-08 08:11:29 UTC
SUMMARY
I have several time zones added to my clock widget. They are shown in a list when I hover the widget in my panel. That list is usually sorted by the time / latitude at that location, which is very useful. 

Since recently (probably updating to 6.2.5), the list seems randomly ordered. At first I thought it was alphabetical, and wasn't sure this was a bug, but after rebooting, it's definitely not sorted by time, latitude or name. I've just now noticed that it is actually different sorting to when I started typing this post a few minutes ago. Pretty sure bug?

STEPS TO REPRODUCE
1. Add time zones to Digital Clock widget in panel
2. Hover widget
3. Bonus: Try scrolling the mouse wheel while hovering

OBSERVED RESULT
You are lost

EXPECTED RESULT
West is that way ^

SOFTWARE/OS VERSIONS

Operating System: openSUSE Tumbleweed 20250103
KDE Plasma Version: 6.2.5
KDE Frameworks Version: 6.9.0
Qt Version: 6.8.1

ADDITIONAL INFORMATION
Thanks!
Comment 1 Nate Graham 2025-01-08 16:53:55 UTC
Can reproduce; the order changes randomly every time plasma is started. It's supposed to be sorted by time IIRC.
Comment 2 Nate Graham 2025-01-08 19:43:11 UTC
I can't find any code change that might have caused this, so it's possible it happened with a Qt update. That theory is bolstered by the fact that I can't even find any existing code to keep the ordering consistent! So we may have been relying on accidental behavior that changed recently.

Explicitly sorting by name isn't too hard, but I think sorting by time would be better. I'll work on that.
Comment 3 Bug Janitor Service 2025-01-08 20:45:26 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/5041
Comment 4 pallaswept 2025-01-08 21:12:14 UTC
Mid-air collision detected!
Someone else has made changes to bug 498379 at the same time you were trying to. The changes made were: 

Nate fixed it already before you could even say "Thanks Nate!"

:D
Comment 5 Nate Graham 2025-01-09 17:56:01 UTC
Git commit a6b7e945e0f9ca7919ad5a3453732232e9497f8c by Nate Graham.
Committed on 09/01/2025 at 16:21.
Pushed by ngraham into branch 'master'.

applets/digital-clock: explicitly sort time zones by time

Otherwise the list gets sorted randomly.
FIXED-IN: 6.3.0

M  +2    -1    applets/digital-clock/package/contents/ui/main.qml

https://invent.kde.org/plasma/plasma-workspace/-/commit/a6b7e945e0f9ca7919ad5a3453732232e9497f8c
Comment 6 Nate Graham 2025-01-09 18:15:22 UTC
Git commit eb53e3c3af8591a59b98301b231adb32f4333547 by Nate Graham.
Committed on 09/01/2025 at 17:56.
Pushed by ngraham into branch 'Plasma/6.3'.

applets/digital-clock: explicitly sort time zones by time

Otherwise the list gets sorted randomly.
FIXED-IN: 6.3.0


(cherry picked from commit a6b7e945e0f9ca7919ad5a3453732232e9497f8c)

Co-authored-by: Nate Graham <nate@kde.org>

M  +2    -1    applets/digital-clock/package/contents/ui/main.qml

https://invent.kde.org/plasma/plasma-workspace/-/commit/eb53e3c3af8591a59b98301b231adb32f4333547