Add emision of signals for account created and removed through dbus
authorJosé Dapena Paz <jdapena@igalia.com>
Sat, 23 Jan 2010 19:45:52 +0000 (20:45 +0100)
committerJosé Dapena Paz <jdapena@igalia.com>
Tue, 26 Jan 2010 10:19:14 +0000 (11:19 +0100)
src/gnome/modest-platform.c
src/hildon2/modest-platform.c
src/maemo/modest-platform.c
src/modest-account-mgr.c
src/modest-platform.h

index de14914..8923c7e 100644 (file)
@@ -664,3 +664,16 @@ modest_platform_emit_folder_updated_signal (const gchar *account_id, const gchar
 {
        return;
 }
+
+
+void
+modest_platform_emit_account_created_signal (const gchar *account_id)
+{
+       return;
+}
+
+void
+modest_platform_emit_account_removed_signal (const gchar *account_id)
+{
+       return;
+}
index e46686f..ff3934e 100644 (file)
@@ -3186,3 +3186,25 @@ modest_platform_emit_folder_updated_signal (const gchar *account_id, const gchar
 
        modest_dbus_emit_folder_updated_signal (con, account_id, folder_id);
 }
+
+void
+modest_platform_emit_account_created_signal (const gchar *account_id)
+{
+       DBusConnection *con;
+
+       con = modest_platform_get_dbus_connection ();
+       if (!con) return;
+
+       modest_dbus_emit_account_created_signal (con, account_id);
+}
+
+void
+modest_platform_emit_account_removed_signal (const gchar *account_id)
+{
+       DBusConnection *con;
+
+       con = modest_platform_get_dbus_connection ();
+       if (!con) return;
+
+       modest_dbus_emit_account_removed_signal (con, account_id);
+}
index 9485a63..52f7206 100644 (file)
@@ -2279,3 +2279,26 @@ modest_platform_emit_folder_updated_signal (const gchar *account_id, const gchar
 
        modest_dbus_emit_folder_updated_signal (con, account_id, folder_id);
 }
+
+
+void
+modest_platform_emit_account_created_signal (const gchar *account_id)
+{
+       DBusConnection *con;
+
+       con = modest_platform_get_dbus_connection ();
+       if (!con) return;
+
+       modest_dbus_emit_account_created_signal (con, account_id);
+}
+
+void
+modest_platform_emit_account_removed_signal (const gchar *account_id)
+{
+       DBusConnection *con;
+
+       con = modest_platform_get_dbus_connection ();
+       if (!con) return;
+
+       modest_dbus_emit_account_removed_signal (con, account_id);
+}
index 48a96dc..c0b7cf2 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;
 }
index e3f346f..b029780 100644 (file)
@@ -565,6 +565,8 @@ TnyList* modest_platform_get_list_to_move (ModestWindow *window);
 DBusConnection* modest_platform_get_dbus_connection (void);
 
 void modest_platform_emit_folder_updated_signal (const gchar *account_id, const gchar *folder_id);
+void modest_platform_emit_account_created_signal (const gchar *account_id);
+void modest_platform_emit_account_removed_signal (const gchar *account_id);
 
 G_END_DECLS