[dconf-editor] Random cleanings.
- From: Arnaud Bonatti <arnaudb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [dconf-editor] Random cleanings.
- Date: Sun, 4 Oct 2015 19:57:57 +0000 (UTC)
commit 5fc780790c9f95fa63061ab6ae9eacca07ae43b6
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date: Sun Oct 4 21:57:35 2015 +0200
Random cleanings.
editor/dconf-model.vala | 18 ++++++++++--------
editor/dconf-view.vala | 4 ++--
2 files changed, 12 insertions(+), 10 deletions(-)
---
diff --git a/editor/dconf-model.vala b/editor/dconf-model.vala
index 286d740..af662c5 100644
--- a/editor/dconf-model.vala
+++ b/editor/dconf-model.vala
@@ -30,10 +30,10 @@ public struct SchemaKey
public class Key : GLib.Object
{
private SettingsModel model;
-
- public Directory? parent;
+ private Directory? parent;
public string name;
+ public string path;
public string full_name;
public string cool_text_value () // TODO better
{
@@ -82,12 +82,14 @@ public class Key : GLib.Object
value_changed ();
}
- public Key (SettingsModel model, Directory parent, string name, string full_name)
+ public Key (SettingsModel model, Directory parent, string name)
{
this.model = model;
this.parent = parent;
+
this.name = name;
- this.full_name = full_name;
+ path = parent.full_name;
+ full_name = path + name;
schema = model.keys.lookup (full_name);
has_schema = schema != null;
@@ -204,7 +206,7 @@ public class Directory : GLib.Object
if (_key_map.lookup (name) != null)
return;
- Key key = new Key (model, this, name, full_name + name);
+ Key key = new Key (model, this, name);
key_model.insert_sorted (key, (a, b) => { return strcmp (((Key) a).name, ((Key) b).name); });
_key_map.insert (name, key);
}
@@ -232,7 +234,7 @@ public struct Schema
public class SettingsModel: GLib.Object, Gtk.TreeModel
{
- public GLib.HashTable<string, Schema?> schemas = new GLib.HashTable<string, Schema?> (str_hash,
str_equal);
+ private GLib.HashTable<string, Schema?> schemas = new GLib.HashTable<string, Schema?> (str_hash,
str_equal);
public GLib.HashTable<string, SchemaKey?> keys = new GLib.HashTable<string, SchemaKey?> (str_hash,
str_equal);
public DConf.Client client;
@@ -247,7 +249,7 @@ public class SettingsModel: GLib.Object, Gtk.TreeModel
}
}
- public SettingsModel()
+ public SettingsModel ()
{
SettingsSchemaSource settings_schema_source = SettingsSchemaSource.get_default ();
string [] non_relocatable_schemas;
@@ -269,7 +271,7 @@ public class SettingsModel: GLib.Object, Gtk.TreeModel
root.load_schema (schema, schema.path [1:schema.path.length]);
}
- public void create_schema (SettingsSchema settings_schema)
+ private void create_schema (SettingsSchema settings_schema)
{
string schema_id = settings_schema.get_id ();
Schema schema = Schema () {
diff --git a/editor/dconf-view.vala b/editor/dconf-view.vala
index b4151e1..c679e5e 100644
--- a/editor/dconf-view.vala
+++ b/editor/dconf-view.vala
@@ -153,7 +153,7 @@ private class KeyEditorNoSchema : KeyEditorDialog // TODO add type informa
this.title = key.name;
if (this.use_header_bar == 1) // TODO else..?
- ((HeaderBar) this.get_header_bar ()).subtitle = key.parent.full_name; // TODO
get_header_bar() is [transfer none]
+ ((HeaderBar) this.get_header_bar ()).subtitle = key.path; // TODO get_header_bar() is
[transfer none]
create_child (custom_value_grid);
}
@@ -187,7 +187,7 @@ private class KeyEditor : KeyEditorDialog
this.title = key.name;
if (this.use_header_bar == 1) // TODO else..?
- ((HeaderBar) this.get_header_bar ()).subtitle = key.parent.full_name; // TODO
get_header_bar() is [transfer none]
+ ((HeaderBar) this.get_header_bar ()).subtitle = key.path; // TODO get_header_bar() is
[transfer none]
create_child (custom_value_grid);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]