summaryrefslogtreecommitdiffstats
path: root/src/main.c
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@nokia.com>2008-12-22 15:08:36 +0200
committerJohan Hedberg <johan.hedberg@nokia.com>2008-12-22 15:08:36 +0200
commit26b23c817fbc00e6d4af1bcd7f1ef2db2819d9ff (patch)
tree01135151fe78a4bb5548842b7550fe1dfd72e0e4 /src/main.c
parentf463bec3023ba2b9eb44f2f72f21fdb66a06c826 (diff)
Implement RememberPowered config option
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c
index 2af5606d..ce8493c3 100644
--- a/src/main.c
+++ b/src/main.c
@@ -175,6 +175,14 @@ static void parse_config(GKeyFile *config)
} else if (boolean == FALSE)
main_opts.mode = MODE_OFF;
+ boolean = g_key_file_get_boolean(config, "General",
+ "RememberPowered", &err);
+ if (err) {
+ debug("%s", err->message);
+ g_clear_error(&err);
+ } else if (boolean == FALSE)
+ main_opts.remember_powered = boolean;
+
str = g_key_file_get_string(config, "General", "DeviceID", &err);
if (err) {
debug("%s", err->message);
@@ -532,6 +540,7 @@ static void init_defaults(void)
main_opts.mode = MODE_CONNECTABLE;
main_opts.name = g_strdup("BlueZ");
main_opts.discovto = HCID_DEFAULT_DISCOVERABLE_TIMEOUT;
+ main_opts.remember_powered = TRUE;
if (gethostname(main_opts.host_name, sizeof(main_opts.host_name) - 1) < 0)
strcpy(main_opts.host_name, "noname");