diff options
author | Bastien Nocera <hadess@hadess.net> | 2013-10-11 11:57:07 +0200 |
---|---|---|
committer | Bastien Nocera <hadess@hadess.net> | 2013-10-14 10:42:56 +0200 |
commit | 3bf0b7adafa71ef44085189132c209848f21da81 (patch) | |
tree | a3de038cac3b555b64f68a85ca4e2baf1b150051 /src/up-config.c | |
parent | ccda7a4a17b529b078086f28c37f6bc9b53457eb (diff) | |
download | upower-3bf0b7adafa71ef44085189132c209848f21da81.tar.gz |
daemon: Add helper to get uint from config
Diffstat (limited to 'src/up-config.c')
-rw-r--r-- | src/up-config.c | 16 |
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 |