[folks/648811-dummy-backend-rebase1] dummy: Rename backend library namespace from Dummyf to FolksDummy
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [folks/648811-dummy-backend-rebase1] dummy: Rename backend library namespace from Dummyf to FolksDummy
- Date: Wed, 6 Nov 2013 14:14:12 +0000 (UTC)
commit dda6e8eb6a62b12b29734bc9325bb9723aaf3a74
Author: Philip Withnall <philip withnall collabora co uk>
Date: Wed Nov 6 12:47:43 2013 +0000
dummy: Rename backend library namespace from Dummyf to FolksDummy
This fixes an un-work-round-able problem with g-ir-scanner whereby
subclassing (e.g. FatPersona: Persona) within the library broke node lookup
in g-ir-scanner due to mismatching namespaces.
It’s also a much more recognisable name.
backends/dummy/dummy-backend-factory.vala | 2 +-
backends/dummy/lib/Makefile.am | 3 +-
backends/dummy/lib/dummy-backend.vala | 31 ++++++++++++++-------------
backends/dummy/lib/dummy-fat-persona.vala | 8 +++---
backends/dummy/lib/dummy-namespace.vala | 30 --------------------------
backends/dummy/lib/dummy-persona-store.vala | 30 +++++++++++++-------------
backends/dummy/lib/dummy-persona.vala | 6 ++--
tests/dummy/individual-retrieval.vala | 2 +-
tests/lib/dummy/test-case.vala | 10 ++++----
9 files changed, 46 insertions(+), 76 deletions(-)
---
diff --git a/backends/dummy/dummy-backend-factory.vala b/backends/dummy/dummy-backend-factory.vala
index e5ca567..8228ef4 100644
--- a/backends/dummy/dummy-backend-factory.vala
+++ b/backends/dummy/dummy-backend-factory.vala
@@ -34,7 +34,7 @@ using Folks;
*/
public void module_init (BackendStore backend_store)
{
- backend_store.add_backend (new Dummyf.Backend ());
+ backend_store.add_backend (new FolksDummy.Backend ());
}
/**
diff --git a/backends/dummy/lib/Makefile.am b/backends/dummy/lib/Makefile.am
index 6a416e3..11e374d 100644
--- a/backends/dummy/lib/Makefile.am
+++ b/backends/dummy/lib/Makefile.am
@@ -27,7 +27,6 @@ pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = $(pkgconfig_in:.in=)
libfolks_dummy_la_SOURCES = \
- dummy-namespace.vala \
dummy-backend.vala \
dummy-persona.vala \
dummy-persona-store.vala \
@@ -81,7 +80,7 @@ libfolks_dummy_la_LDFLAGS = \
$(AM_LDFLAGS) \
$(CODE_COVERAGE_LDFLAGS) \
-version-info "$(LT_CURRENT)":"$(LT_REVISION)":"$(LT_AGE)" \
- -export-symbols-regex "^(DUMMYF|dummyf)_.*|" \
+ -export-symbols-regex "^(FOLKS_DUMMY|folks_dummy)_.*|" \
$(NULL)
folks_dummy_includedir = $(includedir)/folks
diff --git a/backends/dummy/lib/dummy-backend.vala b/backends/dummy/lib/dummy-backend.vala
index d76463c..f4fd647 100644
--- a/backends/dummy/lib/dummy-backend.vala
+++ b/backends/dummy/lib/dummy-backend.vala
@@ -25,27 +25,28 @@ using Folks;
extern const string BACKEND_NAME;
/**
- * A backend which allows { link Dummyf.PersonaStore}s and
- * { link Dummyf.Persona}s to be programmatically created and manipulated, for
- * the purposes of testing the core of libfolks itself.
+ * A backend which allows { link FolksDummy.PersonaStore}s and
+ * { link FolksDummy.Persona}s to be programmatically created and manipulated,
+ * for the purposes of testing the core of libfolks itself.
*
* This backend is not meant to be enabled in production use. The methods on
- * { link Dummyf.Backend} (and other classes) for programmatically manipulating
- * the backend's state are considered internal to libfolks and are not stable.
+ * { link FolksDummy.Backend} (and other classes) for programmatically
+ * manipulating the backend's state are considered internal to libfolks and are
+ * not stable.
*
* This backend maintains two sets of persona stores: the set of all persona
* stores, and the set of enabled persona stores (which must be a subset of the
- * former). { link Dummyf.Backend.register_persona_stores} adds persona stores
- * to the set of all stores. Optionally it also enables them, adding them to the
- * set of enabled stores. The set of persona stores advertised by the backend as
- * { link Backend.persona_stores} is the set of enabled stores. libfolks may
- * internally enable or disable stores using
+ * former). { link FolksDummy.Backend.register_persona_stores} adds persona
+ * stores to the set of all stores. Optionally it also enables them, adding them
+ * to the set of enabled stores. The set of persona stores advertised by the
+ * backend as { link Backend.persona_stores} is the set of enabled stores.
+ * libfolks may internally enable or disable stores using
* { link Backend.enable_persona_store}, { link Backend.disable_persona_store}
* and { link Backend.set_persona_stores}.
*
* @since UNRELEASED
*/
-public class Dummyf.Backend : Folks.Backend
+public class FolksDummy.Backend : Folks.Backend
{
private bool _is_prepared = false;
private bool _prepare_pending = false; /* used for unprepare() too */
@@ -131,7 +132,7 @@ public class Dummyf.Backend : Folks.Backend
*/
public override void enable_persona_store (Folks.PersonaStore store)
{
- this._enable_persona_store ((Dummyf.PersonaStore) store);
+ this._enable_persona_store ((FolksDummy.PersonaStore) store);
}
/**
@@ -302,7 +303,7 @@ public class Dummyf.Backend : Folks.Backend
/**
- * Register and enable some { link Dummyf.PersonaStore}s.
+ * Register and enable some { link FolksDummy.PersonaStore}s.
*
* For each of the persona stores in ``stores``, register it with this
* backend. If ``enable_stores`` is ``true``, added stores will also be
@@ -316,7 +317,7 @@ public class Dummyf.Backend : Folks.Backend
* method, the duplicate will be ignored (so
* { link Backend.persona_store_added} won't be emitted for that store).
*
- * Persona stores must be instances of { link Dummyf.PersonaStore} or
+ * Persona stores must be instances of { link FolksDummy.PersonaStore} or
* subclasses of it, allowing for different persona store implementations to
* be tested.
*
@@ -348,7 +349,7 @@ public class Dummyf.Backend : Folks.Backend
}
/**
- * Disable and unregister some { link Dummyf.PersonaStores}.
+ * Disable and unregister some { link FolksDummy.PersonaStores}.
*
* For each of the persona stores in ``stores``, disable it (if it was
* enabled) and unregister it from the backend so that it cannot be re-enabled
diff --git a/backends/dummy/lib/dummy-fat-persona.vala b/backends/dummy/lib/dummy-fat-persona.vala
index 7cac9ea..a87ae1a 100644
--- a/backends/dummy/lib/dummy-fat-persona.vala
+++ b/backends/dummy/lib/dummy-fat-persona.vala
@@ -26,16 +26,16 @@ using Gee;
using GLib;
/**
- * A persona subclass which represents a single EDS contact. TODO
+ * A persona subclass which represents a single dummy contact. TODO
*
- * Each { link Dummy.Persona} instance represents a single EDS { link E.Contact}.
+ * Each { link Dummy.Persona} instance represents a single dummy { link E.Contact}.
* When the contact is modified (either by this folks client, or a different
* client), the { link Dummy.Persona} remains the same, but is assigned a new
* { link E.Contact}. It then updates its properties from this new contact.
*
* @since UNRELEASED
*/
-public class Dummyf.FatPersona : Dummyf.Persona,
+public class FolksDummy.FatPersona : FolksDummy.Persona,
AntiLinkable,
AvatarDetails,
BirthdayDetails,
@@ -57,7 +57,7 @@ public class Dummyf.FatPersona : Dummyf.Persona,
* Create a new persona.
*
* Create a new persona for the { link PersonaStore} ``store``, representing
- * the EDS contact given by ``contact``. TODO
+ * the dummy contact given by ``contact``. TODO
*
* @param store the store which will contain the persona
* @param contact_id TODO
diff --git a/backends/dummy/lib/dummy-persona-store.vala b/backends/dummy/lib/dummy-persona-store.vala
index c2e599f..0637f39 100644
--- a/backends/dummy/lib/dummy-persona-store.vala
+++ b/backends/dummy/lib/dummy-persona-store.vala
@@ -25,7 +25,7 @@ using Gee;
using GLib;
/**
- * A persona store which allows { link Dummyf.Persona}s to be programmatically
+ * A persona store which allows { link FolksDummy.Persona}s to be programmatically
* created and manipulated, for the purposes of testing the core of libfolks
* itself.
*
@@ -38,7 +38,7 @@ using GLib;
*
* @since UNRELEASED
*/
-public class Dummyf.PersonaStore : Folks.PersonaStore
+public class FolksDummy.PersonaStore : Folks.PersonaStore
{
private bool _is_prepared = false;
private bool _prepare_pending = false;
@@ -202,8 +202,8 @@ public class Dummyf.PersonaStore : Folks.PersonaStore
* Create a new persona store.
*
* This store will have no personas to begin with; use
- * { link Dummyf.PersonaStore.register_personas} to add some, then call
- * { link Dummyf.PersonaStore.reach_quiescence} to signal the store reaching
+ * { link FolksDummy.PersonaStore.register_personas} to add some, then call
+ * { link FolksDummy.PersonaStore.reach_quiescence} to signal the store reaching
* quiescence.
*
* @param id The new store's ID.
@@ -231,7 +231,7 @@ public class Dummyf.PersonaStore : Folks.PersonaStore
/**
* Type of a mock function for { link PersonaStore.add_persona_from_details}.
*
- * See { link Dummyf.PersonaStore.add_persona_from_details_mock}.
+ * See { link FolksDummy.PersonaStore.add_persona_from_details_mock}.
*
* @param persona the persona being added to the store, as constructed from
* the details passed to { link PersonaStore.add_persona_from_details}.
@@ -290,7 +290,7 @@ public class Dummyf.PersonaStore : Folks.PersonaStore
* @throws Folks.PersonaStoreError.STORE_OFFLINE if the store hasn’t been
* prepared
* @throws Folks.PersonaStoreError.CREATE_FAILED if creating the persona in
- * the EDS store failed
+ * the dummy store failed
*
* @since UNRELEASED
*/
@@ -316,7 +316,7 @@ public class Dummyf.PersonaStore : Folks.PersonaStore
"iid", iid,
"store", this,
"is-user", false,
- null) as Dummyf.Persona;
+ null) as FolksDummy.Persona;
assert (persona != null);
persona.update_writeable_properties (this.always_writeable_properties);
@@ -560,7 +560,7 @@ public class Dummyf.PersonaStore : Folks.PersonaStore
/**
* Type of a mock function for { link PersonaStore.remove_persona}.
*
- * See { link Dummyf.PersonaStore.remove_persona_mock}.
+ * See { link FolksDummy.PersonaStore.remove_persona_mock}.
*
* @param persona the persona being removed from the store
* @throws PersonaStoreError to be thrown from
@@ -611,7 +611,7 @@ public class Dummyf.PersonaStore : Folks.PersonaStore
*/
public override async void remove_persona (Folks.Persona persona)
throws PersonaStoreError
- requires (persona is Dummyf.Persona)
+ requires (persona is FolksDummy.Persona)
{
/* We have to have called prepare() beforehand. */
if (!this._is_prepared)
@@ -624,7 +624,7 @@ public class Dummyf.PersonaStore : Folks.PersonaStore
* by providing a mock function which can throw errors as appropriate. */
if (this.remove_persona_mock != null)
{
- this.remove_persona_mock ((Dummyf.Persona) persona);
+ this.remove_persona_mock ((FolksDummy.Persona) persona);
}
Persona? _persona = this._personas.get (persona.iid);
@@ -649,7 +649,7 @@ public class Dummyf.PersonaStore : Folks.PersonaStore
/**
* Type of a mock function for { link PersonaStore.prepare}.
*
- * See { link Dummyf.PersonaStore.prepare_mock}.
+ * See { link FolksDummy.PersonaStore.prepare_mock}.
*
* @throws PersonaStoreError to be thrown from { link PersonaStore.prepare}
* @since UNRELEASED
@@ -741,14 +741,14 @@ public class Dummyf.PersonaStore : Folks.PersonaStore
*/
- private Type _persona_type = typeof (Dummyf.Persona);
+ private Type _persona_type = typeof (FolksDummy.Persona);
/**
* Type of programmatically created personas.
*
* This is the type used to create new personas when
* { link PersonaStore.add_persona_from_details} is called. It must be a
- * subtype of { link Dummyf.Persona}.
+ * subtype of { link FolksDummy.Persona}.
*
* This may be modified at any time, with modifications taking effect for the
* next call to { link PersonaStore.add_persona_from_details} or
@@ -761,7 +761,7 @@ public class Dummyf.PersonaStore : Folks.PersonaStore
get { return this._persona_type; }
set
{
- assert (value.is_a (typeof (Dummyf.Persona)));
+ assert (value.is_a (typeof (FolksDummy.Persona)));
if (this._persona_type != value)
{
this._persona_type = value;
@@ -909,7 +909,7 @@ public class Dummyf.PersonaStore : Folks.PersonaStore
/* Emit a notification about all the personas which were found in the
* initial query. They're queued up in _contacts_added_cb() and only
* emitted here as _contacts_added_cb() may be called many times
- * before _contacts_complete_cb() is called. For example, EDS seems to
+ * before _contacts_complete_cb() is called. For example, dummy seems to
* like emitting contacts in batches of 16 at the moment.
* Queueing the personas up and emitting a single notification is a
* lot more efficient for the individual aggregator to handle. */
diff --git a/backends/dummy/lib/dummy-persona.vala b/backends/dummy/lib/dummy-persona.vala
index 7d15288..dfe0c68 100644
--- a/backends/dummy/lib/dummy-persona.vala
+++ b/backends/dummy/lib/dummy-persona.vala
@@ -25,14 +25,14 @@ using GLib;
/**
* A persona subclass which represents a single contact. TODO
*
- * Each { link Dummy.Persona} instance represents a single EDS { link E.Contact}.
+ * Each { link Dummy.Persona} instance represents a single dummy { link E.Contact}.
* When the contact is modified (either by this folks client, or a different
* client), the { link Dummy.Persona} remains the same, but is assigned a new
* { link E.Contact}. It then updates its properties from this new contact.
*
* @since UNRELEASED
*/
-public class Dummyf.Persona : Folks.Persona
+public class FolksDummy.Persona : Folks.Persona
{
private string[] _linkable_properties = new string[0];
@@ -62,7 +62,7 @@ public class Dummyf.Persona : Folks.Persona
* Create a new persona.
*
* Create a new persona for the { link PersonaStore} ``store``, representing
- * the EDS contact given by ``contact``. TODO
+ * the dummy contact given by ``contact``. TODO
*
* @param store the store which will contain the persona
* @param contact_id TODO
diff --git a/tests/dummy/individual-retrieval.vala b/tests/dummy/individual-retrieval.vala
index 3a3c088..aa7ebba 100644
--- a/tests/dummy/individual-retrieval.vala
+++ b/tests/dummy/individual-retrieval.vala
@@ -20,7 +20,7 @@
using Gee;
using Folks;
using DummyTest;
-using Dummyf;
+using FolksDummy;
public class IndividualRetrievalTests : DummyTest.TestCase
{
diff --git a/tests/lib/dummy/test-case.vala b/tests/lib/dummy/test-case.vala
index 45e58e2..45f2a38 100644
--- a/tests/lib/dummy/test-case.vala
+++ b/tests/lib/dummy/test-case.vala
@@ -31,12 +31,12 @@ public class DummyTest.TestCase : Folks.TestCase
/**
* The dummy test backend.
*/
- public Dummyf.Backend dummy_backend;
+ public FolksDummy.Backend dummy_backend;
/**
* The default persona store
*/
- public Dummyf.PersonaStore dummy_persona_store;
+ public FolksDummy.PersonaStore dummy_persona_store;
private BackendStore backend_store;
@@ -69,7 +69,7 @@ public class DummyTest.TestCase : Folks.TestCase
});
TestUtils.loop_run_with_timeout (main_loop);
- this.dummy_backend = this.backend_store.dup_backend_by_name ("dummy") as Dummyf.Backend;
+ this.dummy_backend = this.backend_store.dup_backend_by_name ("dummy") as FolksDummy.Backend;
this.configure_primary_store ();
}
@@ -81,8 +81,8 @@ public class DummyTest.TestCase : Folks.TestCase
Folks.PersonaStore.detail_key (PersonaDetail.PHONE_NUMBERS),
null };
- this.dummy_persona_store = new Dummyf.PersonaStore ("dummy-store", "Dummy personas",
writable_properties);
- this.dummy_persona_store.persona_type = typeof (Dummyf.FatPersona);
+ this.dummy_persona_store = new FolksDummy.PersonaStore ("dummy-store", "Dummy personas",
writable_properties);
+ this.dummy_persona_store.persona_type = typeof (FolksDummy.FatPersona);
persona_stores.add (this.dummy_persona_store);
this.dummy_backend.register_persona_stores (persona_stores);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]