aboutsummaryrefslogtreecommitdiffstats
path: root/modules/addressbook
diff options
context:
space:
mode:
authorRodrigo Moya <rodrigo@gnome-db.org>2011-11-04 22:56:23 +0800
committerRodrigo Moya <rodrigo@gnome-db.org>2011-11-04 22:56:23 +0800
commitceda5ef420b4a4b97ce0011d49be3f96e857c9ef (patch)
tree621497274e87df0125011eced8f0cfad21e198fe /modules/addressbook
parent80b0ca6849fd7b09a81a445771ae4ec64610ba18 (diff)
parentc15fba1038c1cfbd032f9c23838366b8affbd217 (diff)
downloadgsoc2013-evolution-ceda5ef420b4a4b97ce0011d49be3f96e857c9ef.tar
gsoc2013-evolution-ceda5ef420b4a4b97ce0011d49be3f96e857c9ef.tar.gz
gsoc2013-evolution-ceda5ef420b4a4b97ce0011d49be3f96e857c9ef.tar.bz2
gsoc2013-evolution-ceda5ef420b4a4b97ce0011d49be3f96e857c9ef.tar.lz
gsoc2013-evolution-ceda5ef420b4a4b97ce0011d49be3f96e857c9ef.tar.xz
gsoc2013-evolution-ceda5ef420b4a4b97ce0011d49be3f96e857c9ef.tar.zst
gsoc2013-evolution-ceda5ef420b4a4b97ce0011d49be3f96e857c9ef.zip
Merge branch 'master' into wip/gsettings
Diffstat (limited to 'modules/addressbook')
-rw-r--r--modules/addressbook/e-book-shell-view-private.c24
-rw-r--r--modules/addressbook/e-book-shell-view.c3
2 files changed, 24 insertions, 3 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 (
diff --git a/modules/addressbook/e-book-shell-view.c b/modules/addressbook/e-book-shell-view.c
index 57b86c8d86..f0541eb40c 100644
--- a/modules/addressbook/e-book-shell-view.c
+++ b/modules/addressbook/e-book-shell-view.c
@@ -247,9 +247,6 @@ book_shell_view_execute_search (EShellView *shell_view)
view, filter_id, search_id, search_text, advanced_search);
g_free (query);
g_free (search_text);
-
- e_book_shell_content_set_preview_contact (book_shell_content, NULL);
- priv->preview_index = -1;
}
static void