[gnome-contacts] ContactEditor: Ignore empty values for e-mail addresses, etc.



commit 002eb3d779b3dd2424d069ec6c289dbea1a70549
Author: Philip Withnall <philip withnall collabora co uk>
Date:   Thu Aug 21 16:13:29 2014 +0100

    ContactEditor: Ignore empty values for e-mail addresses, etc.
    
    To avoid warnings from libfolks, as documented in the libfolks API.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=735168

 src/contacts-contact-editor.vala |   20 ++++++++++++++++++++
 1 files changed, 20 insertions(+), 0 deletions(-)
---
diff --git a/src/contacts-contact-editor.vala b/src/contacts-contact-editor.vala
index 75b53e4..0b4c77c 100644
--- a/src/contacts-contact-editor.vala
+++ b/src/contacts-contact-editor.vala
@@ -104,6 +104,11 @@ public class Contacts.ContactEditor : Grid {
     foreach (var row_entry in rows.entries) {
       var combo = container_grid.get_child_at (0, row_entry.key) as TypeCombo;
       var entry = container_grid.get_child_at (1, row_entry.key) as Entry;
+
+      /* Ignore empty entries. */
+      if (entry.get_text () == "")
+        continue;
+
       combo.update_details (row_entry.value.details);
       var details = new EmailFieldDetails (entry.get_text (), row_entry.value.details.parameters);
       new_details.add (details);
@@ -120,6 +125,11 @@ public class Contacts.ContactEditor : Grid {
     foreach (var row_entry in rows.entries) {
       var combo = container_grid.get_child_at (0, row_entry.key) as TypeCombo;
       var entry = container_grid.get_child_at (1, row_entry.key) as Entry;
+
+      /* Ignore empty entries. */
+      if (entry.get_text () == "")
+        continue;
+
       combo.update_details (row_entry.value.details);
       var details = new PhoneFieldDetails (entry.get_text (), row_entry.value.details.parameters);
       new_details.add (details);
@@ -134,6 +144,11 @@ public class Contacts.ContactEditor : Grid {
 
     foreach (var row_entry in rows.entries) {
       var entry = container_grid.get_child_at (1, row_entry.key) as Entry;
+
+      /* Ignore empty entries. */
+      if (entry.get_text () == "")
+        continue;
+
       var details = new UrlFieldDetails (entry.get_text (), row_entry.value.details.parameters);
       new_details.add (details);
     }
@@ -146,6 +161,11 @@ public class Contacts.ContactEditor : Grid {
     var new_value = Value (typeof (string));
     foreach (var row_entry in rows.entries) {
       var entry = container_grid.get_child_at (1, row_entry.key) as Entry;
+
+      /* Ignore empty entries. */
+      if (entry.get_text () == "")
+        continue;
+
       new_value.set_string (entry.get_text ());
     }
     return new_value;


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