diff options
author | Richard Hughes <richard@hughsie.com> | 2013-07-02 17:27:50 +0100 |
---|---|---|
committer | Richard Hughes <richard@hughsie.com> | 2013-07-02 17:27:50 +0100 |
commit | c0094365b378e56717f4d53081ab253b4d869d39 (patch) | |
tree | af5bfb5526b54c2712ed5c3316283f842e24647c | |
parent | 2bab0507a34de1e8d6750cb211a91386523d5023 (diff) | |
download | colord-c0094365b378e56717f4d53081ab253b4d869d39.tar.gz |
Move the dummy sensor creation to a command line argument
-rw-r--r-- | etc/colord.conf.in | 5 | ||||
-rw-r--r-- | src/cd-main.c | 9 |
2 files changed, 7 insertions, 7 deletions
diff --git a/etc/colord.conf.in b/etc/colord.conf.in index eb91a11..20c8ba5 100644 --- a/etc/colord.conf.in +++ b/etc/colord.conf.in @@ -5,11 +5,6 @@ # default=@enablevolumesearch@ SearchVolumes=@enablevolumesearch@ -# If we should create a dummy sensor for testing -# -# default=false -CreateDummySensor=false - # If we should use SANE to add scanner and camera devices. # # If SANE support is installed then this will allow colord to manage diff --git a/src/cd-main.c b/src/cd-main.c index c960242..ae7fe7c 100644 --- a/src/cd-main.c +++ b/src/cd-main.c @@ -65,6 +65,7 @@ typedef struct { GHashTable *standard_spaces; GPtrArray *plugins; GMainLoop *loop; + gboolean create_dummy_sensor; } CdMainPrivate; /** @@ -2031,8 +2032,7 @@ cd_main_on_name_acquired_cb (GDBusConnection *connection, cd_main_plugin_phase (priv, CD_PLUGIN_PHASE_COLDPLUG); /* add dummy sensor */ - ret = cd_config_get_boolean (priv->config, "CreateDummySensor"); - if (ret) { + if (priv->create_dummy_sensor) { sensor = cd_sensor_new (); cd_sensor_set_kind (sensor, CD_SENSOR_KIND_DUMMY); ret = cd_sensor_load (sensor, &error); @@ -2342,6 +2342,7 @@ main (int argc, char *argv[]) { CdMainPrivate *priv; gboolean immediate_exit = FALSE; + gboolean create_dummy_sensor = FALSE; gboolean ret; gboolean timed_exit = FALSE; GError *error = NULL; @@ -2355,6 +2356,9 @@ main (int argc, char *argv[]) { "immediate-exit", '\0', 0, G_OPTION_ARG_NONE, &immediate_exit, /* TRANSLATORS: exit straight away, used for automatic profiling */ _("Exit after the engine has loaded"), NULL }, + { "create-dummy-sensor", '\0', 0, G_OPTION_ARG_NONE, &create_dummy_sensor, + /* TRANSLATORS: exit straight away, used for automatic profiling */ + _("Create a dummy sensor for testing"), NULL }, { NULL} }; @@ -2366,6 +2370,7 @@ main (int argc, char *argv[]) textdomain (GETTEXT_PACKAGE); priv = g_new0 (CdMainPrivate, 1); + priv->create_dummy_sensor = create_dummy_sensor; /* TRANSLATORS: program name */ g_set_application_name (_("Color Management")); |