[dconf] editor: Fix SettingsModel.get_path (Bug #640089)
- From: Robert Ancell <rancell src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [dconf] editor: Fix SettingsModel.get_path (Bug #640089)
- Date: Thu, 10 Mar 2011 05:00:58 +0000 (UTC)
commit 9ad8fec5ff0e6790286b624f98c0b2926ccb5eb9
Author: Robert Ancell <robert ancell canonical com>
Date: Thu Mar 10 16:00:48 2011 +1100
editor: Fix SettingsModel.get_path (Bug #640089)
editor/dconf-model.vala | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/editor/dconf-model.vala b/editor/dconf-model.vala
index 960b369..48887fe 100644
--- a/editor/dconf-model.vala
+++ b/editor/dconf-model.vala
@@ -626,7 +626,8 @@ public class SettingsModel: GLib.Object, Gtk.TreeModel
public Gtk.TreePath get_path(Gtk.TreeIter iter)
{
var path = new Gtk.TreePath();
- path.append_index((int)get_directory(iter).index);
+ for (var d = get_directory(iter); d != root; d = d.parent)
+ path.prepend_index((int)d.index);
return path;
}
@@ -670,7 +671,7 @@ public class SettingsModel: GLib.Object, Gtk.TreeModel
{
Directory directory = get_directory(parent);
if (n >= directory.children.length())
- return false;
+ return false;
set_iter(out iter, directory.children.nth_data(n));
return true;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]