Merge lp:~jjardon/indicator-datetime/fix-740977 into lp:indicator-datetime/0.3

Proposed by Javier Jardón
Status: Rejected
Rejected by: Ted Gould
Proposed branch: lp:~jjardon/indicator-datetime/fix-740977
Merge into: lp:indicator-datetime/0.3
Diff against target: 65 lines (+0/-32)
1 file modified
src/datetime-service.c (+0/-32)
To merge this branch: bzr merge lp:~jjardon/indicator-datetime/fix-740977
Reviewer Review Type Date Requested Status
Indicator Applet Developers Pending
Review via email: mp+78342@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Antti Kaijanmäki (kaijanmaki) wrote :

Thank you for your time and energy Javier to make Ubuntu better!

You are correct that the timer is not needed anymore, but I suggest we don't remove the timer from Oneiric code at this late of the cycle as the timer does not introduce any regression or unwanted behavior.

I'm now working on upgrading the code of indicator-datetime for Precise to use the newer EDS API and will in the process also clean up all the unnecessary old code, including the timer.

Unmerged revisions

140. By Javier Jardón

Remove ecal timer

It's not needed as we are using the "changed" signal in the ESource
to update the menu when and event changed

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/datetime-service.c'
2--- src/datetime-service.c 2011-09-29 19:57:50 +0000
3+++ src/datetime-service.c 2011-10-06 03:02:23 +0000
4@@ -426,41 +426,12 @@
5 return TRUE;
6 }
7
8-static guint ecaltimer = 0;
9-
10-static void
11-start_ecal_timer(void)
12-{
13- if (ecaltimer != 0) {
14- g_source_remove(ecaltimer);
15- ecaltimer = 0;
16- }
17- if (update_appointment_menu_items(NULL))
18- ecaltimer = g_timeout_add_seconds(60*5, update_appointment_menu_items, NULL);
19-}
20-
21-static void
22-stop_ecal_timer(void)
23-{
24- if (ecaltimer != 0) {
25- g_source_remove(ecaltimer);
26- ecaltimer = 0;
27- }
28-}
29-static gboolean
30-idle_start_ecal_timer (gpointer data)
31-{
32- start_ecal_timer();
33- return FALSE;
34-}
35-
36 static void
37 show_events_changed (void)
38 {
39 if (g_settings_get_boolean(conf, SETTINGS_SHOW_EVENTS_S)) {
40 dbusmenu_menuitem_property_set_bool(add_appointment, DBUSMENU_MENUITEM_PROP_VISIBLE, TRUE);
41 dbusmenu_menuitem_property_set_bool(events_separator, DBUSMENU_MENUITEM_PROP_VISIBLE, TRUE);
42- start_ecal_timer();
43 } else {
44 dbusmenu_menuitem_property_set_bool(add_appointment, DBUSMENU_MENUITEM_PROP_VISIBLE, FALSE);
45 dbusmenu_menuitem_property_set_bool(events_separator, DBUSMENU_MENUITEM_PROP_VISIBLE, FALSE);
46@@ -475,7 +446,6 @@
47 dbusmenu_menuitem_property_set_bool(DBUSMENU_MENUITEM(litem), DBUSMENU_MENUITEM_PROP_VISIBLE, FALSE);
48 }
49 }
50- stop_ecal_timer();
51 }
52 }
53
54@@ -508,11 +478,9 @@
55 if (g_settings_get_boolean(conf, SETTINGS_SHOW_EVENTS_S)) {
56 dbusmenu_menuitem_property_set_bool(add_appointment, DBUSMENU_MENUITEM_PROP_VISIBLE, TRUE);
57 dbusmenu_menuitem_property_set_bool(events_separator, DBUSMENU_MENUITEM_PROP_VISIBLE, TRUE);
58- g_idle_add((GSourceFunc)idle_start_ecal_timer, NULL);
59 } else {
60 dbusmenu_menuitem_property_set_bool(add_appointment, DBUSMENU_MENUITEM_PROP_VISIBLE, FALSE);
61 dbusmenu_menuitem_property_set_bool(events_separator, DBUSMENU_MENUITEM_PROP_VISIBLE, FALSE);
62- stop_ecal_timer();
63 }
64
65 // Connect to calendar events

Subscribers

People subscribed via source and target branches