From a717f66b1be022c39551aca806bd5e02428ae923 Mon Sep 17 00:00:00 2001 From: Niels De Graef Date: Wed, 12 Dec 2018 19:07:50 +0100 Subject: Typeset: remove custom_dummmy TypeDescriptor This isn't supported (at the moment) anyway and only complicates things, so let's get rid of it to simplify the code base a bit (we can always reintroduce it later in a cleaner form). --- src/contacts-type-combo.vala | 11 ++--------- src/contacts-typeset.vala | 9 --------- 2 files changed, 2 insertions(+), 18 deletions(-) diff --git a/src/contacts-type-combo.vala b/src/contacts-type-combo.vala index d9186be..6cdeede 100644 --- a/src/contacts-type-combo.vala +++ b/src/contacts-type-combo.vala @@ -113,15 +113,8 @@ public class Contacts.TypeCombo : Grid { modified = true; TreeIter iter; if (combo.get_active_iter (out iter)) { - if (type_set.is_custom (iter)) { - custom_mode = true; - entry.show (); - entry.grab_focus (); - combo.hide (); - } else { - last_active = iter; - this.changed (); - } + last_active = iter; + this.changed (); } } diff --git a/src/contacts-typeset.vala b/src/contacts-typeset.vala index 0076d31..fb329f8 100644 --- a/src/contacts-typeset.vala +++ b/src/contacts-typeset.vala @@ -35,8 +35,6 @@ public class Contacts.TypeSet : Object { public bool in_store; } - // Dummy TypeDescriptor to mark the "Custom..." store entry - private static TypeDescriptor custom_dummy = new TypeDescriptor (); // Dummy TypeDescriptor to mark the "Other..." store entry private static TypeDescriptor other_dummy = new TypeDescriptor (); @@ -221,7 +219,6 @@ public class Contacts.TypeSet : Object { store.get (iter, 0, out display_name, 1, out descriptor); assert (display_name != null); // Not separator - assert (descriptor != custom_dummy); // Not custom... if (descriptor == null) { // A custom label details.parameters["type"] = "OTHER"; @@ -240,12 +237,6 @@ public class Contacts.TypeSet : Object { details.parameters["type"] = "PREF"; } - public bool is_custom (TreeIter iter) { - TypeDescriptor descriptor; - store.get (iter, 1, out descriptor); - return descriptor == custom_dummy; - } - private static TypeSet _general; private const VcardTypeMapping[] general_data = { // List most specific first, always in upper case -- cgit v1.2.1