[grilo] grl-inspect: Add configuration file



commit 53539b06cea84c4128fcadc1e213e3899a252eb6
Author: Juan A. Suarez Romero <jasuarez igalia com>
Date:   Tue Apr 19 14:53:12 2011 +0000

    grl-inspect: Add configuration file
    
    Add option "-c" to pass a file containing configuration options for sources.
    
    Signed-off-by: Juan A. Suarez Romero <jasuarez igalia com>

 tools/grilo-inspect/grl-inspect.c |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/tools/grilo-inspect/grl-inspect.c b/tools/grilo-inspect/grl-inspect.c
index 0827efc..9c3f8f1 100644
--- a/tools/grilo-inspect/grl-inspect.c
+++ b/tools/grilo-inspect/grl-inspect.c
@@ -29,6 +29,7 @@ GRL_LOG_DOMAIN_STATIC(grl_inspect_log_domain);
 static gint delay = 0;
 static GMainLoop *mainloop = NULL;
 static gchar **introspect_sources = NULL;
+static gchar *conffile = NULL;
 static GrlPluginRegistry *registry = NULL;
 
 static GOptionEntry entries[] = {
@@ -36,6 +37,10 @@ static GOptionEntry entries[] = {
     G_OPTION_ARG_INT, &delay,
     "Wait some seconds before showing results",
     NULL },
+  { "config", 'c', 0,
+    G_OPTION_ARG_STRING, &conffile,
+    "Configuration file to send to sources",
+    NULL },
   { G_OPTION_REMAINING, '\0', 0,
     G_OPTION_ARG_STRING_ARRAY, &introspect_sources,
     "Sources to introspect",
@@ -202,6 +207,14 @@ main (int argc, char *argv[])
   GRL_LOG_DOMAIN_INIT (grl_inspect_log_domain, "grl-inspect");
 
   registry = grl_plugin_registry_get_default ();
+  if (conffile) {
+    grl_plugin_registry_add_config_from_file (registry, conffile, &error);
+    if (error) {
+      GRL_WARNING ("Unable to load configuration: %s", error->message);
+      g_error_free (error);
+    }
+  }
+
   mainloop = g_main_loop_new (NULL, FALSE);
 
   grl_plugin_registry_load_all (registry, NULL);



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