[folks] Fixes to build with last vala release.



commit 84dab9a4e3e286be601eb105b8bb6f6d57ec0d46
Author: Erick PÃrez Castellanos <erick red gmail com>
Date:   Thu Aug 9 14:55:38 2012 -0400

    Fixes to build with last vala release.
    
    Vala change:
    1. Warn when accessing static members with an instance reference.
    2. Deprecate implicit .begin for async methods.
    
    Bug: https://bugzilla.gnome.org/show_bug.cgi?id=681420

 folks/backend-store.vala         |    8 ++++----
 folks/individual-aggregator.vala |   16 ++++++++--------
 folks/object-cache.vala          |   16 ++++++++--------
 folks/phone-details.vala         |   10 +++++-----
 folks/potential-match.vala       |   10 +++++-----
 5 files changed, 30 insertions(+), 30 deletions(-)
---
diff --git a/folks/backend-store.vala b/folks/backend-store.vala
index 965b3d3..34e6376 100644
--- a/folks/backend-store.vala
+++ b/folks/backend-store.vala
@@ -319,7 +319,7 @@ public class Folks.BackendStore : Object {
 
           bool is_file;
           bool is_dir;
-          yield this._get_file_info (file, out is_file, out is_dir);
+          yield BackendStore._get_file_info (file, out is_file, out is_dir);
           if (is_file)
             {
               modules.set (subpath, file);
@@ -441,7 +441,7 @@ public class Folks.BackendStore : Object {
       Backend? backend_existing = this._backend_hash.get (backend.name);
       if (backend_existing != null && backend_existing != backend)
         {
-          ((!) backend_existing).unprepare ();
+          ((!) backend_existing).unprepare.begin ();
           this._prepared_backends.unset (((!) backend_existing).name);
         }
 
@@ -456,7 +456,7 @@ public class Folks.BackendStore : Object {
       try
         {
           all_others_enabled = this._backends_key_file.get_boolean (
-              this.KEY_FILE_GROUP_ALL_OTHERS, "enabled");
+              BackendStore.KEY_FILE_GROUP_ALL_OTHERS, "enabled");
         }
       catch (KeyFileError e)
         {
@@ -492,7 +492,7 @@ public class Folks.BackendStore : Object {
                   "keyfile. %s according to '%s' setting.",
                   name,
                   all_others_enabled ? "Enabling" : "Disabling",
-                  this.KEY_FILE_GROUP_ALL_OTHERS);
+                  BackendStore.KEY_FILE_GROUP_ALL_OTHERS);
               enabled = all_others_enabled;
             }
           else if (!(e is KeyFileError.GROUP_NOT_FOUND) &&
diff --git a/folks/individual-aggregator.vala b/folks/individual-aggregator.vala
index 6a61a88..9ea288e 100644
--- a/folks/individual-aggregator.vala
+++ b/folks/individual-aggregator.vala
@@ -328,8 +328,8 @@ public class Folks.IndividualAggregator : Object
               this._configured_primary_store_id = "";
             }
 
-          var settings = new Settings (this._FOLKS_GSETTINGS_SCHEMA);
-          var val = settings.get_string (this._PRIMARY_STORE_CONFIG_KEY);
+          var settings = new Settings (IndividualAggregator._FOLKS_GSETTINGS_SCHEMA);
+          var val = settings.get_string (IndividualAggregator._PRIMARY_STORE_CONFIG_KEY);
           if (val != null && val != "")
             {
               debug ("Setting primary store IDs from GSettings.");
@@ -744,7 +744,7 @@ public class Folks.IndividualAggregator : Object
           if (this._quiescent_timeout_id == 0)
             {
               this._quiescent_timeout_id =
-                  Timeout.add_seconds (this._QUIESCENT_TIMEOUT,
+                  Timeout.add_seconds (IndividualAggregator._QUIESCENT_TIMEOUT,
                       this._quiescent_timeout_cb);
             }
         }
@@ -827,7 +827,7 @@ public class Folks.IndividualAggregator : Object
           if (this._quiescent_timeout_id == 0)
             {
               this._quiescent_timeout_id =
-                  Timeout.add_seconds (this._QUIESCENT_TIMEOUT,
+                  Timeout.add_seconds (IndividualAggregator._QUIESCENT_TIMEOUT,
                       this._quiescent_timeout_cb);
             }
         }
@@ -1852,8 +1852,8 @@ public class Folks.IndividualAggregator : Object
               _("Check the relevant service is running, or change the default store in that service or using the â%sâ GSettings key."),
               this._configured_primary_store_type_id,
               this._configured_primary_store_id,
-              "%s %s".printf (this._FOLKS_GSETTINGS_SCHEMA,
-                  this._PRIMARY_STORE_CONFIG_KEY));
+              "%s %s".printf (IndividualAggregator._FOLKS_GSETTINGS_SCHEMA,
+                  IndividualAggregator._PRIMARY_STORE_CONFIG_KEY));
         }
 
       /* Don't bother linking if it's just one Persona */
@@ -2186,8 +2186,8 @@ public class Folks.IndividualAggregator : Object
               _("Check the relevant service is running, or change the default store in that service or using the â%sâ GSettings key."),
               this._configured_primary_store_type_id,
               this._configured_primary_store_id,
-              "%s %s".printf (this._FOLKS_GSETTINGS_SCHEMA,
-                  this._PRIMARY_STORE_CONFIG_KEY));
+              "%s %s".printf (IndividualAggregator._FOLKS_GSETTINGS_SCHEMA,
+                  IndividualAggregator._PRIMARY_STORE_CONFIG_KEY));
         }
       else if (new_persona == null)
         {
diff --git a/folks/object-cache.vala b/folks/object-cache.vala
index 52f518f..77c7309 100644
--- a/folks/object-cache.vala
+++ b/folks/object-cache.vala
@@ -217,7 +217,7 @@ public abstract class Folks.ObjectCache<T> : Object
         }
 
       // Check the length
-      if (data.length < this._HEADER_WIDTH)
+      if (data.length < ObjectCache._HEADER_WIDTH)
         {
           warning ("Cache file '%s' was too small. The file was deleted.",
               this._cache_file_path);
@@ -230,18 +230,18 @@ public abstract class Folks.ObjectCache<T> : Object
       var wrapper_version = data[0];
       var object_version = data[1];
 
-      if (wrapper_version != this._FILE_FORMAT_VERSION)
+      if (wrapper_version != ObjectCache._FILE_FORMAT_VERSION)
         {
           warning ("Cache file '%s' was version %u of the file format, " +
               "but only version %u is supported. The file was deleted.",
               this._cache_file_path, wrapper_version,
-              this._FILE_FORMAT_VERSION);
+              ObjectCache._FILE_FORMAT_VERSION);
           yield this.clear_cache ();
 
           return null;
         }
 
-      unowned uint8[] variant_data = data[this._HEADER_WIDTH:data.length];
+      unowned uint8[] variant_data = data[ObjectCache._HEADER_WIDTH:data.length];
 
       // Deserialise the variant according to the given version numbers
       var _variant_type =
@@ -252,7 +252,7 @@ public abstract class Folks.ObjectCache<T> : Object
           warning ("Cache file '%s' was version %u of the object file " +
               "format, which is not supported. The file was deleted.",
               this._cache_file_path, object_version,
-              this._FILE_FORMAT_VERSION);
+              ObjectCache._FILE_FORMAT_VERSION);
           yield this.clear_cache ();
 
           return null;
@@ -346,7 +346,7 @@ public abstract class Folks.ObjectCache<T> : Object
         }
 
       // File format
-      var wrapper_version = this._FILE_FORMAT_VERSION;
+      var wrapper_version = ObjectCache._FILE_FORMAT_VERSION;
       var object_version = this.get_serialised_object_version ();
 
       var variant = new Variant.tuple ({
@@ -361,10 +361,10 @@ public abstract class Folks.ObjectCache<T> : Object
           variant.get_type ().equal ((!) desired_variant_type));
 
       // Prepend the version numbers to the data
-      uint8[] data = new uint8[this._HEADER_WIDTH + variant.get_size ()];
+      uint8[] data = new uint8[ObjectCache._HEADER_WIDTH + variant.get_size ()];
       data[0] = wrapper_version;
       data[1] = object_version;
-      variant.store (data[this._HEADER_WIDTH:data.length]);
+      variant.store (data[ObjectCache._HEADER_WIDTH:data.length]);
 
       // Write the data out to the file
       while (true)
diff --git a/folks/phone-details.vala b/folks/phone-details.vala
index 5e3c652..311b085 100644
--- a/folks/phone-details.vala
+++ b/folks/phone-details.vala
@@ -96,8 +96,8 @@ public class Folks.PhoneFieldDetails : AbstractFieldDetails<string>
         return false;
       PhoneFieldDetails that_fd = (!) _that_fd;
 
-      var n1 = this._drop_extension (this.get_normalised ());
-      var n2 = this._drop_extension (that_fd.get_normalised ());
+      var n1 = PhoneFieldDetails._drop_extension (this.get_normalised ());
+      var n2 = PhoneFieldDetails._drop_extension (that_fd.get_normalised ());
 
       /* Based on http://blog.barisione.org/2010-06/handling-phone-numbers/ */
       if (n1.length >= 7 && n2.length >= 7)
@@ -150,13 +150,13 @@ public class Folks.PhoneFieldDetails : AbstractFieldDetails<string>
               /* we drop the initial + */
               continue;
             }
-          else if (digit in this._extension_chars ||
-              digit in this._valid_digits)
+          else if (digit in PhoneFieldDetails._extension_chars ||
+              digit in PhoneFieldDetails._valid_digits)
             {
               /* lets keep valid digits */
               normalised_number += digit;
             }
-          else if (digit in this._common_delimiters)
+          else if (digit in PhoneFieldDetails._common_delimiters)
             {
               continue;
             }
diff --git a/folks/potential-match.vala b/folks/potential-match.vala
index aea8423..49fe4d1 100644
--- a/folks/potential-match.vala
+++ b/folks/potential-match.vala
@@ -256,7 +256,7 @@ public class Folks.PotentialMatch : Object
 
       debug ("[name_similarity] Got %f\n", similarity);
 
-      if (similarity >= this._DIST_THRESHOLD)
+      if (similarity >= PotentialMatch._DIST_THRESHOLD)
         {
           int inc = 2;
           /* We need exact matches to go to at least HIGH, or otherwise its
@@ -322,7 +322,7 @@ public class Folks.PotentialMatch : Object
             }
 
           string[] tokens_a =
-            email_split_a[0].split_set (this._SEPARATORS);
+            email_split_a[0].split_set (PotentialMatch._SEPARATORS);
 
           foreach (var fd_b in set_b)
             {
@@ -354,7 +354,7 @@ public class Folks.PotentialMatch : Object
               else
                 {
                   string[] tokens_b =
-                    email_split_b[0].split_set (this._SEPARATORS);
+                    email_split_b[0].split_set (PotentialMatch._SEPARATORS);
 
                   /* Do we have: first.middle.last@ ~= fml@ ? */
                   if (this._check_initials_expansion (tokens_a, tokens_b))
@@ -470,7 +470,7 @@ public class Folks.PotentialMatch : Object
         }
 
       // a and b look alike if their Jaro distance is over the threshold.
-      return (jaro_dist >= this._DIST_THRESHOLD);
+      return (jaro_dist >= PotentialMatch._DIST_THRESHOLD);
     }
 
   private bool _look_alike (string? a, string? b)
@@ -487,7 +487,7 @@ public class Folks.PotentialMatch : Object
       var b_stripped = this._strip_string ((!) b);
 
       // a and b look alike if their Jaro distance is over the threshold.
-      return (this._jaro_dist (a_stripped, b_stripped) >= this._DIST_THRESHOLD);
+      return (this._jaro_dist (a_stripped, b_stripped) >= PotentialMatch._DIST_THRESHOLD);
     }
 
   /* Based on:



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