From: José Dapena Paz Date: Fri, 12 Feb 2010 17:17:13 +0000 (+0100) Subject: Refresh the book and book view in addressbook if it changes in the X-Git-Tag: 3.2.13-1~10 X-Git-Url: http://git.maemo.org/git/?p=modest;a=commitdiff_plain;h=f321a15cec9dfb4818325d2ae78673b7a04875c5 Refresh the book and book view in addressbook if it changes in the abook roster. Fixes NB#151325. --- diff --git a/src/hildon2/modest-address-book.c b/src/hildon2/modest-address-book.c index 5653bc6..8fb7ba6 100644 --- a/src/hildon2/modest-address-book.c +++ b/src/hildon2/modest-address-book.c @@ -69,6 +69,19 @@ static gboolean resolve_address (const gchar *address, GSList **resolved_address static gchar *unquote_string (const gchar *str); static void set_contact_from_display_name (EContact *contact, const gchar *display_name); +static void +on_roster_notify (GObject *gobject, + GParamSpec *pspec, + gpointer user_data) +{ + if ((g_strcmp0 (g_param_spec_get_name (pspec), "book") == 0) || + (g_strcmp0 (g_param_spec_get_name (pspec), "book-view") == 0)) { + OssoABookRoster *roster = OSSO_ABOOK_ROSTER (gobject); + book = osso_abook_roster_get_book (roster); + book_view = osso_abook_roster_get_book_view (roster); + } +} + static gboolean open_addressbook () { @@ -101,6 +114,8 @@ open_addressbook () book = osso_abook_roster_get_book (roster); book_view = osso_abook_roster_get_book_view (roster); + g_signal_connect (G_OBJECT (roster), "notify", G_CALLBACK (on_roster_notify), NULL); + return TRUE; error: g_warning ("error opening addressbook %s", error->message);