[gnome-control-center] network: Don't include spaces in proxy's ignore-hosts setting
- From: Rui Matos <rtcm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center] network: Don't include spaces in proxy's ignore-hosts setting
- Date: Fri, 13 Sep 2013 11:24:01 +0000 (UTC)
commit fb74444eec1efd92d59aa6cd0213b49f7b2d7b74
Author: Rui Matos <tiagomatos gmail com>
Date: Thu Sep 12 11:12:31 2013 +0200
network: Don't include spaces in proxy's ignore-hosts setting
We should also ignore any zero length strings resulting from
g_strsplit_set().
https://bugzilla.gnome.org/show_bug.cgi?id=707966
panels/network/net-proxy.c | 16 +++++++++++-----
1 files changed, 11 insertions(+), 5 deletions(-)
---
diff --git a/panels/network/net-proxy.c b/panels/network/net-proxy.c
index 28d37b6..5b53f43 100644
--- a/panels/network/net-proxy.c
+++ b/panels/network/net-proxy.c
@@ -285,16 +285,22 @@ set_ignore_hosts (const GValue *value,
const GVariantType *expected_type,
gpointer user_data)
{
- GVariant *result;
+ GVariantBuilder builder;
const gchar *sv;
- gchar **av;
+ gchar **av, **p;
sv = g_value_get_string (value);
- av = g_strsplit (sv, ",", 0);
- result = g_variant_new_strv ((const gchar * const *)av, -1);
+ av = g_strsplit_set (sv, ", ", 0);
+
+ g_variant_builder_init (&builder, G_VARIANT_TYPE_STRING_ARRAY);
+ for (p = av; *p; ++p) {
+ if (*p[0] != '\0')
+ g_variant_builder_add (&builder, "s", *p);
+ }
+
g_strfreev (av);
- return result;
+ return g_variant_builder_end (&builder);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]