[epiphany] ephy-node-view: added ephy_node_view_get_iter_for_node()
- From: Sergio Villar Senin <svillar src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany] ephy-node-view: added ephy_node_view_get_iter_for_node()
- Date: Mon, 3 Sep 2012 10:25:45 +0000 (UTC)
commit c077cdea4bcdb95b58b7fff0b9dc7cce3aaa2982
Author: Sergio Villar Senin <svillar igalia com>
Date: Fri Aug 24 12:13:34 2012 +0200
ephy-node-view: added ephy_node_view_get_iter_for_node()
The EphyNodeView is based on the following stack of models:
Sort model -> Filter model -> EphyTreeModelNode
This function returns a GtkTreeIter pointing to a row in the sort model from
a EphyNode that belongs to the EphyTreeModelNode.
https://bugzilla.gnome.org/show_bug.cgi?id=673795
lib/widgets/ephy-node-view.c | 19 +++++++++++++++++++
lib/widgets/ephy-node-view.h | 4 ++++
2 files changed, 23 insertions(+), 0 deletions(-)
---
diff --git a/lib/widgets/ephy-node-view.c b/lib/widgets/ephy-node-view.c
index abd1f0f..1be6c93 100644
--- a/lib/widgets/ephy-node-view.c
+++ b/lib/widgets/ephy-node-view.c
@@ -1809,6 +1809,25 @@ ephy_node_view_popup (EphyNodeView *view, GtkWidget *menu)
}
}
+gboolean
+ephy_node_view_get_iter_for_node (EphyNodeView *view,
+ GtkTreeIter *iter,
+ EphyNode *node)
+{
+ GtkTreeIter node_iter, filter_iter;
+
+ ephy_tree_model_node_iter_from_node (EPHY_TREE_MODEL_NODE (view->priv->nodemodel), node, &node_iter);
+ if (!gtk_tree_model_filter_convert_child_iter_to_iter (GTK_TREE_MODEL_FILTER (view->priv->filtermodel),
+ &filter_iter, &node_iter))
+ return FALSE;
+
+ if (!gtk_tree_model_sort_convert_child_iter_to_iter (GTK_TREE_MODEL_SORT (view->priv->sortmodel),
+ iter, &filter_iter))
+ return FALSE;
+
+ return TRUE;
+}
+
static void
ephy_node_view_class_init (EphyNodeViewClass *klass)
{
diff --git a/lib/widgets/ephy-node-view.h b/lib/widgets/ephy-node-view.h
index 70f5039..4232925 100644
--- a/lib/widgets/ephy-node-view.h
+++ b/lib/widgets/ephy-node-view.h
@@ -129,6 +129,10 @@ gboolean ephy_node_view_is_target (EphyNodeView *view);
void ephy_node_view_popup (EphyNodeView *view,
GtkWidget *menu);
+gboolean ephy_node_view_get_iter_for_node (EphyNodeView *view,
+ GtkTreeIter *iter,
+ EphyNode *node);
+
G_END_DECLS
#if !defined (__EPHY_EPIPHANY_H_INSIDE__) && !defined (EPIPHANY_COMPILATION)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]