aboutsummaryrefslogtreecommitdiff
path: root/src/datetime-service.c
diff options
context:
space:
mode:
authorColin Watson <cjwatson@canonical.com>2013-01-31 16:25:48 +0000
committerTarmac <Unknown>2013-01-31 16:25:48 +0000
commit9db0a7b019f2219edd7d9cff7cc0a622c2ac940a (patch)
tree0e203f90a203823b881f926e25c1411c7e4ac52e /src/datetime-service.c
parentd65d439d19fec49866f5903efd1e8f0b56d94c41 (diff)
parent85cad415112462431109688344a81d640707a0aa (diff)
downloadayatana-indicator-datetime-9db0a7b019f2219edd7d9cff7cc0a622c2ac940a.tar.gz
ayatana-indicator-datetime-9db0a7b019f2219edd7d9cff7cc0a622c2ac940a.tar.bz2
ayatana-indicator-datetime-9db0a7b019f2219edd7d9cff7cc0a622c2ac940a.zip
Correct signatures of callbacks passed to g_object_connect. Fixes: https://bugs.launchpad.net/bugs/1110362.
Approved by Mathieu Trudel-Lapierre, PS Jenkins bot.
Diffstat (limited to 'src/datetime-service.c')
-rw-r--r--src/datetime-service.c41
1 files changed, 29 insertions, 12 deletions
diff --git a/src/datetime-service.c b/src/datetime-service.c
index 11d231b..a46af9e 100644
--- a/src/datetime-service.c
+++ b/src/datetime-service.c
@@ -663,7 +663,7 @@ populate_appointment_instances (ECalComponent * comp,
* this is a problem mainly on the EDS side of things, not ours.
*/
static gboolean
-update_appointment_menu_items (gpointer unused)
+update_appointment_menu_items (gpointer user_data __attribute__ ((unused)))
{
// FFR: we should take into account short term timers, for instance
// tea timers, pomodoro timers etc... that people may add, this is hinted to in the spec.
@@ -1379,26 +1379,43 @@ free_appointment_sources (void)
}
static void
-init_appointment_sources (void)
+source_changed_cb (ESource *source __attribute__ ((unused)),
+ gpointer user_data)
+{
+ update_appointment_menu_items (user_data);
+}
+
+static void
+init_appointment_sources (ESourceRegistry *registry)
{
GList * l;
- appointment_sources = e_source_registry_list_sources (source_registry, E_SOURCE_EXTENSION_CALENDAR);
+ appointment_sources = e_source_registry_list_sources (registry, E_SOURCE_EXTENSION_CALENDAR);
for (l=appointment_sources; l!=NULL; l=l->next)
- g_signal_connect (G_OBJECT(l->data), "changed", G_CALLBACK (update_appointment_menu_items), NULL);
+ g_signal_connect (G_OBJECT(l->data), "changed", G_CALLBACK (source_changed_cb), NULL);
}
/* rebuilds both the appointment sources and menu */
static void
-update_appointments (void)
+update_appointments (ESourceRegistry *registry,
+ ESource *source __attribute__ ((unused)),
+ gpointer user_data __attribute__ ((unused)))
{
free_appointment_sources ();
- init_appointment_sources ();
+ init_appointment_sources (registry);
update_appointment_menu_items (NULL);
}
+static void
+source_registry_changed_cb (ESourceRegistry *registry __attribute__ ((unused)),
+ ESource *source __attribute__ ((unused)),
+ gpointer user_data)
+{
+ update_appointment_menu_items (user_data);
+}
+
/* Function to build everything up. Entry point from asm. */
int
main (int argc, char ** argv)
@@ -1424,13 +1441,13 @@ main (int argc, char ** argv)
When sources are added or removed, update our list and menu items. */
source_registry = e_source_registry_new_sync (NULL, NULL);
g_object_connect (source_registry,
- "signal::source-added", update_appointments,
- "signal::source-removed", update_appointments,
- "signal::source-changed", update_appointment_menu_items,
- "signal::source-disabled", update_appointment_menu_items,
- "signal::source-enabled", update_appointment_menu_items,
+ "signal::source-added", G_CALLBACK (update_appointments), NULL,
+ "signal::source-removed", G_CALLBACK (update_appointments), NULL,
+ "signal::source-changed", G_CALLBACK (source_registry_changed_cb), NULL,
+ "signal::source-disabled", G_CALLBACK (source_registry_changed_cb), NULL,
+ "signal::source-enabled", G_CALLBACK (source_registry_changed_cb), NULL,
NULL);
- init_appointment_sources ();
+ init_appointment_sources (source_registry);
/* Building the base menu */
server = dbusmenu_server_new(MENU_OBJ);