[gnome-contacts] contact-editor: Don’t create emp ty NoteFieldDetails



commit 64f9b61cca4757546abcab12195bd2b40c654ea6
Author: Philip Withnall <philip tecnocode co uk>
Date:   Sun Feb 16 14:20:08 2014 +0000

    contact-editor: Don’t create empty NoteFieldDetails
    
    It’s explicitly banned by the folks API documentation and results in
    warnings from folks.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=701990

 src/contacts-contact-editor.vala |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/src/contacts-contact-editor.vala b/src/contacts-contact-editor.vala
index ab59205..ac120c7 100644
--- a/src/contacts-contact-editor.vala
+++ b/src/contacts-contact-editor.vala
@@ -158,8 +158,10 @@ public class Contacts.ContactEditor : Grid {
       text.get_buffer ().get_start_iter (out start);
       text.get_buffer ().get_end_iter (out end);
       var value = text.get_buffer ().get_text (start, end, true);
-      var details = new NoteFieldDetails (value, row_entry.value.details.parameters);
-      new_details.add (details);
+      if (value != "") {
+        var details = new NoteFieldDetails (value, row_entry.value.details.parameters);
+        new_details.add (details);
+      }
     }
     var new_value = Value (new_details.get_type ());
     new_value.set_object (new_details);


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