}
/* is this account enabled? */
- enabled = modest_account_mgr_account_is_enabled (self, account,
- is_server_account);
+ enabled = modest_account_mgr_account_get_enabled (self, account,
+ is_server_account);
/* account was changed.
* and always notify when enabled/disabled changes
{
ModestAccountMgrPrivate *priv =
MODEST_ACCOUNT_MGR_GET_PRIVATE (obj);
-
- priv->modest_conf = NULL;
+
+ if (priv->modest_conf) {
+ g_object_unref (G_OBJECT(priv->modest_conf));
+ priv->modest_conf = NULL;
+ }
}
obj = G_OBJECT (g_object_new (MODEST_TYPE_ACCOUNT_MGR, NULL));
priv = MODEST_ACCOUNT_MGR_GET_PRIVATE (obj);
- priv->modest_conf = conf;
+ g_object_ref (G_OBJECT(conf));
+ priv->modest_conf = conf;
g_signal_connect (G_OBJECT (conf), "key_changed",
G_CALLBACK (on_key_change),
}
-
-gboolean
-modest_account_mgr_disable_account (ModestAccountMgr *self, const gchar* name,
- gboolean is_server_account)
-{
- return modest_account_mgr_set_bool (self, name,
- MODEST_ACCOUNT_ENABLED, FALSE,
- is_server_account, NULL);
-}
-
-
gboolean
-modest_account_mgr_enable_account (ModestAccountMgr *self, const gchar* name,
- gboolean is_server_account)
+modest_account_mgr_account_set_enabled (ModestAccountMgr *self, const gchar* name,
+ gboolean is_server_account, gboolean enabled)
{
return modest_account_mgr_set_bool (self, name,
- MODEST_ACCOUNT_ENABLED, TRUE,
+ MODEST_ACCOUNT_ENABLED, enabled,
is_server_account, NULL);
}
gboolean
-modest_account_mgr_account_is_enabled (ModestAccountMgr *self, const gchar* name,
- gboolean is_server_account)
+modest_account_mgr_account_get_enabled (ModestAccountMgr *self, const gchar* name,
+ gboolean is_server_account)
{
return modest_account_mgr_get_bool (self, name,
MODEST_ACCOUNT_ENABLED, is_server_account,
}
}
- modest_account_mgr_enable_account (self, name, FALSE);
+ modest_account_mgr_account_set_enabled (self, name, FALSE, TRUE);
return TRUE;
}
g_free (key);
/* enable it */
- modest_account_mgr_enable_account (self, name, TRUE);
+ modest_account_mgr_account_set_enabled (self, name, TRUE, TRUE);
return TRUE;
}
account = account_from_key ((gchar*)cursor->data, NULL, NULL);
- enabled = modest_account_mgr_account_is_enabled (self, account, TRUE);
+ enabled = modest_account_mgr_account_get_enabled (self, account, TRUE);
acc_proto = modest_account_mgr_get_string (self, account, MODEST_ACCOUNT_PROTO,
TRUE, NULL);
if ((!acc_proto) || /* proto not defined? */