Merge lp:~achiang/indicator-datetime/0.1-always-show-calendar into lp:indicator-datetime/0.1

Proposed by Alex Chiang
Status: Merged
Approved by: Ted Gould
Approved revision: 26
Merged at revision: 26
Proposed branch: lp:~achiang/indicator-datetime/0.1-always-show-calendar
Merge into: lp:indicator-datetime/0.1
Diff against target: 52 lines (+7/-25)
1 file modified
src/datetime-service.c (+7/-25)
To merge this branch: bzr merge lp:~achiang/indicator-datetime/0.1-always-show-calendar
Reviewer Review Type Date Requested Status
Ted Gould (community) Approve
Review via email: mp+64577@code.launchpad.net

Description of the change

  Always show the calendar, even if evolution is not installed.

  We can still connect the signal to try and launch evolution; this should
  be harmless even if evolution isn't installed.

  The two implementation details above allow us to completely remove the
  check for evolution, as we're unconditionally doing them now.

fixes bug(s): https://launchpad.net/bugs/691953

To post a comment you must log in.
Revision history for this message
Ted Gould (ted) wrote :

Makes sense, thanks Alex!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/datetime-service.c'
--- src/datetime-service.c 2010-10-06 13:28:50 +0000
+++ src/datetime-service.c 2011-06-14 17:07:26 +0000
@@ -87,27 +87,6 @@
87 }87 }
88}88}
8989
90/* Looks for the calendar application and enables the item if
91 we have one */
92static gboolean
93check_for_calendar (gpointer user_data)
94{
95 g_return_val_if_fail (calendar != NULL, FALSE);
96
97 gchar *evo = g_find_program_in_path("evolution");
98 if (evo != NULL) {
99 g_debug("Found the calendar application: %s", evo);
100 dbusmenu_menuitem_property_set_bool(calendar, DBUSMENU_MENUITEM_PROP_ENABLED, TRUE);
101 dbusmenu_menuitem_property_set_bool(calendar, DBUSMENU_MENUITEM_PROP_VISIBLE, TRUE);
102 g_free(evo);
103 } else {
104 g_debug("Unable to find calendar app.");
105 dbusmenu_menuitem_property_set_bool(calendar, DBUSMENU_MENUITEM_PROP_VISIBLE, FALSE);
106 }
107
108 return FALSE;
109}
110
111/* Looks for the time and date admin application and enables the90/* Looks for the time and date admin application and enables the
112 item we have one */91 item we have one */
113static gboolean92static gboolean
@@ -147,13 +126,16 @@
147 if (calendar == NULL) {126 if (calendar == NULL) {
148 calendar = dbusmenu_menuitem_new();127 calendar = dbusmenu_menuitem_new();
149 dbusmenu_menuitem_property_set (calendar, DBUSMENU_MENUITEM_PROP_TYPE, DBUSMENU_CALENDAR_MENUITEM_TYPE);128 dbusmenu_menuitem_property_set (calendar, DBUSMENU_MENUITEM_PROP_TYPE, DBUSMENU_CALENDAR_MENUITEM_TYPE);
150 /* insensitive until we check for available apps */129
151 dbusmenu_menuitem_property_set_bool(calendar, DBUSMENU_MENUITEM_PROP_ENABLED, FALSE);130 /* Always display calendar (LP: #691953) */
131 dbusmenu_menuitem_property_set_bool(calendar, DBUSMENU_MENUITEM_PROP_ENABLED, TRUE);
132 dbusmenu_menuitem_property_set_bool(calendar, DBUSMENU_MENUITEM_PROP_VISIBLE, TRUE);
133
134 /* Should be harmless to connect signal to potentially
135 non-existent evo */
152 g_signal_connect (G_OBJECT(calendar), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED,136 g_signal_connect (G_OBJECT(calendar), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED,
153 G_CALLBACK (activate_cb), "evolution -c calendar");137 G_CALLBACK (activate_cb), "evolution -c calendar");
154 dbusmenu_menuitem_child_append(root, calendar);138 dbusmenu_menuitem_child_append(root, calendar);
155
156 g_idle_add(check_for_calendar, NULL);
157 }139 }
158140
159 DbusmenuMenuitem * separator = dbusmenu_menuitem_new();141 DbusmenuMenuitem * separator = dbusmenu_menuitem_new();

Subscribers

People subscribed via source and target branches