diff options
author | Milan Crha <mcrha@redhat.com> | 2011-11-03 17:50:21 +0800 |
---|---|---|
committer | Milan Crha <mcrha@redhat.com> | 2011-11-03 17:50:21 +0800 |
commit | c15fba1038c1cfbd032f9c23838366b8affbd217 (patch) | |
tree | d5d2d0cc8b951258a2fb7021a3bee0995fad937f /modules/addressbook/e-book-shell-view-private.c | |
parent | bcf8dbb96f31e1b7fcca3a179f64885ca04ff565 (diff) | |
download | gsoc2013-evolution-c15fba1038c1cfbd032f9c23838366b8affbd217.tar.gz gsoc2013-evolution-c15fba1038c1cfbd032f9c23838366b8affbd217.tar.zst gsoc2013-evolution-c15fba1038c1cfbd032f9c23838366b8affbd217.zip |
Bug #663286 - Changing view clears Contact preview
Diffstat (limited to 'modules/addressbook/e-book-shell-view-private.c')
-rw-r--r-- | modules/addressbook/e-book-shell-view-private.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/modules/addressbook/e-book-shell-view-private.c b/modules/addressbook/e-book-shell-view-private.c index 20fd278f66..b1895c4fb8 100644 --- a/modules/addressbook/e-book-shell-view-private.c +++ b/modules/addressbook/e-book-shell-view-private.c @@ -184,6 +184,25 @@ contacts_removed (EBookShellView *book_shell_view, } static void +model_query_changed_cb (EBookShellView *book_shell_view, + GParamSpec *param, + EAddressbookModel *model) +{ + EBookShellContent *book_shell_content; + EAddressbookView *current_view; + + book_shell_content = book_shell_view->priv->book_shell_content; + current_view = e_book_shell_content_get_current_view (book_shell_content); + + if (!current_view || e_addressbook_view_get_model (current_view) != model) + return; + + /* clear the contact preview when model's query changed */ + e_book_shell_content_set_preview_contact (book_shell_content, NULL); + book_shell_view->priv->preview_index = -1; +} + +static void book_shell_view_loaded_cb (GObject *source_object, GAsyncResult *result, gpointer user_data) @@ -330,6 +349,11 @@ book_shell_view_activate_selected_source (EBookShellView *book_shell_view, model, "contacts-removed", G_CALLBACK (contacts_removed), book_shell_view, G_CONNECT_SWAPPED); + + g_signal_connect_object ( + model, "notify::query", + G_CALLBACK (model_query_changed_cb), + book_shell_view, G_CONNECT_SWAPPED); } e_book_shell_content_set_current_view ( |