[dconf] Deal with incompatible changes in Vala



commit a15d9621fc7019b01968df737da4f2d3772d3fb2
Author: Ryan Lortie <desrt desrt ca>
Date:   Sun Jul 3 17:10:26 2011 +0200

    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 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)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]