[folks] eds: Fix warnings about empty postal addresses
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [folks] eds: Fix warnings about empty postal addresses
- Date: Sat, 23 Jun 2012 11:17:53 +0000 (UTC)
commit c199edd98c5c439b649c61a0dcb247dc3e7a13f5
Author: Philip Withnall <philip tecnocode co uk>
Date: Sat Jun 23 12:17:23 2012 +0100
eds: Fix warnings about empty postal addresses
backends/eds/lib/edsf-persona.vala | 15 +++++++++++++--
1 files changed, 13 insertions(+), 2 deletions(-)
---
diff --git a/backends/eds/lib/edsf-persona.vala b/backends/eds/lib/edsf-persona.vala
index bef9a63..f03d0a4 100644
--- a/backends/eds/lib/edsf-persona.vala
+++ b/backends/eds/lib/edsf-persona.vala
@@ -1368,6 +1368,12 @@ public class Edsf.Persona : Folks.Persona,
string normalised_addr =
(owned) ImDetails.normalise_im_address ((!) addr, im_proto);
+
+ if (normalised_addr == "")
+ {
+ continue;
+ }
+
var im_fd = new ImFieldDetails (normalised_addr);
new_im_addresses.set (im_proto, im_fd);
}
@@ -1643,8 +1649,13 @@ public class Edsf.Persona : Folks.Persona,
var attrs = this.contact.get_attributes (E.ContactField.ADDRESS);
foreach (unowned E.VCardAttribute attr in attrs)
{
- var pa_fd = new PostalAddressFieldDetails (
- this._postal_address_from_attribute (attr));
+ var address = this._postal_address_from_attribute (attr);
+ if (address.is_empty ())
+ {
+ continue;
+ }
+
+ var pa_fd = new PostalAddressFieldDetails (address);
this._update_params (pa_fd, attr);
new_postal_addresses.add (pa_fd);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]