Commit c30b0224 authored by Niels De Graef's avatar Niels De Graef

Get rid of all remaining trailing whitespace

We're going to start checking for (accidental) trailing whitespace in
our CI, which is a lot easier if there are no occurrences of that in the
first place.
parent 6b219d33
......@@ -83,27 +83,27 @@ public class Folks.Backends.Eds.Backend : Folks.Backend
this._add_persona_store (store);
}
}
private void _add_persona_store (PersonaStore store, bool notify = true)
{
store.removed.connect (this._store_removed_cb);
this._persona_stores.set (store.id, store);
this.persona_store_added (store);
if (notify)
{
this.notify_property ("persona-stores");
}
}
/**
* {@inheritDoc}
*/
public override void set_persona_stores (Set<string>? storeids)
{
this._storeids = storeids;
/* If the set is empty, load all unloaded stores then return. */
if (storeids == null)
{
......@@ -118,17 +118,17 @@ public class Folks.Backends.Eds.Backend : Folks.Backend
if (this._persona_stores.has_key (id) == false)
{
E.Source? s = this._ab_sources.ref_source (id);
if (s == null)
{
warning ("Unable to reference EDS source with ID %s", id);
continue;
}
var store =
var store =
new Edsf.PersonaStore.with_source_registry (this._ab_sources, s);
this._add_persona_store (store, false);
stores_changed = true;
}
}
......@@ -151,7 +151,7 @@ public class Folks.Backends.Eds.Backend : Folks.Backend
this.notify_property ("persona-stores");
}
}
/**
* {@inheritDoc}
*/
......@@ -305,7 +305,7 @@ public class Folks.Backends.Eds.Backend : Folks.Backend
{
continue;
}
if (this._storeids != null &&
!(uid in this._storeids))
{
......
......@@ -87,7 +87,7 @@ public class Folks.Backends.Kf.Backend : Folks.Backend
this._add_store ((Kf.PersonaStore) store);
}
}
/**
* {@inheritDoc}
*/
......@@ -107,33 +107,33 @@ public class Folks.Backends.Kf.Backend : Folks.Backend
file = file.get_child (filename);
return file;
}
/**
* {@inheritDoc}
* In this implementation storeids are assumed to be base filenames for
* ini files under user_data_dir()/folks/ like the default relationships
* ini files under user_data_dir()/folks/ like the default relationships
* {@link PersonaStore}.
*/
public override void set_persona_stores (Set<string>? storeids)
{
/* All ids represent ini files in user_data_dir/folks/ */
bool added_stores = false;
PersonaStore[] removed_stores = {};
/* First handle adding any missing persona stores. */
foreach (string id in storeids)
{
if (this._persona_stores.has_key (id) == false)
{
File file = this._get_default_file (id);
PersonaStore store = new Kf.PersonaStore (file);
this._add_store (store, false);
added_stores = true;
}
}
foreach (PersonaStore store in this._persona_stores.values)
{
if (!storeids.contains (store.id))
......@@ -141,19 +141,19 @@ public class Folks.Backends.Kf.Backend : Folks.Backend
removed_stores += store;
}
}
for (int i = 0; i < removed_stores.length; ++i)
{
this._remove_store ((Kf.PersonaStore) removed_stores[i], false);
}
/* Finally, if anything changed, emit the persona-stores notification. */
if (added_stores || removed_stores.length > 0)
{
this.notify_property ("persona-stores");
}
}
/**
* {@inheritDoc}
*/
......@@ -206,7 +206,7 @@ public class Folks.Backends.Kf.Backend : Folks.Backend
/* Create the PersonaStore for the key file */
PersonaStore store = new Kf.PersonaStore (file);
this._add_store (store);
this._is_prepared = true;
......@@ -240,7 +240,7 @@ public class Folks.Backends.Kf.Backend : Folks.Backend
this.notify_property ("persona-stores");
}
}
/**
* Utility function to remove a persona store.
*
......@@ -258,7 +258,7 @@ public class Folks.Backends.Kf.Backend : Folks.Backend
this.notify_property ("persona-stores");
}
}
/**
* {@inheritDoc}
*/
......
......@@ -241,7 +241,7 @@ public class Folks.Backends.Kf.PersonaStore : Folks.PersonaStore
/* Ensure the parent directory tree exists for the new file */
File parent_dir = this.file.get_parent ();
try
{
/* Recursively create the directory */
......
......@@ -87,7 +87,7 @@ public class Folks.Backends.Ofono.Backend : Folks.Backend
this._store_removed_cb (store);
}
}
/**
* {@inheritDoc}
*/
......@@ -98,7 +98,7 @@ public class Folks.Backends.Ofono.Backend : Folks.Backend
this._add_store ((Ofono.PersonaStore) store);
}
}
/**
* {@inheritDoc}
*/
......@@ -106,11 +106,11 @@ public class Folks.Backends.Ofono.Backend : Folks.Backend
{
bool added_stores = false;
PersonaStore[] removed_stores = {};
/* First handle adding any missing persona stores. */
foreach (ModemProperties modem in this._modems)
{
if (modem.path in storeids &&
if (modem.path in storeids &&
this._persona_stores.has_key (modem.path) == false)
{
string alias = this._modem_alias (modem.properties);
......@@ -119,7 +119,7 @@ public class Folks.Backends.Ofono.Backend : Folks.Backend
added_stores = true;
}
}
foreach (PersonaStore store in this._persona_stores.values)
{
if (!storeids.contains (store.id))
......@@ -127,19 +127,19 @@ public class Folks.Backends.Ofono.Backend : Folks.Backend
removed_stores += store;
}
}
for (int i = 0; i < removed_stores.length; ++i)
{
this._remove_store ((Ofono.PersonaStore) removed_stores[i], false);
}
/* Finally, if anything changed, emit the persona-stores notification. */
if (added_stores || removed_stores.length > 0)
{
this.notify_property ("persona-stores");
}
}
/**
* {@inheritDoc}
*/
......@@ -261,7 +261,7 @@ public class Folks.Backends.Ofono.Backend : Folks.Backend
private string _modem_alias (HashTable<string, Variant> properties)
{
string alias = "";
/* Name is more user friendly than Manufacturer, but both are optional,
* so use Name if it's there, otherwise Manufacturer, otherwise leave
* it blank. */
......@@ -277,7 +277,7 @@ public class Folks.Backends.Ofono.Backend : Folks.Backend
}
return alias;
}
private void _modem_added (ObjectPath path, HashTable<string, Variant> properties)
{
bool has_sim = false;
......@@ -343,7 +343,7 @@ public class Folks.Backends.Ofono.Backend : Folks.Backend
this.notify_property ("persona-stores");
}
}
/**
* Utility function to remove a persona store.
*
......@@ -355,13 +355,13 @@ public class Folks.Backends.Ofono.Backend : Folks.Backend
store.removed.disconnect (this._store_removed_cb);
this._persona_stores.unset (store.id);
this.persona_store_removed (store);
if (notify)
{
this.notify_property ("persona-stores");
}
}
private void _modem_removed (ObjectPath path)
{
......@@ -370,7 +370,7 @@ public class Folks.Backends.Ofono.Backend : Folks.Backend
this._store_removed_cb (this._persona_stores.get (path));
}
}
private void _store_removed_cb (Folks.PersonaStore store)
{
this._remove_store ((Ofono.PersonaStore) store);
......
......@@ -28,7 +28,7 @@ using Folks;
using Folks.Backends.Ofono;
/**
* A persona store which is associated with a single Ofono device. It will
* A persona store which is associated with a single Ofono device. It will
* create a {@link Persona} for each contact on the SIM card phonebook.
*
* @since 0.9.0
......@@ -144,22 +144,22 @@ public class Folks.Backends.Ofono.PersonaStore : Folks.PersonaStore
this._remove_self ();
}
}
private void _remove_self ()
{
/* Marshal the personas from a Collection to a Set. */
var removed_personas = new HashSet<Persona> ();
var iter = this._personas.map_iterator ();
while (iter.next () == true)
{
removed_personas.add (iter.get_value ());
}
this._emit_personas_changed (null, removed_personas);
this.removed ();
}
private string[] _split_all_vcards (string all_vcards)
{
/* Ofono vcards are in vcard 3.0 format and can include the following:
......
......@@ -43,7 +43,7 @@ public class Folks.Backends.Ofono.Persona : Folks.Persona,
private Set<PhoneFieldDetails> _phone_numbers_ro;
private SmallSet<EmailFieldDetails> _email_addresses;
private Set<EmailFieldDetails> _email_addresses_ro;
private const string[] _linkable_properties =
{
"phone-numbers",
......@@ -147,7 +147,7 @@ public class Folks.Backends.Ofono.Persona : Folks.Persona,
{
debug ("Adding Ofono Persona '%s' (IID '%s', group '%s')", this.uid,
this.iid, this.display_id);
this._phone_numbers = new SmallSet<PhoneFieldDetails> ();
this._phone_numbers_ro = this._phone_numbers.read_only_view;
......@@ -158,7 +158,7 @@ public class Folks.Backends.Ofono.Persona : Folks.Persona,
private void _set_vcard (string vcard)
{
E.VCard card = new E.VCard.from_string (vcard);
E.VCardAttribute? attribute = card.get_attribute ("TEL");
if (attribute != null)
{
......@@ -170,13 +170,13 @@ public class Folks.Backends.Ofono.Persona : Folks.Persona,
{
this._full_name = attribute.get_value_decoded ().str;
}
attribute = card.get_attribute ("NICKNAME");
if (attribute != null)
{
this._nickname = attribute.get_value_decoded ().str;
}
attribute = card.get_attribute ("N");
if (attribute != null)
{
......@@ -194,14 +194,14 @@ public class Folks.Backends.Ofono.Persona : Folks.Persona,
warning ("Expected 5 components to N value of vcard, got %u", values.length ());
}
}
attribute = card.get_attribute ("EMAIL");
if (attribute != null)
{
this._email_addresses.add (new EmailFieldDetails (attribute.get_value_decoded ().str) );
}
}
/**
* {@inheritDoc}
*/
......
......@@ -29,13 +29,13 @@ namespace org
ObjectPath path;
HashTable<string, Variant> properties;
}
[DBus (name = "org.ofono.Manager")]
public interface Manager : Object
{
[DBus (name = "GetModems")]
public abstract ModemProperties[] GetModems() throws DBusError, IOError;
public signal void ModemAdded (ObjectPath path, HashTable<string, Variant> properties);
public signal void ModemRemoved (ObjectPath path);
}
......@@ -46,13 +46,13 @@ namespace org
[DBus (name = "Import")]
public abstract string Import() throws DBusError, IOError;
}
[DBus (name = "org.ofono.SimManager")]
public interface SimManager : Object
{
[DBus (name = "GetProperties")]
public abstract HashTable<string, Variant> GetProperties() throws DBusError, IOError;
public signal void PropertyChanged (string property, Variant value);
}
}
......
......@@ -61,7 +61,7 @@ public class Folks.Backends.Tp.Backend : Folks.Backend
this._add_store (store);
}
}
/**
* {@inheritDoc}
*/
......@@ -72,14 +72,14 @@ public class Folks.Backends.Tp.Backend : Folks.Backend
this._remove_store (store);
}
}
/**
* {@inheritDoc}
*/
public override void set_persona_stores (Set<string>? storeids)
{
this._storeids = storeids;
bool added_stores = false;
PersonaStore[] removed_stores = {};
......@@ -96,7 +96,7 @@ public class Folks.Backends.Tp.Backend : Folks.Backend
added_stores = true;
}
}
foreach (PersonaStore store in this.persona_stores.values)
{
if (!storeids.contains (store.id))
......@@ -104,19 +104,19 @@ public class Folks.Backends.Tp.Backend : Folks.Backend
removed_stores += store;
}
}
foreach (PersonaStore store in removed_stores)
{
this._remove_store ((Tpf.PersonaStore) store, false);
}
/* Finally, if anything changed, emit the persona-stores notification. */
if (added_stores || removed_stores.length > 0)
{
this.notify_property ("persona-stores");
}
}
/**
* {@inheritDoc}
......@@ -248,7 +248,7 @@ public class Folks.Backends.Tp.Backend : Folks.Backend
{
return;
}
var store = Tpf.PersonaStore.dup_for_account (account);
this._add_store (store);
}
......@@ -263,18 +263,18 @@ public class Folks.Backends.Tp.Backend : Folks.Backend
this.notify_property ("persona-stores");
}
}
private void _remove_store (PersonaStore store, bool notify = true)
{
store.removed.disconnect (this._store_removed_cb);
this.persona_store_removed (store);
if (notify)
{
this.notify_property ("persona-stores");
}
}
private void _store_removed_cb (PersonaStore store)
{
this._remove_store (store);
......
......@@ -1877,7 +1877,7 @@ public class Trf.PersonaStore : Folks.PersonaStore
{
throw new PersonaStoreError.CREATE_FAILED("Cannot insert persona before store is prepared");
}
try
{
debug ("_insert_persona: %s", query);
......
......@@ -141,7 +141,7 @@ public interface Folks.AntiLinkable : Folks.Persona
* The UIDs of all personas in ``other_personas`` will be removed from this
* persona's anti-links set and the changes propagated to backends.
*
* If the global anti-link is set, this will not have any effect until the
* If the global anti-link is set, this will not have any effect until the
* global anti-link is removed.
*
* This method is safe to call multiple times concurrently (e.g. begin one
......
......@@ -433,7 +433,7 @@ public class Folks.IndividualAggregator : Object
/**
* Create a new IndividualAggregator with a custom {@link BackendStore}.
*
* This behaves the same as the default constructor for
* This behaves the same as the default constructor for
* {@link IndividualAggregator}, but uses the given {@link BackendStore}
* rather than the default one.
*
......@@ -447,7 +447,7 @@ public class Folks.IndividualAggregator : Object
{
Object (backend_store: store);
}
construct
{
this._stores = new HashMap<string, PersonaStore> ();
......
......@@ -219,7 +219,7 @@ public class Folks.RoleFieldDetails : AbstractFieldDetails<Role>
/**
* {@inheritDoc}
*
* @since 0.6.0
* @since 0.6.0
*/
public override bool equal (AbstractFieldDetails<Role> that)
{
......
......@@ -83,7 +83,7 @@ public class CreateRemoveStoresTests : EdsTest.TestCase
try
{
yield this._backend_store.load_backends ();
var backend = this._backend_store.enabled_backends.get ("eds");
assert (backend != null);
......@@ -91,7 +91,7 @@ public class CreateRemoveStoresTests : EdsTest.TestCase
assert (this._aggregator.is_prepared);
backend.persona_store_removed.connect (this._store_removed_cb);
backend.persona_store_added.connect (this._store_added_cb);
var pstore = "test1";
this._store_removed[pstore] = false;
this._store_added[pstore] = false;
......@@ -102,7 +102,7 @@ public class CreateRemoveStoresTests : EdsTest.TestCase
pstore = "test2";
this._store_removed[pstore] = false;
this._store_added[pstore] = false;
debug ("Creating addressbook test2");
yield Edsf.PersonaStore.create_address_book (pstore);
}
......@@ -118,9 +118,9 @@ public class CreateRemoveStoresTests : EdsTest.TestCase
assert (store != null);
debug ("store removed %s", store.id);
this._store_removed[store.id] = true;
int removed_count = 0;
foreach (bool removed in this._store_removed.values)
{
if (removed)
......@@ -128,7 +128,7 @@ public class CreateRemoveStoresTests : EdsTest.TestCase
++removed_count;
}
}
debug ("removed_count is %d, expected size is %d\n", removed_count,
this._store_removed.size);
if (removed_count == this._store_removed.size)
......@@ -141,10 +141,10 @@ public class CreateRemoveStoresTests : EdsTest.TestCase
{
debug ("store added %s", store.id);
this._store_added[store.id] = true;
var backend = this._backend_store.enabled_backends.get ("eds");
assert (backend != null);
debug ("removing store %s", store.id);
Edsf.PersonaStore.remove_address_book.begin ((Edsf.PersonaStore)store);
}
......
......@@ -89,7 +89,7 @@ public class EnableDisableStoresTests : EdsTest.TestCase
try
{
yield this._backend_store.load_backends ();
var backend = this._backend_store.enabled_backends.get ("eds");
assert (backend != null);
......@@ -134,10 +134,10 @@ public class EnableDisableStoresTests : EdsTest.TestCase
assert (store != null);
debug ("store removed %s", store.id);
this._n_stores_removed++;
var backend = this._backend_store.enabled_backends.get ("eds");
assert (backend != null);