From b89939f5a4554fd8e16169bb77fbcca3e1f6069d Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Sat, 31 Oct 2015 17:14:14 +0100 Subject: [PATCH] inspector: Split out a function --- gtk/inspector/css-node-tree.c | 33 ++++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/gtk/inspector/css-node-tree.c b/gtk/inspector/css-node-tree.c index b68c53e4eb..80b88907e6 100644 --- a/gtk/inspector/css-node-tree.c +++ b/gtk/inspector/css-node-tree.c @@ -338,20 +338,9 @@ gtk_inspector_css_node_tree_set_object (GtkInspectorCssNodeTree *cnt, } static void -populate_properties (GtkInspectorCssNodeTree *cnt) +gtk_inspector_css_node_tree_set_node (GtkInspectorCssNodeTree *cnt, + GtkCssNode *node) { - GtkInspectorCssNodeTreePrivate *priv = cnt->priv; - GtkTreeSelection *selection; - GtkTreeIter titer; - GtkCssNode *node; - GtkCssStyle *style; - gint i; - - selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (priv->node_tree)); - if (!gtk_tree_selection_get_selected (selection, NULL, &titer)) - return; - - node = gtk_tree_model_css_node_get_node_from_iter (GTK_TREE_MODEL_CSS_NODE (priv->node_model), &titer); style = gtk_css_node_get_style (node); for (i = 0; i < _gtk_css_style_property_get_n_properties (); i++) @@ -387,4 +376,22 @@ populate_properties (GtkInspectorCssNodeTree *cnt) } } +static void +populate_properties (GtkInspectorCssNodeTree *cnt) +{ + GtkInspectorCssNodeTreePrivate *priv = cnt->priv; + GtkTreeSelection *selection; + GtkTreeIter titer; + GtkCssNode *node; + GtkCssStyle *style; + gint i; + + selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (priv->node_tree)); + if (!gtk_tree_selection_get_selected (selection, NULL, &titer)) + return; + + node = gtk_tree_model_css_node_get_node_from_iter (GTK_TREE_MODEL_CSS_NODE (priv->node_model), &titer); + gtk_inspector_css_node_tree_set_node (cnt, node); +} + // vim: set et sw=2 ts=2: