[evolution-data-server] Bug 775618 - Contacts on Google does not accept a second address line



commit da17eb7b51a51903980bf493c9530784850af959
Author: Milan Crha <mcrha redhat com>
Date:   Tue Dec 6 18:21:30 2016 +0100

    Bug 775618 - Contacts on Google does not accept a second address line

 .../backends/google/e-book-google-utils.c          |   22 +++++++++++++++++--
 1 files changed, 19 insertions(+), 3 deletions(-)
---
diff --git a/src/addressbook/backends/google/e-book-google-utils.c 
b/src/addressbook/backends/google/e-book-google-utils.c
index ceb75b0..4157894 100644
--- a/src/addressbook/backends/google/e-book-google-utils.c
+++ b/src/addressbook/backends/google/e-book-google-utils.c
@@ -1525,11 +1525,27 @@ gdata_gd_postal_address_from_attribute (EVCardAttribute *attr,
                value = value->next;
                if (!value)
                        return address;
-               gdata_gd_postal_address_set_house_name (address, (*((gchar *) value->data) != '\0') ? 
value->data : NULL);
+               label = (*((gchar *) value->data) != '\0') ? value->data : NULL;
                value = value->next;
-               if (!value)
+               if (!value) {
+                       gdata_gd_postal_address_set_street (address, label);
                        return address;
-               gdata_gd_postal_address_set_street (address, (*((gchar *) value->data) != '\0') ? value->data 
: NULL);
+               }
+               if (label) {
+                       const gchar *value_str = (*((gchar *) value->data) != '\0') ? value->data : NULL;
+
+                       if (value_str) {
+                               gchar *tmp;
+
+                               tmp = g_strconcat (value_str, "\n", label, NULL);
+                               gdata_gd_postal_address_set_street (address, tmp);
+                               g_free (tmp);
+                       } else {
+                               gdata_gd_postal_address_set_street (address, label);
+                       }
+               } else {
+                       gdata_gd_postal_address_set_street (address, (*((gchar *) value->data) != '\0') ? 
value->data : NULL);
+               }
                value = value->next;
                if (!value)
                        return address;


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