[folks] tracker: configure primary store for tests via env var



commit 859f6c7e17b4e800fb087b9e0302f8abfa0c36ee
Author: Raul Gutierrez Segales <rgs collabora co uk>
Date:   Fri Sep 16 14:59:09 2011 +0100

    tracker: configure primary store for tests via env var
    
    No need for GConf to set up primary store for tests, doing it
    via en env var is good enough.
    
    Helps: https://bugzilla.gnome.org/show_bug.cgi?id=647909

 tests/tracker/Makefile.am                      |    3 --
 tests/tracker/link-personas-via-local-ids.vala |   28 +---------------------
 tests/tracker/link-personas.vala               |   29 +----------------------
 3 files changed, 4 insertions(+), 56 deletions(-)
---
diff --git a/tests/tracker/Makefile.am b/tests/tracker/Makefile.am
index 6775840..3e87fc6 100644
--- a/tests/tracker/Makefile.am
+++ b/tests/tracker/Makefile.am
@@ -2,7 +2,6 @@ AM_CPPFLAGS = \
 	$(GLIB_CFLAGS) \
 	$(GEE_CFLAGS) \
 	$(TRACKER_SPARQL_CFLAGS) \
-	$(GCONF2_CFLAGS) \
 	-I$(top_srcdir)/folks \
 	-I$(top_srcdir)/backends/tracker/lib \
 	-I$(top_srcdir)/backends/tracker/lib/folks \
@@ -19,7 +18,6 @@ LDADD = \
 	$(GLIB_LIBS) \
 	$(GEE_LIBS) \
 	$(TRACKER_SPARQL_LIBS) \
-	$(GCONF2_LIBS) \
 	-L$(top_srcdir)/backends/tracker/lib \
 	$(NULL)
 
@@ -39,7 +37,6 @@ AM_VALAFLAGS = \
 	--pkg folks-test \
 	--pkg folks-tracker \
 	--pkg tracker-sparql-0.10 \
-	--pkg gconf-2.0 \
 	--pkg tracker-test \
 	-g \
 	$(NULL)
diff --git a/tests/tracker/link-personas-via-local-ids.vala b/tests/tracker/link-personas-via-local-ids.vala
index 14341d0..0d8a1ae 100644
--- a/tests/tracker/link-personas-via-local-ids.vala
+++ b/tests/tracker/link-personas-via-local-ids.vala
@@ -37,8 +37,6 @@ public class LinkPersonasViaLocalIDsTests : Folks.TestCase
   private string _persona_iid_2 = "";
   private HashSet<Persona> _personas;
   private int _removed_individuals = 0;
-  private string _folks_config_key = "/system/folks/backends/primary_store";
-  private unowned GConf.Client _gconf_client;
   private Gee.HashSet<string> _local_ids;
 
   public LinkPersonasViaLocalIDsTests ()
@@ -53,20 +51,7 @@ public class LinkPersonasViaLocalIDsTests : Folks.TestCase
 
   public override void set_up ()
     {
-      this._gconf_client = GConf.Client.get_default ();
-
-      /* We configure Tracker as the primary (writeable) store by
-       * setting the appropiate GConf key. */
-      try
-        {
-          GConf.Value val = new GConf.Value (GConf.ValueType.STRING);
-          val.set_string ("tracker");
-          this._gconf_client.set (this._folks_config_key, val);
-        }
-      catch (GLib.Error e)
-        {
-          warning ("Couldn't set primary store: %s\n", e.message);
-        }
+      Environment.set_variable ("FOLKS_PRIMARY_STORE", "tracker", true);
 
       /* FIXME: this set_up method takes care both of setting
        * the connection with Tracker and adding the contacts
@@ -79,16 +64,7 @@ public class LinkPersonasViaLocalIDsTests : Folks.TestCase
     {
       this._tracker_backend.tear_down ();
 
-      /* Clean-up GConf config (although we are running our own instance
-       * lets do the house-keeping anyways). */
-      try
-        {
-          this._gconf_client.unset (this._folks_config_key);
-        }
-      catch (GLib.Error e)
-        {
-          warning ("Couldn't unset primary store: %s\n", e.message);
-        }
+      Environment.unset_variable ("FOLKS_PRIMARY_STORE");
     }
 
   public void test_linking_personas_via_local_ids ()
diff --git a/tests/tracker/link-personas.vala b/tests/tracker/link-personas.vala
index 53fb71b..ac2bde9 100644
--- a/tests/tracker/link-personas.vala
+++ b/tests/tracker/link-personas.vala
@@ -39,8 +39,6 @@ public class LinkPersonasTests : Folks.TestCase
   private string _persona_iid_1 = "";
   private string _persona_iid_2 = "";
   private HashSet<Persona> _personas;
-  private string _folks_config_key = "/system/folks/backends/primary_store";
-  private unowned GConf.Client _gconf_client;
   private Gee.HashMap<string, string> _linking_props;
 
   public LinkPersonasTests ()
@@ -54,20 +52,7 @@ public class LinkPersonasTests : Folks.TestCase
 
   public override void set_up ()
     {
-      this._gconf_client = GConf.Client.get_default ();
-
-      /* We configure Tracker as the primary (writeable) store by
-       * setting the appropiate GConf key. */
-      try
-        {
-          GConf.Value val = new GConf.Value (GConf.ValueType.STRING);
-          val.set_string ("tracker");
-          this._gconf_client.set (this._folks_config_key, val);
-        }
-      catch (GLib.Error e)
-        {
-          warning ("Couldn't set primary store: %s\n", e.message);
-        }
+      Environment.set_variable ("FOLKS_PRIMARY_STORE", "tracker", true);
 
       /* FIXME: this set_up method takes care both of setting
        * the connection with Tracker and adding the contacts
@@ -79,17 +64,7 @@ public class LinkPersonasTests : Folks.TestCase
   public override void tear_down ()
     {
       this._tracker_backend.tear_down ();
-
-      /* Clean-up GConf config (although we are running our own instance
-       * lets do the house-keeping anyways). */
-      try
-        {
-          this._gconf_client.unset (this._folks_config_key);
-        }
-      catch (GLib.Error e)
-        {
-          warning ("Couldn't unset primary store: %s\n", e.message);
-        }
+      Environment.unset_variable ("FOLKS_PRIMARY_STORE");
     }
 
   public void test_linking_personas ()



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