summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Koegel <eric.koegel@gmail.com>2014-08-08 19:32:05 +0300
committerEric Koegel <eric.koegel@gmail.com>2014-08-08 19:33:29 +0300
commitd767980348f32ffe451999310fd3944730145b1b (patch)
tree93fe0e86650def78b0a812277cb0d2461d7dd61e
parent21075c2a80cefc286369ef3894432e6c7a41b9b2 (diff)
downloadixfce4-power-manager-d767980348f32ffe451999310fd3944730145b1b.tar.gz
Settings: Add support for debug messages
xfpm-settings has some XFPM_DEBUG messages but no way to enable them, the patch adds the same --debug flag as xfpm's daemon has.
-rw-r--r--settings/xfpm-settings-main.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/settings/xfpm-settings-main.c b/settings/xfpm-settings-main.c
index 345ca7df..9155f26e 100644
--- a/settings/xfpm-settings-main.c
+++ b/settings/xfpm-settings-main.c
@@ -43,7 +43,7 @@
#include "xfpm-settings.h"
#include "xfpm-config.h"
#include "xfpm-dbus.h"
-
+#include "xfpm-debug.h"
#include "xfpm-unique.h"
int main (int argc, char **argv)
@@ -67,7 +67,8 @@ int main (int argc, char **argv)
gboolean has_power_button;
gboolean has_lid;
gboolean start_xfpm_if_not_running;
-
+ gboolean debug = FALSE;
+
GdkNativeWindow socket_id = 0;
gchar *device_id = NULL;
@@ -78,6 +79,7 @@ int main (int argc, char **argv)
{
{ "socket-id", 's', G_OPTION_FLAG_IN_MAIN, G_OPTION_ARG_INT, &socket_id, N_("Settings manager socket"), N_("SOCKET ID") },
{ "device-id", 'd', G_OPTION_FLAG_IN_MAIN, G_OPTION_ARG_STRING, &device_id, N_("Display a specific device by UpDevice object path"), N_("UpDevice object path") },
+ { "debug", '\0', G_OPTION_FLAG_IN_MAIN, G_OPTION_ARG_NONE, &debug, N_("Enable debugging"), NULL },
{ NULL, },
};
@@ -166,6 +168,8 @@ int main (int argc, char **argv)
return EXIT_FAILURE;
}
+ xfpm_debug_init (debug);
+
has_battery = xfpm_string_to_bool (g_hash_table_lookup (config_hash, "has-battery"));
has_lid = xfpm_string_to_bool (g_hash_table_lookup (config_hash, "has-lid"));
can_suspend = xfpm_string_to_bool (g_hash_table_lookup (config_hash, "can-suspend"));