summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNiels De Graef <nielsdegraef@gmail.com>2018-12-12 19:07:50 +0100
committerNiels De Graef <nielsdegraef@gmail.com>2018-12-13 01:21:16 +0100
commita717f66b1be022c39551aca806bd5e02428ae923 (patch)
tree0c82ab47f1b99c02cdd6da39ebc9d9f5bfbb0ae2
parent62cb8b7956f5edf6d35f69ab1bd7d397bbf1ce2a (diff)
downloadgnome-contacts-a717f66b1be022c39551aca806bd5e02428ae923.tar.gz
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).
-rw-r--r--src/contacts-type-combo.vala11
-rw-r--r--src/contacts-typeset.vala9
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