diff options
author | Charles Kerr <charles.kerr@canonical.com> | 2012-10-03 17:51:58 -0500 |
---|---|---|
committer | Charles Kerr <charles.kerr@canonical.com> | 2012-10-03 17:51:58 -0500 |
commit | bf4edf2bc976a6ac8459d7f8583269c6a3ca6f2a (patch) | |
tree | c722a887163a86099d22bb1dcfb5e81775a21507 /src | |
parent | 82b87171839e3dc3b5011dfff5ff92c96fd1c2c3 (diff) | |
download | ayatana-indicator-datetime-bf4edf2bc976a6ac8459d7f8583269c6a3ca6f2a.tar.gz ayatana-indicator-datetime-bf4edf2bc976a6ac8459d7f8583269c6a3ca6f2a.tar.bz2 ayatana-indicator-datetime-bf4edf2bc976a6ac8459d7f8583269c6a3ca6f2a.zip |
don't use gconf to see if evolution accounts are installed -- we can have calendars even if gconf returns empty
Diffstat (limited to 'src')
-rw-r--r-- | src/datetime-service.c | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/src/datetime-service.c b/src/datetime-service.c index 441cbf0..0064519 100644 --- a/src/datetime-service.c +++ b/src/datetime-service.c @@ -29,7 +29,6 @@ with this program. If not, see <http://www.gnu.org/licenses/>. #include <glib/gi18n.h> #include <gio/gio.h> #include <math.h> -#include <gconf/gconf-client.h> #include <libdbusmenu-gtk/menuitem.h> #include <libdbusmenu-glib/server.h> @@ -91,7 +90,6 @@ static GList * comp_instances = NULL; static gboolean updating_appointments = FALSE; static time_t start_time_appointments = (time_t) 0; static GSettings * conf = NULL; -static GConfClient * gconf = NULL; /* Geoclue trackers */ @@ -537,12 +535,20 @@ calendar_app_is_usable (void) g_debug ("found calendar app: '%s'", evo); g_free (evo); - /* confirm that it's got an account set up... */ - GSList *accounts_list = gconf_client_get_list (gconf, "/apps/evolution/mail/accounts", GCONF_VALUE_STRING, NULL); - const guint n = g_slist_length (accounts_list); - g_debug ("found %u evolution accounts", n); - g_slist_free_full (accounts_list, g_free); - return n > 0; + /* see if there are any enabled calendars */ + gboolean has_enabled_calendar_source = FALSE; + ESourceRegistry * registry = e_source_registry_new_sync (NULL, NULL); + if (registry != NULL) { + GList * l = NULL; + GList * sources = NULL; + sources = e_source_registry_list_sources (registry, E_SOURCE_EXTENSION_CALENDAR); + for (l=sources; !has_enabled_calendar_source && l!=NULL; l=l->next) + has_enabled_calendar_source = e_source_get_enabled (E_SOURCE(l->data)); + g_list_free_full (sources, g_object_unref); + g_object_unref (registry); + } + + return has_enabled_calendar_source; } /* Looks for the calendar application and enables the item if @@ -1410,8 +1416,6 @@ 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 */ |