[folks/wip/tintou/eds-fixes] Fix build with latest EDS version
- From: Corentin Noël <corentinnoel src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [folks/wip/tintou/eds-fixes] Fix build with latest EDS version
- Date: Mon, 7 Jun 2021 10:02:37 +0000 (UTC)
commit 7aac975829e303c4b68083aa34efdac6aed4143f
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..83ccb7cf 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.copy_deep ((GLib.CopyFunc<E.Contact>)
GLib.Object.ref);
/* 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.copy_deep ((GLib.CopyFunc<E.Contact>) GLib.Object.ref);
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++)
+ foreach (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.copy_deep ((GLib.CopyFunc<E.Contact>) GLib.Object.ref);
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++)
+ foreach (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.copy_deep ((GLib.CopyFunc<string>) string.dup);
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++)
+ foreach (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]