From 06768733f7a82c4065d88d88717ad13c2bb831cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erick=20P=C3=A9rez=20Castellanos?= Date: Thu, 5 Feb 2015 18:41:26 -0500 Subject: [PATCH] window: fix calendars popover population When the application load as a service by the time a user opens a window GcalManager:source-added signals has passed and the calendars popover does not contains any items. Use GcalManager::load_completed API --- src/gcal-window.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/gcal-window.c b/src/gcal-window.c index 3ea289f8..8c33a53a 100644 --- a/src/gcal-window.c +++ b/src/gcal-window.c @@ -1377,6 +1377,17 @@ gcal_window_constructed (GObject *object) /* refresh timeout, first is fast */ priv->refresh_timeout_id = g_timeout_add (FAST_REFRESH_TIMEOUT, (GSourceFunc) refresh_sources, object); + + /* calendars popover */ + if (gcal_manager_load_completed (priv->manager)) + { + GList *sources, *l; + sources = gcal_manager_get_sources_connected (priv->manager); + for (l = sources; l != NULL; l = g_list_next (l)) + add_source (priv->manager, l->data, gcal_manager_source_enabled (priv->manager, l->data), object); + + g_list_free (sources); + } } static void