summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Lortie <desrt@desrt.ca>2011-07-03 17:10:26 +0200
committerRyan Lortie <desrt@desrt.ca>2011-07-03 17:15:41 +0200
commita15d9621fc7019b01968df737da4f2d3772d3fb2 (patch)
tree12020182587bff9d3f9d0db8a8ca106333457a62
parenta15802bd044b93c02ecd880d0c2bcb5935b03d92 (diff)
downloaddconf-a15d9621fc7019b01968df737da4f2d3772d3fb2.tar.gz
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.
-rw-r--r--editor/dconf-model.vala12
1 files changed, 12 insertions, 0 deletions
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)