From 80299b6ee8f4712c618e032a4db98ef588a06151 Mon Sep 17 00:00:00 2001 From: Jose Dapena Paz Date: Fri, 24 Jul 2009 13:44:04 +0200 Subject: [PATCH] On setting the update interval, if no accounts set, remove alarmd handler. * src/hildon2/modest-platform.c (modest_platform_set_update_interval): if there are no accounts available, then we set update interval to 0 (remove alarmd cookies then). --- src/hildon2/modest-platform.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/hildon2/modest-platform.c b/src/hildon2/modest-platform.c index 5341ec7..0223d15 100644 --- a/src/hildon2/modest-platform.c +++ b/src/hildon2/modest-platform.c @@ -1487,7 +1487,16 @@ modest_platform_set_update_interval (guint minutes) ModestConf *conf = modest_runtime_get_conf (); if (!conf) return FALSE; - + + if (minutes > 0) { + GSList *acc_names = modest_account_mgr_account_names (modest_runtime_get_account_mgr (), TRUE); + if (!acc_names) { + minutes = 0; + } else { + modest_account_mgr_free_account_names (acc_names); + } + } + cookie_t alarm_cookie = modest_conf_get_int (conf, MODEST_CONF_ALARM_ID, NULL); /* Delete any existing alarm, -- 1.7.9.5