[folks/wip/tintou/eds-fixes] Fix build with latest EDS version




commit 15a67ae4503d402d1a5cc4949dfb4e545ba58428
Author: Corentin Noël <corentin noel collabora com>
Date:   Mon Jun 7 11:43:14 2021 +0200

    Fix build with latest EDS version
    
    The introspection at EDS side has been fixed, which leads to VAPI breaks.

 backends/eds/lib/edsf-persona-store.vala | 52 +++++++++-----------------------
 1 file changed, 14 insertions(+), 38 deletions(-)
---
diff --git a/backends/eds/lib/edsf-persona-store.vala b/backends/eds/lib/edsf-persona-store.vala
index 4cac5620..bab24bcb 100644
--- a/backends/eds/lib/edsf-persona-store.vala
+++ b/backends/eds/lib/edsf-persona-store.vala
@@ -1224,13 +1224,12 @@ public class Edsf.PersonaStore : Folks.PersonaStore
           signal_id = ((!) this._ebookview).objects_added.connect (
               (_contacts) =>
             {
-              unowned GLib.List<E.Contact> contacts =
-                  (GLib.List<E.Contact>) _contacts;
+              GLib.SList<E.Contact> contacts = _contacts;
 
               /* All handlers for objects-added have to be pushed through the
                * idle queue so they remain in order with respect to each other
                * and implement in-order modifications to this._personas. */
-              foreach (E.Contact c in contacts)
+              foreach (unowned E.Contact c in contacts)
                 {
                   this._idle_queue (() =>
                     {
@@ -2439,33 +2438,13 @@ public class Edsf.PersonaStore : Folks.PersonaStore
         }
     }
 
-  private GenericArray<E.Contact> _copy_contacts (GLib.List<E.Contact> contacts)
+  private void _contacts_added_cb (GLib.SList<E.Contact> contacts)
     {
-      var copy = new GenericArray<E.Contact> (contacts.length());
-      foreach (unowned E.Contact c in contacts)
-        {
-          copy.add (c);
-        }
-      return copy;
-    }
-
-  private GenericArray<string> _copy_contacts_ids (GLib.List<string> contacts_ids)
-    {
-      var copy = new GenericArray<string> (contacts_ids.length());
-      foreach (unowned string s in contacts_ids)
-        {
-          copy.add (s);
-        }
-      return copy;
-    }
-
-  private void _contacts_added_cb (GLib.List<E.Contact> contacts)
-    {
-      var copy = this._copy_contacts (contacts);
+      GLib.SList<E.Contact> copy = contacts;
       this._idle_queue (() => { return this._contacts_added_idle (copy); });
     }
 
-  private bool _contacts_added_idle (GenericArray<E.Contact> contacts)
+  private bool _contacts_added_idle (GLib.SList<E.Contact> contacts)
     {
       HashSet<Persona> added_personas, removed_personas;
 
@@ -2489,9 +2468,8 @@ public class Edsf.PersonaStore : Folks.PersonaStore
 
       removed_personas = new HashSet<Persona> ();
 
-      for (uint i = 0; i < contacts.length; i++)
+      for (unowned E.Contact c in contacts)
         {
-          unowned E.Contact c = contacts[i];
           string? _iid = Edsf.Persona.build_iid_from_contact (this.id, c);
 
           if (_iid == null)
@@ -2533,17 +2511,16 @@ public class Edsf.PersonaStore : Folks.PersonaStore
       return false;
     }
 
-  private void _contacts_changed_cb (GLib.List<E.Contact> contacts)
+  private void _contacts_changed_cb (GLib.SList<E.Contact> contacts)
     {
-      var copy = this._copy_contacts (contacts);
+      GLib.SList<E.Contact> copy = contacts;
       this._idle_queue (() => { return this._contacts_changed_idle (copy); });
     }
 
-  private bool _contacts_changed_idle (GenericArray<E.Contact> contacts)
+  private bool _contacts_changed_idle (GLib.SList<E.Contact> contacts)
     {
-      for (uint i = 0; i < contacts.length; i++)
+      for (unowned E.Contact c in contacts)
         {
-          unowned E.Contact c = contacts[i];
           string? _iid = Edsf.Persona.build_iid_from_contact (this.id, c);
 
           if (_iid == null)
@@ -2562,19 +2539,18 @@ public class Edsf.PersonaStore : Folks.PersonaStore
       return false;
     }
 
-  private void _contacts_removed_cb (GLib.List<string> contacts_ids)
+  private void _contacts_removed_cb (GLib.SList<string> contacts_ids)
     {
-      var copy = this._copy_contacts_ids (contacts_ids);
+      GLib.SList<string> copy = contacts_ids;
       this._idle_queue (() => { return this._contacts_removed_idle (copy); });
     }
 
-  private bool _contacts_removed_idle (GenericArray<string> contacts_ids)
+  private bool _contacts_removed_idle (GLib.SList<string> contacts_ids)
     {
       var removed_personas = new HashSet<Persona> ();
 
-      for (uint i = 0; i < contacts_ids.length; i++)
+      for (unowned string contact_id in contacts_ids)
         {
-          unowned string contact_id = contacts_ids[i];
           /* Not sure how this could happen, but better to be safe. We do not
            * allow empty UIDs. */
           if (contact_id == "")


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