Merge lp://qastaging/~gang65/ubuntu-clock-app/ubuntu-clock-mainclock-runtime-timezone-fix into lp://qastaging/ubuntu-clock-app
Proposed by
Bartosz Kosiorek
Status: | Merged |
---|---|
Approved by: | Nekhelesh Ramananthan |
Approved revision: | 417 |
Merged at revision: | 396 |
Proposed branch: | lp://qastaging/~gang65/ubuntu-clock-app/ubuntu-clock-mainclock-runtime-timezone-fix |
Merge into: | lp://qastaging/ubuntu-clock-app |
Diff against target: |
820 lines (+227/-158) 23 files modified
README.unittest (+3/-3) app/MainPage.qml (+12/-4) app/alarm/AlarmPage.qml (+12/-1) app/alarm/AlarmSettingsPage.qml (+1/-20) app/alarm/AlarmUtils.qml (+11/-1) app/alarm/EditAlarmPage.qml (+6/-6) app/clock/ClockPage.qml (+35/-11) app/components/AnalogMode.qml (+17/-3) app/components/Clock.qml (+8/-5) app/components/DigitalMode.qml (+7/-7) app/ubuntu-clock-app.qml (+9/-16) app/worldclock/UserWorldCityDelegate.qml (+2/-16) app/worldclock/WorldCityList.qml (+1/-1) backend/modules/WorldClock/datetime.cpp (+25/-15) backend/modules/WorldClock/datetime.h (+26/-15) backend/modules/WorldClock/timezonemodel.cpp (+9/-6) backend/modules/WorldClock/timezonemodel.h (+3/-2) debian/changelog (+3/-0) tests/manual/2014.com.ubuntu.clock:clock-tests/jobs/worldcity.pxu (+27/-0) tests/unit/CMakeLists.txt (+2/-2) tests/unit/MockClockApp.qml (+3/-10) tests/unit/tst_alarm.qml (+0/-11) tests/unit/tst_alarmUtils.qml (+5/-3) |
To merge this branch: | bzr merge lp://qastaging/~gang65/ubuntu-clock-app/ubuntu-clock-mainclock-runtime-timezone-fix |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Nekhelesh Ramananthan | Approve | ||
Ubuntu Phone Apps Jenkins Bot | continuous-integration | Approve | |
Review via email:
|
Commit message
* Fix wrong date and time after changing timezone while clock running (LP: #1447441)
Description of the change
* Fix wrong date and time after changing timezone while clock running (LP: #1447441)
TODO:
Test manually Daylight saving time changing.
List of all switches from/to DST is available at:
https:/
To post a comment you must log in.
Preliminary Code Review ------- ------- --
-------
1. This MP changes some core stuff of the clock app and has potential to introduce regressions. And so we need to make sure that the changes in this MP are the ones which are absolutely necessary and only fixes one issue. With that in mind, please revert changes made to Stopwatch_ placeholder. svg, worldclock_ placeholder. svg. This way if we have to revert this MP after it lands in trunk, we don't potentially lose out other improvements that were bundled along.
2. I see two variables clockTimeInMain and clockAnalogTime InMain. It would be better if you could rename it as analogClockTime and digitalClockTime and drop the "Main" postfix.
3. Why is there a need for 2 variable names clockAnalogTime InMain and clockAnalogTime inClockPage? We're essentially passing clockAnalogTime InMain as an argument to the clock page. Perhaps the variable in the clock page can be named as analogTime and digitalTime. The "InMain" and "InClockPage" seems a bit messy in my opinion.
4. As mentioned during our chat, I would like to see a comment above rotation: (parseInt( analogTime. split(" :")[1]) * 6) + (parseInt( analogTime. split(" :")[2]) / 10) explaining the input string and how it is split up into mulitple strings for better understandability.
5. I am bit afraid that we're losing out on important code below,
- text: { Qt.locale( ).amText) !== -1) { Qt.locale( ).amText, "").trim() Qt.locale( ).pmText) !== -1) { Qt.locale( ).pmText, "").trim() ring.split( " ")[0]
- if (time.search(
- // 12 hour format detected with the localised AM text
- return time.replace(
- }
- else if (time.search(
- // 12 hour format detected with the localised PM text
- return time.replace(
- }
- else {
- // 24-hour format detected, return full time string
- return time
- }
- }
+ text: localizedTimeSt
The replace() function was used to fix bugs like https:/ /bugs.launchpad .net/ubuntu- clock-app/ +bug/1458808. Please again provide a comment above + text: localizedTimeSt ring.split( " ")[0] with the input string format and what is being split. And please test this in the chineese locale to see if it works correctly.
6. In the following code below,
- subText: { /bugreports. qt-project. org/browse/ QTBUG-40275 is fixed .localDateStrin g.split( ":")[0] , .localDateStrin g.split( ":")[1] -1, .localDateStrin g.split( ":")[2] , .localTimeStrin g.split( ":")[0] , .localTimeStrin g.split( ":")[1] , .loca.. .
- /*
- FIXME: When the upstream QT bug at
- https:/
- it will be possible to receive a datetime object directly
- instead of using this hack.
- */
- var localTime = new Date
- (
- localTimeSource
- localTimeSource
- localTimeSource
- localTimeSource
- localTimeSource
- localTimeSource