[evolution-data-server/openismus-work] Make the ESourceRegistryServer modules relocatable like addressbook & calendar



commit 4cb560a0d5a279647a3b425e4296bc34b6709cce
Author: Tristan Van Berkom <tristanvb openismus com>
Date:   Mon Feb 25 19:26:45 2013 +0900

    Make the ESourceRegistryServer modules relocatable like addressbook & calendar
    
    This simply adds an environment variable allowing us to load registry modules
    from a relocated location in the case we run 'make check' without installing
    (also ensuring that we test the not-yet-installed environment properly).

 libebackend/e-source-registry-server.c |    9 ++++++++-
 libebackend/e-source-registry-server.h |    8 ++++++++
 2 files changed, 16 insertions(+), 1 deletions(-)
---
diff --git a/libebackend/e-source-registry-server.c b/libebackend/e-source-registry-server.c
index 91ecbf7..8ef0799 100644
--- a/libebackend/e-source-registry-server.c
+++ b/libebackend/e-source-registry-server.c
@@ -1219,6 +1219,13 @@ e_source_registry_server_class_init (ESourceRegistryServerClass *class)
        EDBusServerClass *dbus_server_class;
        EDataFactoryClass *data_factory_class;
        GType backend_factory_type;
+       const gchar *modules_directory = MODULE_DIRECTORY;
+       const gchar *modules_directory_env;
+
+       modules_directory_env = g_getenv (EDS_REGISTRY_MODULES);
+       if (modules_directory_env &&
+           g_file_test (modules_directory_env, G_FILE_TEST_IS_DIR))
+               modules_directory = g_strdup (modules_directory_env);
 
        g_type_class_add_private (class, sizeof (ESourceRegistryServerPrivate));
 
@@ -1228,7 +1235,7 @@ e_source_registry_server_class_init (ESourceRegistryServerClass *class)
 
        dbus_server_class = E_DBUS_SERVER_CLASS (class);
        dbus_server_class->bus_name = SOURCES_DBUS_SERVICE_NAME;
-       dbus_server_class->module_directory = MODULE_DIRECTORY;
+       dbus_server_class->module_directory = modules_directory;
        dbus_server_class->bus_acquired = source_registry_server_bus_acquired;
        dbus_server_class->quit_server = source_registry_server_quit_server;
 
diff --git a/libebackend/e-source-registry-server.h b/libebackend/e-source-registry-server.h
index e4007cb..2f019e9 100644
--- a/libebackend/e-source-registry-server.h
+++ b/libebackend/e-source-registry-server.h
@@ -60,6 +60,14 @@
 #define E_SOURCE_REGISTRY_SERVER_OBJECT_PATH \
        "/org/gnome/evolution/dataserver/SourceManager"
 
+/**
+ * EDS_REGISTRY_MODULES:
+ *
+ * This environment variable configures where the registry
+ * server loads it's backend modules from.
+ */
+#define EDS_REGISTRY_MODULES    "EDS_REGISTRY_MODULES"
+
 G_BEGIN_DECLS
 
 typedef struct _ESourceRegistryServer ESourceRegistryServer;


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