Commit 002eb3d7 authored by Philip Withnall's avatar Philip Withnall

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
parent efc7f5b2
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment