Merge lp:~nick-dedekind/unity8/StrFTimeFormatter into lp:unity8
Status: | Merged |
---|---|
Approved by: | Michał Sawicz on 2013-12-18 |
Approved revision: | 473 |
Merged at revision: | 598 |
Proposed branch: | lp:~nick-dedekind/unity8/StrFTimeFormatter |
Merge into: | lp:unity8 |
Prerequisite: | lp:~larsu/unity8/lp1236413 |
Diff against target: |
239 lines (+67/-11) 11 files modified
plugins/Unity/Indicators/CMakeLists.txt (+0/-1) plugins/Unity/Indicators/Messaging/qml/SimpleTextMessage.qml (+2/-1) plugins/Unity/Indicators/Messaging/qml/SnapDecision.qml (+2/-2) plugins/Unity/Indicators/plugin.cpp (+0/-2) plugins/Utils/CMakeLists.txt (+1/-0) plugins/Utils/plugin.cpp (+3/-0) plugins/Utils/timeformatter.cpp (+30/-1) plugins/Utils/timeformatter.h (+15/-3) tests/plugins/Unity/Indicators/CMakeLists.txt (+0/-1) tests/plugins/Utils/CMakeLists.txt (+1/-0) tests/plugins/Utils/timeformattertest.cpp (+13/-0) |
To merge this branch: | bzr merge lp:~nick-dedekind/unity8/StrFTimeFormatter |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
PS Jenkins bot (community) | continuous-integration | Approve on 2013-12-18 | |
Michał Sawicz | Approve on 2013-12-18 | ||
Lars Karlitski (community) | 2013-10-23 | Approve on 2013-10-24 | |
Review via email:
|
Commit message
Added parser for strftime in TimeFormatter.
Moved TimeFormatter to Utils plugin.
Description of the change
Added parser for strftime in TimeFormatter.
Lars Karlitski (larsu) wrote : | # |
This patch doesn't check the return value of strftime() and might thus pass an uninitialized buffer into QString().
According to strftime(3), the return value of that function is 0 when the resulting string is longer than the passed in buffer. However, it can also be 0 when the resulting string is legitimately empty. For example, when the format string is "".
I think the best solution is to prepend a " " to the format string. That way, the return value is never smaller than 1, unless there's an error. And then simply return QString(buffer + 1).
You could also use g_date_
Nick Dedekind (nick-dedekind) wrote : | # |
> This patch doesn't check the return value of strftime() and might thus pass an
> uninitialized buffer into QString().
>
> According to strftime(3), the return value of that function is 0 when the
> resulting string is longer than the passed in buffer. However, it can also be
> 0 when the resulting string is legitimately empty. For example, when the
> format string is "".
>
> I think the best solution is to prepend a " " to the format string. That way,
> the return value is never smaller than 1, unless there's an error. And then
> simply return QString(buffer + 1).
>
> You could also use g_date_
> formats as well.
GDateTime it is.
Renamed to GDateTimeFormatter as well.
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:470
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
FAILURE: http://
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:470
http://
Executed test runs:
UNSTABLE: http://
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:470
http://
Executed test runs:
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Michał Sawicz (saviq) wrote : | # |
What did we decide in the end on that? Should this come pre-formatted from the indicator?
Nick Dedekind (nick-dedekind) wrote : | # |
> What did we decide in the end on that? Should this come pre-formatted from the
> indicator?
No, we would need to subscribe to tz changes and update each event in the indicator service and update the actions. The indicator should keep processing to a minimum (times are read in as unix time).
Nick Dedekind (nick-dedekind) wrote : | # |
> What did we decide in the end on that? Should this come pre-formatted from the
> indicator?
I think this is still the correct way to do it. I'm not sure where the indicator gets it's format string from, but perhaps it should be a gsettting somewhere.
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:471
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:472
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:473
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Autolanding.
More details in the following jenkins job:
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
FAILURE: http://
SUCCESS: http://
FAILED: Continuous integration, rev:469 jenkins. qa.ubuntu. com/job/ unity8- ci/1480/ jenkins. qa.ubuntu. com/job/ generic- mediumtests- trusty/ 26/console jenkins. qa.ubuntu. com/job/ generic- mediumtests- trusty- touch/26/ console jenkins. qa.ubuntu. com/job/ unity-phablet- qmluitests- trusty/ 4/console jenkins. qa.ubuntu. com/job/ unity8- trusty- amd64-ci/ 4/console jenkins. qa.ubuntu. com/job/ unity8- trusty- armhf-ci/ 4/console jenkins. qa.ubuntu. com/job/ unity8- trusty- i386-ci/ 4/console jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- trusty- amd64/26/ console jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- trusty- armhf/26/ console
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild: 10.97.0. 26:8080/ job/unity8- ci/1480/ rebuild
http://