• Bug 685084 — Add a folks backend for ofono phonebook
• Bug 686056 — Add api to create and remove address books
• Bug 685250 — make <test>.gdb deadlocks
+• Bug 686674 — Tracker backend doesn't implement new Backend functions
API changes:
• Add Backend.enable_persona_store and disable_persona_store.
/**
* {@inheritDoc}
*/
+ public override void enable_persona_store (Folks.PersonaStore store)
+ {
+ if (this._persona_stores.has_key (store.id) == false)
+ {
+ this._add_store ((Trf.PersonaStore) store);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public override void disable_persona_store (Folks.PersonaStore store)
+ {
+ if (this._persona_stores.has_key (store.id))
+ {
+ this._store_removed_cb (store);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public override void set_persona_stores (Set<string>? storeids)
+ {
+ if (storeids != null)
+ {
+ if (storeids.size == 0)
+ {
+ this.disable_persona_store (this._persona_stores.get (BACKEND_NAME));
+ }
+ else
+ {
+ this._add_default_persona_store ();
+ }
+ }
+ else
+ {
+ this._add_default_persona_store ();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
public Backend ()
{
Object ();
*/
private void _add_default_persona_store ()
{
- var store = new Trf.PersonaStore ();
+ if (this._persona_stores.has_key (BACKEND_NAME) == false)
+ {
+ var store = new Trf.PersonaStore ();
+ this._add_store (store);
+ }
+ }
+
+ /**
+ * Utility function to add a persona store.
+ *
+ * @param store the store to add.
+ * @param notify whether or not to emit notification signals.
+ */
+ private void _add_store (PersonaStore store, bool notify = true)
+ {
this._persona_stores.set (store.id, store);
store.removed.connect (this._store_removed_cb);
- this.notify_property ("persona-stores");
this.persona_store_added (store);
+ if (notify)
+ {
+ this.notify_property ("persona-stores");
+ }
}
private void _store_removed_cb (Folks.PersonaStore store)
* Enable a {@link PersonaStore}.
*
* If the given persona store is not already in this backend
- * {@link Backend.persona_stores}, it will be added to the backend and
- * {@link Backend.persona_stores} property notification will be emitted,
+ * {@link Backend.persona_stores}, it will be added to the backend and
+ * {@link Backend.persona_stores} property notification will be emitted,
* along with {@link Backend.persona_store_added}.
*
* @param store the {@link PersonaStore} to enable.
* Set the {@link PersonaStore}s to use in this backend.
*
* This will cause {@link Backend.persona_store_removed} signals to be emitted
- * for all removed stores, followed by {@link Backend.persona_store_added}
+ * for all removed stores, followed by {@link Backend.persona_store_added}
* signals for all added stores. As these signals are emitted, the sets of
- * individuals in any associated {@link IndividualAggregator}s will be
- * updated, and {@link IndividualAggregator.individuals_changed} may be
- * emitted multiple times as appropriate. A property change notification for
+ * individuals in any associated {@link IndividualAggregator}s will be
+ * updated, and {@link IndividualAggregator.individuals_changed} may be
+ * emitted multiple times as appropriate. A property change notification for
* {@link Backend.persona_stores} will be emitted last.
* Note: pass null storeids to use all available persona stores.
*