From f5dbd4b46192eb32cff4e2b2fb4a171cf816d0dd Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jos=C3=A9=20Dapena=20Paz?= Date: Sat, 23 Jan 2010 20:45:52 +0100 Subject: [PATCH] Add emision of signals for account created and removed through dbus --- src/gnome/modest-platform.c | 13 +++++++++++++ src/hildon2/modest-platform.c | 22 ++++++++++++++++++++++ src/maemo/modest-platform.c | 23 +++++++++++++++++++++++ src/modest-account-mgr.c | 3 +++ src/modest-platform.h | 2 ++ 5 files changed, 63 insertions(+) diff --git a/src/gnome/modest-platform.c b/src/gnome/modest-platform.c index de14914..8923c7e 100644 --- a/src/gnome/modest-platform.c +++ b/src/gnome/modest-platform.c @@ -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; +} diff --git a/src/hildon2/modest-platform.c b/src/hildon2/modest-platform.c index e46686f..ff3934e 100644 --- a/src/hildon2/modest-platform.c +++ b/src/hildon2/modest-platform.c @@ -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); +} diff --git a/src/maemo/modest-platform.c b/src/maemo/modest-platform.c index 9485a63..52f7206 100644 --- a/src/maemo/modest-platform.c +++ b/src/maemo/modest-platform.c @@ -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); +} diff --git a/src/modest-account-mgr.c b/src/modest-account-mgr.c index 48a96dc..c0b7cf2 100644 --- a/src/modest-account-mgr.c +++ b/src/modest-account-mgr.c @@ -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; } diff --git a/src/modest-platform.h b/src/modest-platform.h index e3f346f..b029780 100644 --- a/src/modest-platform.h +++ b/src/modest-platform.h @@ -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 -- 1.7.9.5