summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2015-01-18 00:14:08 +0100
committerBenjamin Otte <otte@redhat.com>2015-01-20 06:30:19 +0100
commit7ba7dff69e5d6902845f91119c90658420a54c0a (patch)
treeb85dfd8455634dc8237859e54e8b0e916c4144ef
parent4ba710ea3091f9e3603c4fc77dc4c14c083021b6 (diff)
downloadgtk+-7ba7dff69e5d6902845f91119c90658420a54c0a.tar.gz
inspector: Remove unused treemodel properties
As a side effect, we can use _gtk_css_section_to_string() to format the section and save a lot of code.
-rw-r--r--gtk/inspector/style-prop-list.c51
1 files changed, 3 insertions, 48 deletions
diff --git a/gtk/inspector/style-prop-list.c b/gtk/inspector/style-prop-list.c
index b35bd6068e..ab29f9b4c3 100644
--- a/gtk/inspector/style-prop-list.c
+++ b/gtk/inspector/style-prop-list.c
@@ -42,9 +42,7 @@ enum
{
COLUMN_NAME,
COLUMN_VALUE,
- COLUMN_LOCATION,
- COLUMN_URI,
- COLUMN_LINE
+ COLUMN_LOCATION
};
struct _GtkInspectorStylePropListPrivate
@@ -308,8 +306,6 @@ populate (GtkInspectorStylePropList *self)
GtkCssSection *section;
gchar *location;
gchar *value;
- gchar *uri;
- guint start_line, end_line;
prop = _gtk_css_style_property_lookup_by_id (i);
name = _gtk_style_property_get_name (GTK_STYLE_PROPERTY (prop));
@@ -320,59 +316,18 @@ populate (GtkInspectorStylePropList *self)
section = gtk_css_style_get_section (style, i);
if (section)
- {
- location = _gtk_css_section_to_string (section);
- GFileInfo *info;
- GFile *file;
- const gchar *path;
-
- start_line = gtk_css_section_get_start_line (section);
- end_line = gtk_css_section_get_end_line (section);
-
- file = gtk_css_section_get_file (section);
- if (file)
- {
- info = g_file_query_info (file, G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME, 0, NULL, NULL);
-
- if (info)
- path = g_file_info_get_display_name (info);
- else
- path = "<broken file>";
-
- uri = g_file_get_uri (file);
- }
- else
- {
- info = NULL;
- path = "<data>";
- uri = NULL;
- }
-
- if (end_line != start_line)
- location = g_strdup_printf ("%s:%u-%u", path, start_line + 1, end_line + 1);
- else
- location = g_strdup_printf ("%s:%u", path, start_line + 1);
- if (info)
- g_object_unref (info);
- }
+ location = _gtk_css_section_to_string (section);
else
- {
- location = NULL;
- uri = NULL;
- start_line = -1;
- }
+ location = NULL;
gtk_list_store_set (priv->model,
iter,
COLUMN_VALUE, value,
COLUMN_LOCATION, location,
- COLUMN_URI, uri,
- COLUMN_LINE, start_line + 1,
-1);
g_free (location);
g_free (value);
- g_free (uri);
}
}