summaryrefslogtreecommitdiff
blob: 00b43cb3150b5b356aeff925d7f34e443369f54f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
Index: gconf-editor-window.c
===================================================================
RCS file: /cvs/gnome/gconf-editor/src/gconf-editor-window.c,v
retrieving revision 1.35
diff -u -p -r1.35 gconf-editor-window.c
--- gconf-editor-window.c	22 Aug 2002 13:05:30 -0000	1.35
+++ gconf-editor-window.c	7 Nov 2002 00:55:52 -0000
@@ -455,7 +455,7 @@ gconf_editor_window_selection_changed (G
 	if (selection == NULL)
 		gtk_window_set_title (GTK_WINDOW (window), _("GConf editor"));
 	else {
-		gchar *name, *title, *path;
+	  	gchar *name, *title, *path, *escape_path;
 		GtkTreeIter child_iter;
 
 		if (!gtk_tree_selection_get_selected (selection, NULL, &iter)) {
@@ -478,8 +478,11 @@ gconf_editor_window_selection_changed (G
 		gtk_statusbar_pop (GTK_STATUSBAR (window->statusbar), 0);
 		gtk_statusbar_push (GTK_STATUSBAR (window->statusbar), 0, path);
 
-		gconf_list_model_set_root_path (GCONF_LIST_MODEL (window->list_model), path);
+		escape_path = gconf_tree_model_get_gconf_escape_path (path);
+		
+		gconf_list_model_set_root_path (GCONF_LIST_MODEL (window->list_model), escape_path);
 
+		g_free (escape_path);
 		g_free (path);
 
 	}
Index: gconf-tree-model.c
===================================================================
RCS file: /cvs/gnome/gconf-editor/src/gconf-tree-model.c,v
retrieving revision 1.12
diff -u -p -r1.12 gconf-tree-model.c
--- gconf-tree-model.c	9 Sep 2002 07:11:46 -0000	1.12
+++ gconf-tree-model.c	7 Nov 2002 00:55:52 -0000
@@ -104,17 +104,43 @@ gconf_tree_model_get_gconf_name (GConfTr
 	return g_strdup (ptr);
 }
 
+gchar *
+gconf_tree_model_get_gconf_escape_path (gchar *node_path)
+{
+	gchar *ptr;
+	gchar *escape_key;
+	gchar *escape_node_path;
+	gchar *node_dir;
+
+	ptr = node_path + strlen (node_path);
+
+	while (ptr[-1] != '/')
+		ptr--;
+
+	escape_key = gconf_escape_key (ptr, -1);
+
+	node_dir = g_strndup (node_path, ptr - node_path);
+	escape_node_path = g_strconcat (node_dir, escape_key, NULL);
+	g_free (node_dir);
+	g_free (escape_key);
+
+	return escape_node_path;
+
+}
 static gboolean
 gconf_tree_model_build_level (GConfTreeModel *model, Node *parent_node, gboolean emit_signals)
 {
 	GSList *list, *tmp;
 	Node *tmp_node = NULL;
 	gint i = 0;
+	gchar *escape_key;
 
 	if (parent_node->children)
 		return FALSE;
 
-	list = gconf_client_all_dirs (model->client, parent_node->path, NULL);
+	escape_key = gconf_tree_model_get_gconf_escape_path (parent_node->path);
+	list = gconf_client_all_dirs (model->client, escape_key, NULL);
+	g_free (escape_key);
 
 	if (!list)
 		return FALSE;
@@ -125,7 +151,8 @@ gconf_tree_model_build_level (GConfTreeM
 		node = g_new0 (Node, 1);
 		node->offset = i;
 		node->parent = parent_node;
-		node->path = tmp->data;
+		node->path = gconf_unescape_key (tmp->data, -1);
+		g_free (tmp->data);
 
 		if (tmp_node) {
 			tmp_node->next = node;
@@ -402,8 +429,11 @@ gconf_tree_model_iter_has_child (GtkTree
 	GConfTreeModel *model = (GConfTreeModel *)tree_model;
 	Node *node = iter->user_data;
 	GSList *list;
+	gchar *escape_key;
 
-	list = gconf_client_all_dirs (model->client, node->path, NULL);
+	escape_key = gconf_tree_model_get_gconf_escape_path (node->path);
+	list = gconf_client_all_dirs (model->client, escape_key, NULL);
+	g_free (escape_key);
 
 	if (list == NULL)
 		return FALSE;
Index: gconf-tree-model.h
===================================================================
RCS file: /cvs/gnome/gconf-editor/src/gconf-tree-model.h,v
retrieving revision 1.2
diff -u -p -r1.2 gconf-tree-model.h
--- gconf-tree-model.h	14 Jan 2002 18:13:05 -0000	1.2
+++ gconf-tree-model.h	7 Nov 2002 00:55:52 -0000
@@ -62,4 +62,6 @@ gchar *gconf_tree_model_get_gconf_path (
 
 GtkTreePath *gconf_tree_model_get_tree_path_from_gconf_path (GConfTreeModel *tree_model, const char *path);
 
+gchar *gconf_tree_model_get_gconf_escape_path (gchar *node_path);
+
 #endif /* __GCONF_TREE_MODEL_H__ */