diff options
author | Dan Williams <dcbw@redhat.com> | 2014-11-11 15:28:35 -0600 |
---|---|---|
committer | Dan Williams <dcbw@redhat.com> | 2014-12-08 12:54:12 -0600 |
commit | 6d856252f1b6a14718a958971a01586deb20806d (patch) | |
tree | ed58b6f1bf6dcb11db91a9116dbb3f711e692213 | |
parent | 3d3d5e854b0cd1158e3f422a39ae96de773db137 (diff) | |
download | network-manager-applet-6d856252f1b6a14718a958971a01586deb20806d.tar.gz |
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.
(cherry picked from commit 1e6e4ceba6e2a022a484db25c796939845df6e08)
-rw-r--r-- | 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 6f42f398..2a494f28 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; |