From a15d9621fc7019b01968df737da4f2d3772d3fb2 Mon Sep 17 00:00:00 2001 From: Ryan Lortie Date: Sun, 3 Jul 2011 17:10:26 +0200 Subject: Deal with incompatible changes in Vala Vala 0.13 (leading toward 0.14) corrects an error in the binding for GtkTreeModel. Unfortunately, the correction is incompatible and there is no way to have code that will work with both old and new Vala compilers. Rather than hard-depend on the unstable Vala release, just use two separate declarations decided on #if VALA_0_14. --- editor/dconf-model.vala | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/editor/dconf-model.vala b/editor/dconf-model.vala index e03f530..0931c32 100644 --- a/editor/dconf-model.vala +++ b/editor/dconf-model.vala @@ -349,7 +349,11 @@ public class KeyModel: GLib.Object, Gtk.TreeModel return iter_nth_child(out iter, null, path.get_indices()[0]); } +#if VALA_0_14 + public Gtk.TreePath? get_path(Gtk.TreeIter iter) +#else public Gtk.TreePath get_path(Gtk.TreeIter iter) +#endif { var path = new Gtk.TreePath(); path.append_index(get_key(iter).index); @@ -485,7 +489,11 @@ public class EnumModel: GLib.Object, Gtk.TreeModel return iter_nth_child(out iter, null, path.get_indices()[0]); } +#if VALA_0_14 + public Gtk.TreePath? get_path(Gtk.TreeIter iter) +#else public Gtk.TreePath get_path(Gtk.TreeIter iter) +#endif { var path = new Gtk.TreePath(); path.append_index((int)get_enum_value(iter).index); @@ -653,7 +661,11 @@ public class SettingsModel: GLib.Object, Gtk.TreeModel return true; } +#if VALA_0_14 + public Gtk.TreePath? get_path(Gtk.TreeIter iter) +#else public Gtk.TreePath get_path(Gtk.TreeIter iter) +#endif { var path = new Gtk.TreePath(); for (var d = get_directory(iter); d != root; d = d.parent) -- cgit v1.2.1