-/* static void */
-/* on_key_change (ModestConf *conf, const gchar *key, ModestConfEvent event, gpointer user_data) */
-/* { */
-/* ModestAccountMgr *self = MODEST_ACCOUNT_MGR (user_data); */
-/* ModestAccountMgrPrivate *priv = MODEST_ACCOUNT_MGR_GET_PRIVATE (self); */
-/* gboolean is_account_key; */
-/* gboolean is_server_account; */
-/* gchar* account = NULL; */
-
-/* /\* there is only one not-really-account key which will still emit */
-/* * a signal: a change in MODEST_CONF_DEFAULT_ACCOUNT *\/ */
-/* if (key && strcmp (key, MODEST_CONF_DEFAULT_ACCOUNT) == 0) { */
-/* /\* Get the default account instead. *\/ */
-
-/* /\* Store the key for later notification in our timeout callback. */
-/* * Notifying for every key change would cause unnecessary work: *\/ */
-/* priv->changed_conf_keys = g_slist_append (priv->changed_conf_keys, */
-/* (gpointer) g_strdup (key)); */
-/* } */
+static void
+on_key_change (ModestConf *conf, const gchar *key, ModestConfEvent event,
+ ModestConfNotificationId id, gpointer user_data)
+{
+ ModestAccountMgr *self = MODEST_ACCOUNT_MGR (user_data);
+ gboolean is_account_key;
+ gboolean is_server_account;
+ gchar* account = NULL;
+
+ /* there is only one not-really-account key which will still emit
+ * a signal: a change in MODEST_CONF_DEFAULT_ACCOUNT */
+ if (key && strcmp (key, MODEST_CONF_DEFAULT_ACCOUNT) == 0) {
+ /* Get the default account instead. */
+ gchar *default_account = modest_account_mgr_get_default_account (self);
+ if (!default_account) {
+ g_warning ("BUG: cannot find default account");
+ return;
+ } else {
+ g_signal_emit (G_OBJECT(self), signals[ACCOUNT_CHANGED_SIGNAL], 0,
+ default_account, key, FALSE);
+ g_free(default_account);
+ return;
+ }
+ }