summaryrefslogtreecommitdiff
path: root/src/up-config.c
diff options
context:
space:
mode:
authorBastien Nocera <hadess@hadess.net>2013-10-11 11:57:07 +0200
committerBastien Nocera <hadess@hadess.net>2013-10-14 10:42:56 +0200
commit3bf0b7adafa71ef44085189132c209848f21da81 (patch)
treea3de038cac3b555b64f68a85ca4e2baf1b150051 /src/up-config.c
parentccda7a4a17b529b078086f28c37f6bc9b53457eb (diff)
downloadupower-3bf0b7adafa71ef44085189132c209848f21da81.tar.gz
daemon: Add helper to get uint from config
Diffstat (limited to 'src/up-config.c')
-rw-r--r--src/up-config.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/up-config.c b/src/up-config.c
index 31f4be5..8973f85 100644
--- a/src/up-config.c
+++ b/src/up-config.c
@@ -55,6 +55,22 @@ up_config_get_boolean (UpConfig *config, const gchar *key)
}
/**
+ * up_config_get_uint:
+ **/
+guint
+up_config_get_uint (UpConfig *config, const gchar *key)
+{
+ int val;
+
+ val = g_key_file_get_integer (config->priv->keyfile,
+ "UPower", key, NULL);
+ if (val < 0)
+ return 0;
+
+ return val;
+}
+
+/**
* up_config_class_init:
**/
static void