From 09d6bda3db6ba986dad3dd4150e502ef664d6812 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?P=C5=99emysl=20Janouch?=
Date: Sun, 9 Sep 2012 16:39:36 +0200
Subject: Add ld_category_get_path() and use it.
---
liblogdiag/ld-category-symbol-view.c | 11 +++++++++++
1 file changed, 11 insertions(+)
(limited to 'liblogdiag/ld-category-symbol-view.c')
diff --git a/liblogdiag/ld-category-symbol-view.c b/liblogdiag/ld-category-symbol-view.c
index 85f7c1e..36c0d0f 100644
--- a/liblogdiag/ld-category-symbol-view.c
+++ b/liblogdiag/ld-category-symbol-view.c
@@ -28,6 +28,7 @@
struct _LdCategorySymbolViewPrivate
{
LdCategory *category;
+ gchar *path;
guint height_negotiation : 1;
};
@@ -106,6 +107,7 @@ ld_category_symbol_view_finalize (GObject *gobject)
if (self->priv->category)
g_object_unref (self->priv->category);
+ g_free (self->priv->path);
/* Chain up to the parent class. */
G_OBJECT_CLASS (ld_category_symbol_view_parent_class)->finalize (gobject);
@@ -234,8 +236,17 @@ ld_category_symbol_view_set_category (LdCategorySymbolView *self,
g_return_if_fail (LD_IS_CATEGORY (category));
if (self->priv->category)
+ {
g_object_unref (self->priv->category);
+ g_free (self->priv->path);
+ self->priv->path = NULL;
+ }
+
+ /* XXX: We should rebuild the path if the name changes but it shouldn't
+ * happen and we would have to track the parents, too. */
+ self->priv->path = ld_category_get_path (category);
+
self->priv->category = category;
g_object_ref (category);
--
cgit v1.2.3