From 26edf58f8d17fc0cf46de985f59b49a9b0a2999f Mon Sep 17 00:00:00 2001 From: karl-qdh Date: Mon, 4 Apr 2011 13:05:27 +0100 Subject: Added a change which _could_ work if evolution URI's were correct, however local:system is not a valid URI, effectively this will stop showing all calendars right now --- src/datetime-service.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/datetime-service.c b/src/datetime-service.c index 1ddaa4d..eb69d42 100644 --- a/src/datetime-service.c +++ b/src/datetime-service.c @@ -28,6 +28,7 @@ with this program. If not, see . #include #include #include +#include #include #include @@ -82,6 +83,7 @@ static GList * comp_instances = NULL; static gboolean updating_appointments = FALSE; static time_t start_time_appointments = (time_t) 0; GSettings *conf; +GConfClient* gconf; /* Geoclue trackers */ @@ -698,7 +700,13 @@ update_appointment_menu_items (gpointer user_data) comp_instances = NULL; } } - + GSList *cal_list = gconf_client_get_list(gconf, "/apps/evolution/calendar/display/selected_calendars", GCONF_VALUE_STRING, &gerror); + if (gerror) { + g_debug("Failed to get evolution preference for enabled calendars"); + g_error_free(gerror); + gerror = NULL; + cal_list = NULL; + } // Generate instances for all sources for (g = e_source_list_peek_groups (sources); g; g = g->next) { ESourceGroup *group = E_SOURCE_GROUP (g->data); @@ -716,6 +724,11 @@ update_appointment_menu_items (gpointer user_data) gerror = NULL; continue; } + const gchar *ecal_uri = e_cal_get_uri(ecal); + g_debug("Checking ecal_uri is enabled: %s, %s", ecal_uri); + // If source URI is not in source_list continue + if (cal_list != NULL && g_slist_find(cal_list, ecal_uri) == NULL) continue; + g_debug("ecal_uri is enabled, generating instances"); e_cal_generate_instances (ecal, t1, t2, (ECalRecurInstanceFn) populate_appointment_instances, (gpointer) source); } @@ -1300,6 +1313,8 @@ main (int argc, char ** argv) /* Set up GSettings */ conf = g_settings_new(SETTINGS_INTERFACE); + /* Set up gconf for getting evolution enabled calendars */ + gconf = gconf_client_get_default(); // TODO Add a signal handler to catch gsettings changes and respond to them /* Building the base menu */ -- cgit v1.2.3 From f6af2cf76470bfe177503c12699c84ba013feee7 Mon Sep 17 00:00:00 2001 From: karl-qdh Date: Mon, 4 Apr 2011 13:53:19 +0100 Subject: Working patch! YAY --- src/datetime-service.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/datetime-service.c b/src/datetime-service.c index eb69d42..d01f5dc 100644 --- a/src/datetime-service.c +++ b/src/datetime-service.c @@ -724,11 +724,18 @@ update_appointment_menu_items (gpointer user_data) gerror = NULL; continue; } - const gchar *ecal_uri = e_cal_get_uri(ecal); - g_debug("Checking ecal_uri is enabled: %s, %s", ecal_uri); - // If source URI is not in source_list continue - if (cal_list != NULL && g_slist_find(cal_list, ecal_uri) == NULL) continue; - g_debug("ecal_uri is enabled, generating instances"); + const gchar *ecal_uid = e_source_peek_uid(source); + gboolean match = FALSE; + g_debug("Checking ecal_uid is enabled: %s", ecal_uid); + for (i = 0; i