Merge lp://qastaging/~charlesk/indicator-datetime/lp-917236 into lp://qastaging/indicator-datetime/12.10

Proposed by Charles Kerr
Status: Merged
Approved by: Lars Karlitski
Approved revision: 192
Merged at revision: 185
Proposed branch: lp://qastaging/~charlesk/indicator-datetime/lp-917236
Merge into: lp://qastaging/indicator-datetime/12.10
Diff against target: 185 lines (+64/-23)
2 files modified
src/datetime-service.c (+59/-23)
src/indicator-datetime.c (+5/-0)
To merge this branch: bzr merge lp://qastaging/~charlesk/indicator-datetime/lp-917236
Reviewer Review Type Date Requested Status
jenkins (community) continuous-integration Approve
Lars Karlitski (community) Approve
Review via email: mp+125388@code.qastaging.launchpad.net

Commit message

When clock skew is detected, rebuild the date/time labels.

Description of the change

Add a timer to monitor for clock skew, and when it's detected, rebuild the datetime menuitems that need it.

Larsu, I'd also like a second opinion on whether or not the SystemIdleHintChanged callback is still needed, since the clock skew code should have the same results...

To post a comment you must log in.
Revision history for this message
jenkins (martin-mrazik+qa) wrote :
review: Approve (continuous-integration)
188. By Charles Kerr

clocks don't skew very often, so let's reduce the frequency that we test for this.

Revision history for this message
jenkins (martin-mrazik+qa) wrote :
review: Approve (continuous-integration)
Revision history for this message
Lars Karlitski (larsu) wrote :

Why are SKEW_CHECK_INTERVAL_SEC and SKEW_DIFF_THRESHOLD_SEC enums instead of #defines or const ints? I prefer having those kinds of definitions at the top of the file.

If we remove the SystemIdleHintChanged callback, the clock in the menu will be updated after a maximum of SKEW_CHECK_INTERVAL_SEC seconds, right? I don't like that, even if it is only the clock in the menu.

Why are the timers running when the menu is not open?

review: Needs Information
Revision history for this message
Charles Kerr (charlesk) wrote :

> I prefer having those kinds of definitions at the top of the file.

Agreed, r189.

> Why are SKEW_CHECK_INTERVAL_SEC and SKEW_DIFF_THRESHOLD_SEC enums instead of #defines or const ints?

const ints aren't legal when you define threshold in terms of interval. enums in general safer than preprocessor tokens. But, in terms of our codebase, you're right #defines are way more common. r190.

> Why are the timers running when the menu is not open?

To ensure that the indicator's label gets updated via the UpdateTime signal.

189. By Charles Kerr

move declaration of SKEW_CHECK_INTERVAL_SEC and SKEW_DIFF_THRESHOLD_SEC to the top of the file.

190. By Charles Kerr

for SKEW_DIFF_THRESHOLD_SEC and SKEW_CHECK_INTERVAL_SEC, use #define instead of enum

Revision history for this message
Charles Kerr (charlesk) wrote :
191. By Charles Kerr

Fix r190 typo. Yet another reminder to drink my morning coffee /before/ pushing.

Revision history for this message
Charles Kerr (charlesk) wrote :

Moreover, without the label we wouldn't need the timer at all -- we could connect to the menu's about-to-show event.

Revision history for this message
jenkins (martin-mrazik+qa) wrote :
review: Approve (continuous-integration)
192. By Charles Kerr

copyediting: typo tweak

Revision history for this message
Lars Karlitski (larsu) wrote :

> > Why are the timers running when the menu is not open?
>
> To ensure that the indicator's label gets updated via the UpdateTime signal.

Oh, I thought that was handled in the plugin and we're only talking about the label on the top of the menu here. Sorry.

Thanks for the other fixes.

review: Approve
Revision history for this message
jenkins (martin-mrazik+qa) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches