also check with account addition/deletion.
Fixes: NB#64945
pmo-trunk-r3578
#define HILDON_OSSO_URI_ACTION "uri-action"
#define URI_ACTION_COPY "copy:"
#define HILDON_OSSO_URI_ACTION "uri-action"
#define URI_ACTION_COPY "copy:"
-/* The maximun number of notifications that could be shown in the
- desktop. It's specified by the specs and limited by the screen
- size */
-#define MAX_NOTIFICATIONS 6
-
-static osso_context_t *osso_context = NULL;
+static osso_context_t *osso_context = NULL; /* urgh global */
static void
on_modest_conf_update_interval_changed (ModestConf* self,
static void
on_modest_conf_update_interval_changed (ModestConf* self,
ModestConfNotificationId id,
gpointer user_data)
{
ModestConfNotificationId id,
gpointer user_data)
{
+ g_return_if_fail (key);
+
if (strcmp (key, MODEST_CONF_UPDATE_INTERVAL) == 0) {
const guint update_interval_minutes =
modest_conf_get_int (self, MODEST_CONF_UPDATE_INTERVAL, NULL);
if (strcmp (key, MODEST_CONF_UPDATE_INTERVAL) == 0) {
const guint update_interval_minutes =
modest_conf_get_int (self, MODEST_CONF_UPDATE_INTERVAL, NULL);
{
osso_hw_state_t hw_state = { 0 };
DBusConnection *con;
{
osso_hw_state_t hw_state = { 0 };
DBusConnection *con;
if (!check_required_files ()) {
g_printerr ("modest: missing required files\n");
return FALSE;
if (!check_required_files ()) {
g_printerr ("modest: missing required files\n");
return FALSE;
"key_changed",
G_CALLBACK (on_modest_conf_update_interval_changed),
NULL);
"key_changed",
G_CALLBACK (on_modest_conf_update_interval_changed),
NULL);
-
- /* Get the initial update interval from gconf: */
- on_modest_conf_update_interval_changed(conf, MODEST_CONF_UPDATE_INTERVAL,
- MODEST_CONF_EVENT_KEY_CHANGED, 0, NULL);
+
+ /* only force the setting of the default interval, if there are actually
+ * any accounts */
+ acc_names = modest_account_mgr_account_names (modest_runtime_get_account_mgr(), TRUE);
+ if (acc_names) {
+ /* Get the initial update interval from gconf: */
+ on_modest_conf_update_interval_changed(conf, MODEST_CONF_UPDATE_INTERVAL,
+ MODEST_CONF_EVENT_KEY_CHANGED, 0, NULL);
+ modest_account_mgr_free_account_names (acc_names);
+ }
/* initialize the addressbook */
if (!osso_abook_init (&argc, &argv, osso_context)) {
/* initialize the addressbook */
if (!osso_abook_init (&argc, &argv, osso_context)) {
#include <modest-account-mgr.h>
#include <modest-account-mgr-priv.h>
#include <modest-account-mgr-helpers.h>
#include <modest-account-mgr.h>
#include <modest-account-mgr-priv.h>
#include <modest-account-mgr-helpers.h>
+#include <modest-platform.h>
/* 'private'/'protected' functions */
static void modest_account_mgr_class_init (ModestAccountMgrClass * klass);
/* 'private'/'protected' functions */
static void modest_account_mgr_class_init (ModestAccountMgrClass * klass);
if (!default_account)
modest_account_mgr_set_default_account (self, name);
g_free (default_account);
if (!default_account)
modest_account_mgr_set_default_account (self, name);
g_free (default_account);
+
+ /* (re)set the automatic account update */
+ modest_platform_set_update_interval
+ (modest_conf_get_int (priv->modest_conf, MODEST_CONF_UPDATE_INTERVAL, NULL));
+
will retrieve also the deleted account */
g_signal_emit (G_OBJECT(self), signals[ACCOUNT_REMOVED_SIGNAL], 0, name);
will retrieve also the deleted account */
g_signal_emit (G_OBJECT(self), signals[ACCOUNT_REMOVED_SIGNAL], 0, name);
+ /* if this was the last account, stop any auto-updating */
+ /* (re)set the automatic account update */
+ GSList *acc_names = modest_account_mgr_account_names (self, TRUE);
+ if (!acc_names)
+ modest_platform_set_update_interval (0);
+ else
+ modest_account_mgr_free_account_names (acc_names);
+