Bug 343908 - Treat selected timezone as Local if it's the same timezone
Summary: Treat selected timezone as Local if it's the same timezone
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Digital Clock (show other bugs)
Version: 5.2.0
Platform: Arch Linux Linux
: NOR normal
Target Milestone: 1.0
Assignee: Martin Klapetek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-02-07 21:48 UTC by Szczepan Hołyszewski
Modified: 2015-02-09 21:15 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Test (20.00 KB, application/x-tar)
2015-02-07 23:00 UTC, Martin Klapetek
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Szczepan Hołyszewski 2015-02-07 21:48:01 UTC
Please add (or improve the discoverability of) an overriding option to DEFINITELY hide the display of current/local/whatever timezone. I tried everything in settings, and I still see those three letters "CET" under HH:MM.

Reproducible: Always
Comment 1 Martin Klapetek 2015-02-07 21:59:50 UTC
There is a checkbox in the applet settings, right on the first page saying "Show local timezone".

Unless CET isn't your local timezone, in which case it's always displayed.
Comment 2 Szczepan Hołyszewski 2015-02-07 22:26:53 UTC
> There is a checkbox in the applet settings, right on the first page saying "Show local timezone". 

First thing I tried.

> Unless CET isn't your local timezone, in which case it's always displayed.

Here's a list of various ways in which CET is totally my local timezone:

1) De facto. I am in the Polish part of Giant Mountains.
2) According to the output of date command.
3) According to systemsettings / Personalization / Date and Time / Timezone
4) Additionally, the time reported by date command and displayed in the plasmoid is consistent with the time on my phone, which is synchronized with the local mobile operator.

Here's a list of the ways in which CET is anything less than totally my local timezone:

0) None whatsoever

The "Show local timezone" checkbox is unchecked in the plasmoid's settings.

Reopening.
Comment 3 Martin Klapetek 2015-02-07 22:34:01 UTC
Can you please post the output of

$ timedatectl | grep Timezone

and then go to applet settings, select the timezone tab and search for local; which city does it say as Local?
Comment 4 Szczepan Hołyszewski 2015-02-07 22:43:41 UTC
rulatir@berbelek:~$ timedatectl | grep "Time zone"
       Time zone: Europe/Warsaw (CET, +0100)

It says Warsaw as local.

But the trick is, this "Local" time zone was not selected in the applet settings (the checkbox next to it was unchecked). What was selected instead was the regular Europe/Warsaw timezone. My understanding is that "Local" is some kind of an alias pointing to an actual timezone definition. I think that this alias should be respected both ways: if "Show local timezone" is unchecked, then the display of timezone should be suppressed also when a "real" timezone is selected but it happens to be the one to which the "Local" alias points.
Comment 5 Martin Klapetek 2015-02-07 22:48:53 UTC
Yes, Local points to whatever is returned by QTimeZone::systemTimeZoneId(); which gets the value through various heuristics, then Plasma internally sets the Local alias to that (eg. Europe/Warsaw).

I do agree however that if the same non-local zone is selected, it should have the same effect as Local.
Comment 6 Szczepan Hołyszewski 2015-02-07 22:50:47 UTC
Additionally, when I checked Local and unchecked Europe/Warsaw and applied the settings, the applet's display didn't change until I scrollwheeled it.
Comment 7 Martin Klapetek 2015-02-07 23:00:40 UTC
Created attachment 90969 [details]
Test

Actually can you try to build and run this test for me.

If you've never built anything, just untar this, cd into that dir and run:

mkdir build
cd build
cmake ..
make
./test_app

And post the output. Thanks.
Comment 8 Szczepan Hołyszewski 2015-02-07 23:18:17 UTC
CMakeLists.txt in the tarball appears to be another tarball containing another copy of test.cpp.
Comment 9 Martin Klapetek 2015-02-07 23:32:34 UTC
Huh, how did that happen...but I actually don't need it now, fix at https://git.reviewboard.kde.org/r/122473/
Comment 10 Szczepan Hołyszewski 2015-02-07 23:50:36 UTC
Thanks!
Comment 11 Martin Klapetek 2015-02-09 21:15:20 UTC
Git commit b19b0cf799dac5cc9831bb6c717a2a589be03bea by Martin Klapetek.
Committed on 09/02/2015 at 21:15.
Pushed by mklapetek into branch 'Plasma/5.2'.

Treat normal selected timezone as local if it matches the local

The real timezone that Local links to is also in the list of timezones
for which teh time can be displayed. For whatever reason, it can happen
that the real timezone is selected and not 'Local' and then it's not
treated as local anymore, making the "Show local timezone" setting not
work.

This fixes it.
REVIEW: 122473

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

http://commits.kde.org/plasma-workspace/b19b0cf799dac5cc9831bb6c717a2a589be03bea