From 2d293a237e8f59c7ec7c5846377cb3351bec12e8 Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Mon, 25 Aug 2014 17:04:27 +0200 Subject: [PATCH] daemon: Add helper to get string from config https://bugs.freedesktop.org/show_bug.cgi?id=82925 --- src/up-config.c | 10 ++++++++++ src/up-config.h | 2 ++ 2 files changed, 12 insertions(+) diff --git a/src/up-config.c b/src/up-config.c index 8973f85..c3a4ced 100644 --- a/src/up-config.c +++ b/src/up-config.c @@ -71,6 +71,16 @@ up_config_get_uint (UpConfig *config, const gchar *key) } /** + * up_config_get_string: + **/ +gchar * +up_config_get_string (UpConfig *config, const gchar *key) +{ + return g_key_file_get_integer (config->priv->keyfile, + "UPower", key, NULL); +} + +/** * up_config_class_init: **/ static void diff --git a/src/up-config.h b/src/up-config.h index e58a700..f02d37a 100644 --- a/src/up-config.h +++ b/src/up-config.h @@ -52,6 +52,8 @@ gboolean up_config_get_boolean (UpConfig *config, const gchar *key); guint up_config_get_uint (UpConfig *config, const gchar *key); +gchar *up_config_get_string (UpConfig *config, + const gchar *key); G_END_DECLS -- 2.1.0