[empathy] LogWindow: select 'Anyone' when searching



commit 61b92614a738e8fefc9376aa66fe14b00167e30c
Author: Emilio Pozuelo Monfort <emilio pozuelo collabora co uk>
Date:   Mon Jul 11 10:06:51 2011 +0100

    LogWindow: select 'Anyone' when searching

 libempathy-gtk/empathy-log-window.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/libempathy-gtk/empathy-log-window.c b/libempathy-gtk/empathy-log-window.c
index c2a9c78..f80dfbd 100644
--- a/libempathy-gtk/empathy-log-window.c
+++ b/libempathy-gtk/empathy-log-window.c
@@ -1627,6 +1627,7 @@ populate_entities_from_search_hits (void)
   TpAccount *account;
   GtkTreeView *view;
   GtkTreeModel *model;
+  GtkTreeSelection *selection;
   GtkTreeIter iter;
   GtkListStore *store;
   GList *l;
@@ -1634,6 +1635,7 @@ populate_entities_from_search_hits (void)
   view = GTK_TREE_VIEW (log_window->priv->treeview_who);
   model = gtk_tree_view_get_model (view);
   store = GTK_LIST_STORE (model);
+  selection = gtk_tree_view_get_selection (view);
 
   gtk_list_store_clear (store);
 
@@ -1694,7 +1696,9 @@ populate_entities_from_search_hits (void)
           -1);
     }
 
-  /* FIXME: select old entity if still available */
+  /* Select 'Anyone' */
+  if (gtk_tree_model_get_iter_first (model, &iter))
+    gtk_tree_selection_select_iter (selection, &iter);
 }
 
 static void
@@ -1721,14 +1725,14 @@ log_manager_searched_new_cb (GObject *manager,
   tp_clear_pointer (&log_window->priv->hits, tpl_log_manager_search_free);
   log_window->priv->hits = hits;
 
-  populate_entities_from_search_hits ();
-
   view = GTK_TREE_VIEW (log_window->priv->treeview_when);
   selection = gtk_tree_view_get_selection (view);
 
   g_signal_handlers_unblock_by_func (selection,
       log_window_when_changed_cb,
       log_window);
+
+  populate_entities_from_search_hits ();
 }
 
 static void



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]