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 11:03:44 +0000 (12:03 +0100)
src/gtk/modest-platform.c
src/hildon2/modest-platform.c
src/modest-account-mgr.c
src/modest-platform.h

index 35eeab7..9254016 100644 (file)
@@ -2368,7 +2368,21 @@ modest_platform_get_list_to_move (ModestWindow *window)
 }
 
 void
-modest_platform_emit_folder_updated_signal (const gchar *account_id, const gch
+modest_platform_emit_folder_updated_signal (const gchar *account_id, const gchar *folder_id)
 {
        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 27f8f4f..d8f9225 100644 (file)
@@ -3189,3 +3189,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 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 ef5c8a6..bc389c5 100644 (file)
@@ -567,6 +567,8 @@ DBusConnection* modest_platform_get_dbus_connection (void);
 #endif
 
 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