[epiphany] EphyHistoryWindow: Use tree_selection.
- From: Arnaud Bonatti <arnaudb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany] EphyHistoryWindow: Use tree_selection.
- Date: Wed, 28 Oct 2015 07:54:13 +0000 (UTC)
commit 43c631bcb744bb44efaff82b9917ab0dc714f1fc
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date: Wed Oct 28 04:57:09 2015 +0100
EphyHistoryWindow: Use tree_selection.
src/ephy-history-window.c | 10 ++++------
src/resources/history-dialog.ui | 2 +-
2 files changed, 5 insertions(+), 7 deletions(-)
---
diff --git a/src/ephy-history-window.c b/src/ephy-history-window.c
index 3ef2150..c69f902 100644
--- a/src/ephy-history-window.c
+++ b/src/ephy-history-window.c
@@ -48,6 +48,7 @@ struct _EphyHistoryWindowPrivate
GCancellable *cancellable;
GtkWidget *treeview;
+ GtkTreeSelection *tree_selection;
GtkWidget *liststore;
GtkTreeViewColumn *date_column;
GtkTreeViewColumn *name_column;
@@ -349,11 +350,9 @@ get_selection_foreach (GtkTreeModel *model,
static GList *
get_selection (EphyHistoryWindow *self)
{
- GtkTreeSelection *selection;
GList *list = NULL;
- selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (self->priv->treeview));
- gtk_tree_selection_selected_foreach (selection,
+ gtk_tree_selection_selected_foreach (self->priv->tree_selection,
(GtkTreeSelectionForeachFunc) get_selection_foreach,
&list);
@@ -464,12 +463,10 @@ on_treeview_button_press_event (GtkWidget *widget,
EphyHistoryWindow *self)
{
if (event->button == 3) {
- GtkTreeSelection *selection;
int n;
gboolean bookmarks_locked;
- selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (self->priv->treeview));
- n = gtk_tree_selection_count_selected_rows (selection);
+ n = gtk_tree_selection_count_selected_rows (self->priv->tree_selection);
if (n == 0)
return FALSE;
@@ -714,6 +711,7 @@ ephy_history_window_class_init (EphyHistoryWindowClass *klass)
"/org/gnome/epiphany/history-dialog.ui");
gtk_widget_class_bind_template_child_private (widget_class, EphyHistoryWindow, liststore);
gtk_widget_class_bind_template_child_private (widget_class, EphyHistoryWindow, treeview);
+ gtk_widget_class_bind_template_child_private (widget_class, EphyHistoryWindow, tree_selection);
gtk_widget_class_bind_template_child_private (widget_class, EphyHistoryWindow, remove_button);
gtk_widget_class_bind_template_child_private (widget_class, EphyHistoryWindow, open_button);
gtk_widget_class_bind_template_child_private (widget_class, EphyHistoryWindow, date_column);
diff --git a/src/resources/history-dialog.ui b/src/resources/history-dialog.ui
index 306d9c7..bf2bdcf 100644
--- a/src/resources/history-dialog.ui
+++ b/src/resources/history-dialog.ui
@@ -83,7 +83,7 @@
<signal name="key-press-event" handler="on_treeview_key_press_event"/>
<signal name="row-activated" handler="on_treeview_row_activated"/>
<child internal-child="selection">
- <object class="GtkTreeSelection" id="tree_selection"> <!-- TODO use this -->
+ <object class="GtkTreeSelection" id="tree_selection">
<property name="mode">multiple</property>
<signal name="changed" handler="on_treeview_selection_changed"/>
</object>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]