Use “dup” instead of “get” in method names which return a referenced object
authorPhilip Withnall <philip.withnall@collabora.co.uk>
Mon, 7 Feb 2011 22:25:38 +0000 (22:25 +0000)
committerPhilip Withnall <philip.withnall@collabora.co.uk>
Mon, 14 Feb 2011 21:51:52 +0000 (21:51 +0000)
This bumps our Vala dependency to 0.11.6, which includes a necessary fix
for the CCode annotation we use. Helps: bgo#629078

NEWS
configure.ac
folks/backend-store.vala
tools/import.vala
tools/inspect/command-backends.vala

diff --git a/NEWS b/NEWS
index 3e31188..035a0c5 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -6,6 +6,10 @@ API changes:
 * Rename the URLable interface to Urlable
 * Take a PersonaStore in IndividualAggregator.add_persona_from_details
 * Remove IndividualAggregatorError.STORE_NOT_FOUND
+* Rename the getter for BackendStore.enabled_backends from
+  folks_backend_store_get_enabled_backends() to
+  folks_backend_store_dup_enabled_backends()
+* Rename BackendStore.get_backend_by_name() to .dup_backend_by_name()
 
 Bugs fixed:
 * Bug 640901 — Allow it to be determined whether a user Tpf.Persona is in the
index 37f91d4..5d44c34 100644 (file)
@@ -73,7 +73,7 @@ AC_SUBST([FOLKS_MAJOR_MINOR_VERSION])
 GLIB_REQUIRED=2.24.0
 TP_GLIB_REQUIRED=0.13.1
 # XXX: once we bump this to 0.12.x, remove all the #if VALA_0_12 conditionals
-VALA_REQUIRED=0.10.0
+VALA_REQUIRED=0.11.6
 
 PKG_CHECK_MODULES([GLIB],
                   [glib-2.0 >= $GLIB_REQUIRED
index 347c5e7..4801967 100644 (file)
@@ -73,10 +73,11 @@ public class Folks.BackendStore : Object {
    *
    * The backends in this list have been prepared and are ready to use.
    *
-   * @since 0.2.0
+   * @since 0.3.UNRELEASED
    */
   public GLib.List<Backend> enabled_backends
     {
+      [CCode (cname = "folks_backend_store_dup_enabled_backends")]
       owned get
         {
           var backends = new GLib.List<Backend> ();
@@ -340,12 +341,15 @@ public class Folks.BackendStore : Object {
     }
 
   /**
-   * Get a backend from the store by name.
+   * Get a backend from the store by name. If a backend is returned, its
+   * reference count is increased.
    *
    * @param name the backend name to retrieve
    * @return the backend, or `null` if none could be found
+   *
+   * @since 0.3.UNRELEASED
    */
-  public Backend? get_backend_by_name (string name)
+  public Backend? dup_backend_by_name (string name)
     {
       return this._backend_hash.get (name);
     }
index 238aab9..5b7ddb4 100644 (file)
@@ -108,7 +108,7 @@ public class Folks.ImportTool : Object
         }
 
       /* Get the key-file backend */
-      Backend kf_backend = backend_store.get_backend_by_name ("key-file");
+      Backend kf_backend = backend_store.dup_backend_by_name ("key-file");
 
       if (kf_backend == null)
         {
index d3a5d18..1bf12a5 100644 (file)
@@ -68,7 +68,7 @@ private class Folks.Inspect.Commands.Backends : Folks.Inspect.Command
         {
           /* Show the details of a particular backend */
           Backend backend =
-              this.client.backend_store.get_backend_by_name (command_string);
+              this.client.backend_store.dup_backend_by_name (command_string);
 
           if (backend == null)
             {