[gnome-settings-daemon] common: Print enable help at the start of plugin tests



commit 823418cd9486d190d24e6cdc7c629f5a9f24a15c
Author: Bastien Nocera <hadess hadess net>
Date:   Tue Nov 13 16:51:20 2012 +0100

    common: Print enable help at the start of plugin tests

 plugins/common/test-plugin.h |   15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)
---
diff --git a/plugins/common/test-plugin.h b/plugins/common/test-plugin.h
index f0100de..b5a829e 100644
--- a/plugins/common/test-plugin.h
+++ b/plugins/common/test-plugin.h
@@ -41,6 +41,15 @@ has_settings (void)
 	return FALSE;
 }
 
+static void
+print_enable_disable_help (void)
+{
+	fprintf (stderr, "To deactivate:\n");
+	fprintf (stderr, "\tgsettings set org.gnome.settings-daemon.plugins." SCHEMA_NAME " active false\n");
+	fprintf (stderr, "To reactivate:\n");
+	fprintf (stderr, "\tgsettings set org.gnome.settings-daemon.plugins." SCHEMA_NAME " active true\n");
+}
+
 int
 main (int argc, char **argv)
 {
@@ -69,12 +78,10 @@ main (int argc, char **argv)
         settings = g_settings_new ("org.gnome.settings-daemon.plugins." SCHEMA_NAME);
         if (g_settings_get_boolean (settings, "active") != FALSE) {
 		fprintf (stderr, "Plugin '%s' is not disabled. You need to disable it before launching the test application.\n", SCHEMA_NAME);
-		fprintf (stderr, "To deactivate:\n");
-		fprintf (stderr, "\tgsettings set org.gnome.settings-daemon.plugins." SCHEMA_NAME " active false\n");
-		fprintf (stderr, "To reactivate:\n");
-		fprintf (stderr, "\tgsettings set org.gnome.settings-daemon.plugins." SCHEMA_NAME " active true\n");
+		print_enable_disable_help ();
 		exit (1);
 	}
+	print_enable_disable_help();
 
         manager = NEW ();
 



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