+
+static void
+da_cat_build_fullname(Category *item)
+{
+Category *parent;
+
+ g_free(item->fullname);
+ if( item->parent == 0 )
+ item->fullname = g_strdup(item->name);
+ else
+ {
+ parent = da_cat_get(item->parent);
+ if( parent != NULL )
+ item->fullname = g_strconcat(parent->name, ":", item->name, NULL);
+ }
+
+ DB( g_print("- updated %d:'%s' fullname='%s'\n", item->key, item->name, item->fullname) );
+
+}
+
+
+static void
+da_cat_rename(Category *item, gchar *newname)
+{
+
+ DB( g_print("- renaming %s' => '%s'\n", item->name, newname) );
+
+ g_free(item->name);
+ item->name = g_strdup(newname);
+ da_cat_build_fullname(item);
+
+ if( item->parent == 0 )
+ {
+ GHashTableIter iter;
+ gpointer value;
+
+ DB( g_print("- updating subcat fullname\n") );
+
+ g_hash_table_iter_init (&iter, GLOBALS->h_cat);
+ while (g_hash_table_iter_next (&iter, NULL, &value))
+ {
+ Category *subcat = value;
+
+ if( subcat->parent == item->key )
+ da_cat_build_fullname(subcat);
+ }
+
+ }
+}
+
+