Modified webpage: now tinymail repository is in gitorious.
[modest] / src / modest-account-mgr.c
index 48a96dc..a52eec6 100644 (file)
@@ -342,6 +342,7 @@ modest_account_mgr_add_account_from_settings (ModestAccountMgr *self,
                                
        /* Notify the observers */
        g_signal_emit (self, signals[ACCOUNT_INSERTED_SIGNAL], 0, account_name);
+       modest_platform_emit_account_created_signal (account_name);
 
        /* if no default account has been defined yet, do so now */
        default_account = modest_account_mgr_get_default_account (self);
@@ -456,6 +457,7 @@ modest_account_mgr_add_account (ModestAccountMgr *self,
 
        /* Notify the observers */
        g_signal_emit (self, signals[ACCOUNT_INSERTED_SIGNAL], 0, name);
+       modest_platform_emit_account_created_signal (name);
 
        /* if no default account has been defined yet, do so now */
        default_account = modest_account_mgr_get_default_account (self);
@@ -717,6 +719,7 @@ modest_account_mgr_remove_account (ModestAccountMgr * self,
           the keys, because otherwise a call to account_names
           will retrieve also the deleted account */
        g_signal_emit (G_OBJECT(self), signals[ACCOUNT_REMOVED_SIGNAL], 0, name);
+       modest_platform_emit_account_removed_signal (name);
        
        return TRUE;
 }
@@ -1072,6 +1075,13 @@ modest_account_mgr_set_bool (ModestAccountMgr * self, const gchar * name,
                g_printerr ("modest: error setting bool '%s': %s\n", keyname, err->message);
                g_error_free (err);
                retval = FALSE;
+       } else {
+               /* check whether this field is one of those interesting for the 
+                * "account-updated" signal */
+               if (strcmp (key, MODEST_ACCOUNT_HAS_NEW_MAILS) == 0) {
+                       g_signal_emit (G_OBJECT(self), signals[ACCOUNT_UPDATED_SIGNAL], 
+                                       0, name);
+               }
        }
 
        return retval;
@@ -1465,7 +1475,7 @@ modest_account_mgr_has_accounts (ModestAccountMgr* self, gboolean enabled)
        
        if (enabled && priv->has_enabled_accounts)
                return TRUE;
-       else if (priv->has_accounts)
+       else if (!enabled && priv->has_accounts)
                return TRUE;
                
        /* Check that at least one account exists: */