[network-manager-applet] gconf: support reading int64 properties
- From: Dan Williams <dcbw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [network-manager-applet] gconf: support reading int64 properties
- Date: Tue, 11 Nov 2014 21:29:18 +0000 (UTC)
commit 1e6e4ceba6e2a022a484db25c796939845df6e08
Author: Dan Williams <dcbw redhat com>
Date: Tue Nov 11 15:28:35 2014 -0600
gconf: support reading int64 properties
Now that we've got int64 properties (route metric) let's make sure
the testcases don't fail with them.
src/gconf-helpers/gconf-helpers.c | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/src/gconf-helpers/gconf-helpers.c b/src/gconf-helpers/gconf-helpers.c
index 6f42f39..2a494f2 100644
--- a/src/gconf-helpers/gconf-helpers.c
+++ b/src/gconf-helpers/gconf-helpers.c
@@ -1789,6 +1789,17 @@ read_one_setting_value_from_gconf (NMSetting *setting,
g_object_set (setting, key, uint_val, NULL);
g_free (tmp_str);
}
+ } else if (type == G_TYPE_INT64) {
+ char *tmp_str = NULL;
+
+ /* GConf doesn't do 64-bit values, so use strings instead */
+ if (nm_gconf_get_string_helper (info->client, info->dir, key, setting_name, &tmp_str) &&
tmp_str) {
+ gint64 int_val = g_ascii_strtoll (tmp_str, NULL, 10);
+
+ if (!(int_val == G_MAXUINT64 && errno == ERANGE))
+ g_object_set (setting, key, int_val, NULL);
+ g_free (tmp_str);
+ }
} else if (type == G_TYPE_BOOLEAN) {
gboolean bool_val;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]