[evolution] Bug 785233 - Do not add extra comma in Open Map query



commit 650432c1eb3207acc45e7eba4b78d09bf77eaf53
Author: Milan Crha <mcrha redhat com>
Date:   Mon Jul 24 12:48:49 2017 +0200

    Bug 785233 - Do not add extra comma in Open Map query

 .../gui/widgets/eab-contact-formatter.c            |   24 +++++++++++++++-----
 1 files changed, 18 insertions(+), 6 deletions(-)
---
diff --git a/src/addressbook/gui/widgets/eab-contact-formatter.c 
b/src/addressbook/gui/widgets/eab-contact-formatter.c
index 84eb485..b1581e5 100644
--- a/src/addressbook/gui/widgets/eab-contact-formatter.c
+++ b/src/addressbook/gui/widgets/eab-contact-formatter.c
@@ -123,16 +123,28 @@ render_address_link (GString *buffer,
                gchar *escaped;
 
                if (adr->street && *adr->street)
-                       g_string_append_printf (link, "%s, ", adr->street);
+                       g_string_append_printf (link, "%s", adr->street);
 
-               if (adr->locality && *adr->locality)
-                       g_string_append_printf (link, "%s, ", adr->locality);
+               if (adr->locality && *adr->locality) {
+                       if (link->len)
+                               g_string_append (link, ", ");
 
-               if (adr->region && *adr->region)
-                       g_string_append_printf (link, "%s, ", adr->region);
+                       g_string_append_printf (link, "%s", adr->locality);
+               }
+
+               if (adr->region && *adr->region) {
+                       if (link->len)
+                               g_string_append (link, ", ");
+
+                       g_string_append_printf (link, "%s", adr->region);
+               }
+
+               if (adr->country && *adr->country) {
+                       if (link->len)
+                               g_string_append (link, ", ");
 
-               if (adr->country && *adr->country)
                        g_string_append_printf (link, "%s", adr->country);
+               }
 
                escaped = g_uri_escape_string (link->str, NULL, TRUE);
                g_string_assign (link, escaped);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]