aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2012-10-03 17:51:58 -0500
committerCharles Kerr <charles.kerr@canonical.com>2012-10-03 17:51:58 -0500
commitbf4edf2bc976a6ac8459d7f8583269c6a3ca6f2a (patch)
treec722a887163a86099d22bb1dcfb5e81775a21507
parent82b87171839e3dc3b5011dfff5ff92c96fd1c2c3 (diff)
downloadayatana-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
-rw-r--r--configure.ac4
-rw-r--r--src/datetime-service.c24
2 files changed, 15 insertions, 13 deletions
diff --git a/configure.ac b/configure.ac
index ce79611..e975192 100644
--- a/configure.ac
+++ b/configure.ac
@@ -59,7 +59,6 @@ CAIRO_REQUIRED_VERSION=1.10
GDK_REQUIRED_VERSION=2.22
GLIB_REQUIRED_VERSION=2.29.19
GTK3_REQUIRED_VERSION=3.1.4
-GCONF_REQUIRED_VERSION=2.31
PKG_CHECK_MODULES(INDICATOR, indicator3-0.4 >= $INDICATOR_REQUIRED_VERSION
glib-2.0 >= $GLIB_REQUIRED_VERSION
@@ -79,8 +78,7 @@ PKG_CHECK_MODULES(SERVICE, indicator3-0.4 >= $INDICATOR_REQUIRED_VERSION
libedataserver-1.2 >= EDS_REQUIRED_VERSION
libedataserverui-3.0 >= EDS_REQUIRED_VERSION
cairo >= CAIRO_REQUIRED_VERSION
- gdk-3.0 >= GDK_REQUIRED_VERSION
- gconf-2.0 >= GCONF_REQUIRED_VERSION)
+ gdk-3.0 >= GDK_REQUIRED_VERSION)
###########################
# Control Center panel
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 */