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



commit 410a56cd3fd1793f6c523e416f2d73c4baf2fc05
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 c91b77b..eea48b3 100644
--- a/libebackend/e-source-registry-server.c
+++ b/libebackend/e-source-registry-server.c
@@ -1253,6 +1253,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));
 
@@ -1262,7 +1269,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 add0b7c..8f10af1 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]