[evolution-data-server] Add --factory parameter to factory subprocesses for easier debugging



commit 9a870829f89be24ce94571715d8001a4956d1fd5
Author: Milan Crha <mcrha redhat com>
Date:   Thu Jun 4 22:24:50 2015 +0200

    Add --factory parameter to factory subprocesses for easier debugging
    
    The argument is not used in the code, it only makes easier debugging,
    to recognize for which factory the subprocess is run.

 .../evolution-addressbook-factory-subprocess.c     |    2 ++
 .../evolution-calendar-factory-subprocess.c        |    2 ++
 libebackend/e-data-factory.c                       |    7 ++++++-
 3 files changed, 10 insertions(+), 1 deletions(-)
---
diff --git a/addressbook/libedata-book/evolution-addressbook-factory-subprocess.c 
b/addressbook/libedata-book/evolution-addressbook-factory-subprocess.c
index 388d524..53daeb5 100644
--- a/addressbook/libedata-book/evolution-addressbook-factory-subprocess.c
+++ b/addressbook/libedata-book/evolution-addressbook-factory-subprocess.c
@@ -40,10 +40,12 @@ struct _SubprocessData {
        ESubprocessBookFactory *subprocess_book_factory;
 };
 
+static const gchar *factory_name = NULL;
 static const gchar *bus_name = NULL;
 static const gchar *path = NULL;
 
 static GOptionEntry entries[] = {
+       { "factory", 'f', 0, G_OPTION_ARG_STRING, &factory_name, "Just for easier debugging", NULL },
        { "bus-name", 'b', 0, G_OPTION_ARG_STRING, &bus_name, NULL, NULL },
        { "own-path", 'p', 0, G_OPTION_ARG_STRING, &path, NULL, NULL },
        { NULL }
diff --git a/calendar/libedata-cal/evolution-calendar-factory-subprocess.c 
b/calendar/libedata-cal/evolution-calendar-factory-subprocess.c
index 8485084..e996a45 100644
--- a/calendar/libedata-cal/evolution-calendar-factory-subprocess.c
+++ b/calendar/libedata-cal/evolution-calendar-factory-subprocess.c
@@ -37,10 +37,12 @@ struct _SubprocessData {
        ESubprocessCalFactory *subprocess_cal_factory;
 };
 
+static const gchar *factory_name = NULL;
 static const gchar *bus_name = NULL;
 static const gchar *path = NULL;
 
 static GOptionEntry entries[] = {
+       { "factory", 'f', 0, G_OPTION_ARG_STRING, &factory_name, "Just for easier debugging", NULL },
        { "bus-name", 'b', 0, G_OPTION_ARG_STRING, &bus_name, NULL, NULL },
        { "own-path", 'p', 0, G_OPTION_ARG_STRING, &path, NULL, NULL },
        { NULL }
diff --git a/libebackend/e-data-factory.c b/libebackend/e-data-factory.c
index 2589c96..72b5f0b 100644
--- a/libebackend/e-data-factory.c
+++ b/libebackend/e-data-factory.c
@@ -146,17 +146,20 @@ typedef struct _DataFactorySubprocessHelper DataFactorySubprocessHelper;
 
 struct _DataFactorySubprocessHelper {
        EDBusSubprocessBackend *proxy;
+       gchar *factory_name;
        gchar *bus_name;
 };
 
 static DataFactorySubprocessHelper *
 data_factory_subprocess_helper_new (EDBusSubprocessBackend *proxy,
+                                   const gchar *factory_name,
                                    const gchar *bus_name)
 {
        DataFactorySubprocessHelper *helper;
 
        helper = g_new0 (DataFactorySubprocessHelper, 1);
        helper->proxy = g_object_ref (proxy);
+       helper->factory_name = g_strdup (factory_name);
        helper->bus_name = g_strdup (bus_name);
 
        return helper;
@@ -167,6 +170,7 @@ data_factory_subprocess_helper_free (DataFactorySubprocessHelper *helper)
 {
        if (helper != NULL) {
                g_clear_object (&helper->proxy);
+               g_free (helper->factory_name);
                g_free (helper->bus_name);
 
                g_free (helper);
@@ -608,7 +612,7 @@ data_factory_subprocess_appeared_cb (GDBusConnection *connection,
                sd->extension_name,
                sd->module_filename);
 
-       helper = data_factory_subprocess_helper_new (proxy, sd->bus_name);
+       helper = data_factory_subprocess_helper_new (proxy, sd->factory_name, sd->bus_name);
 
        priv = sd->data_factory->priv;
        g_mutex_lock (&priv->mutex);
@@ -1223,6 +1227,7 @@ data_factory_spawn_subprocess_backend (EDataFactory *data_factory,
                        G_SUBPROCESS_FLAGS_NONE,
                        &error,
                        subprocess_path,
+                       "--factory", sd->factory_name,
                        "--bus-name", sd->bus_name,
                        "--own-path", sd->path,
                        NULL);


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