Commit 6c65b72e authored by Niels De Graef's avatar Niels De Graef

Contact: Remove display_name property.

It's just a shorthand for `individual.display_name`, so make that more
explicit.
parent 03b92240
......@@ -95,7 +95,7 @@ public class Contacts.AvatarSelector : Dialog {
this.grid.attach (this.current_avatar, 0, 0);
if (contact != null)
this.contact_name_label.label = contact.display_name;
this.contact_name_label.label = contact.individual.display_name;
#if HAVE_CHEESE
this.webcam_button_box.show ();
......
......@@ -999,7 +999,7 @@ public class Contacts.ContactEditor : Grid {
this.name_entry.set_data ("changed", false);
if (this.contact != null)
this.name_entry.text = this.contact.display_name;
this.name_entry.text = this.contact.individual.display_name;
/* structured name change */
this.name_entry.changed.connect (() => {
......
......@@ -46,7 +46,7 @@ public class Contacts.ContactList : ListBox {
grid.set_column_spacing (10);
this.avatar = new Avatar (LIST_AVATAR_SIZE);
this.label = new Label (c.display_name);
this.label = new Label (c.individual.display_name);
this.label.ellipsize = Pango.EllipsizeMode.END;
this.label.valign = Align.CENTER;
this.label.halign = Align.START;
......@@ -70,7 +70,7 @@ public class Contacts.ContactList : ListBox {
public void update () {
// Update widgets
this.label.set_text (this.contact.display_name);
this.label.set_text (this.contact.individual.display_name);
this.avatar.set_image.begin (this.contact.individual, this.contact);
}
......
......@@ -103,7 +103,7 @@ public class Contacts.ContactPane : Stack {
parent_overlay.add_overlay (this.suggestion_grid);
this.suggestion_grid.suggestion_accepted.connect ( () => {
var linked_contact = c.display_name;
var linked_contact = c.individual.display_name;
link_contacts.begin (contact, c, this.store, (obj, result) => {
var operation = link_contacts.end (result);
this.contacts_linked (null, linked_contact, operation);
......
......@@ -114,7 +114,7 @@ public class Contacts.ContactSheet : Grid {
name_label.set_selectable (true);
c.keep_widget_uptodate (name_label, (w) => {
(w as Label).set_markup (Markup.printf_escaped ("<span font='16'>%s</span>", c.display_name));
(w as Label).set_markup (Markup.printf_escaped ("<span font='16'>%s</span>", c.individual.display_name));
});
attach (name_label, 1, 0, 1, 3);
......@@ -142,7 +142,7 @@ public class Contacts.ContactSheet : Grid {
foreach (var email in emails) {
var button = add_row_with_button (ref i, TypeSet.email.format_type (email), email.value);
button.clicked.connect (() => {
Utils.compose_mail ("%s <%s>".printf(c.display_name, email.value));
Utils.compose_mail ("%s <%s>".printf(c.individual.display_name, email.value));
});
}
}
......
......@@ -34,10 +34,6 @@ public class Contacts.Contact : GLib.Object {
public Persona? fake_persona = null;
public string display_name {
get { return this.individual.display_name; }
}
public static bool persona_has_writable_property (Persona persona, string property) {
// TODO: This should check the writibility on the FakePersona store,
// but that is not availible in folks yet
......@@ -880,7 +876,7 @@ public class Contacts.FakePersona : Persona {
prop_vals.add (v);
Persona p = yield contact.ensure_primary_persona ();
if (!has_full_name)
p.set ("full-name", contact.display_name);
p.set ("full-name", contact.individual.display_name);
foreach (var pv in prop_vals) {
yield Contact.set_persona_property (p, pv.property, pv.value);
}
......
......@@ -54,8 +54,8 @@ public class Contacts.LinkSuggestionGrid : Grid {
this.description_label.xalign = 0; // FIXME: hack to make it actually align left.
this.description_label.label = contact.is_main?
_("Is this the same person as %s from %s?").printf (contact.display_name, contact.format_persona_stores ())
: _("Is this the same person as %s?").printf (contact.display_name);
_("Is this the same person as %s from %s?").printf (contact.individual.display_name, contact.format_persona_stores ())
: _("Is this the same person as %s?").printf (contact.individual.display_name);
var extra_info = find_extra_description (contact);
if (extra_info != null) {
......
......@@ -38,7 +38,7 @@ public class Contacts.LinkedAccountsDialog : Dialog {
any_unlinked = false;
var headerbar = get_header_bar () as Gtk.HeaderBar;
headerbar.set_title (_("%s").printf (contact.display_name));
headerbar.set_title (_("%s").printf (contact.individual.display_name));
headerbar.set_subtitle (_("Linked Accounts"));
set_default_size (600, 400);
......
......@@ -571,7 +571,7 @@ namespace Contacts {
var details = new HashTable<string, Value?> (str_hash, str_equal);
try {
var v = Value (typeof (string));
v.set_string (main.display_name);
v.set_string (main.individual.display_name);
details.set ("full-name", v);
write_persona = yield Contact.create_primary_persona_for_details (contacts_store.aggregator.primary_store, details);
operation.added_persona (write_persona);
......@@ -676,9 +676,9 @@ namespace Contacts {
if (main_persona == null && other_personas.size > 1) {
var details = new HashTable<string, Value?> (str_hash, str_equal);
try {
main_persona = yield contact.store.aggregator.primary_store.add_persona_from_details (details);
yield (main_persona as NameDetails).change_full_name (contact.display_name);
operation.added_persona (main_persona);
main_persona = yield contact.store.aggregator.primary_store.add_persona_from_details (details);
yield (main_persona as NameDetails).change_full_name (contact.individual.display_name);
operation.added_persona (main_persona);
} catch (GLib.Error e) {
warning ("Unable to create new persona when unlinking: %s\n", e.message);
return operation;
......
......@@ -155,7 +155,7 @@ public class Contacts.Window : Gtk.ApplicationWindow {
this.state = UiState.UPDATING;
var name = this.contact_pane.contact.display_name;
var name = this.contact_pane.contact.individual.display_name;
this.right_header.title = _("Editing %s").printf (name);
this.contact_pane.set_edit_mode (true);
......@@ -186,7 +186,7 @@ public class Contacts.Window : Gtk.ApplicationWindow {
}
if (this.contact_pane.contact != null) {
this.right_header.title = this.contact_pane.contact.display_name;
this.right_header.title = this.contact_pane.contact.individual.display_name;
} else {
this.right_header.title = "";
}
......@@ -213,7 +213,7 @@ public class Contacts.Window : Gtk.ApplicationWindow {
this.ignore_favorite_button_toggled = false;
this.favorite_button.tooltip_text = (c.individual.is_favourite)? _("Unmark as favorite")
: _("Mark as favorite");
this.right_header.title = c.display_name;
this.right_header.title = c.individual.display_name;
}
}
......@@ -316,7 +316,7 @@ public class Contacts.Window : Gtk.ApplicationWindow {
this.state = UiState.NORMAL;
var msg = (contacts.size > 1)? _("%d contacts deleted").printf (contacts.size)
: _("Deleted contact %s").printf (contacts[0].display_name);
: _("Deleted contact %s").printf (contacts[0].individual.display_name);
var b = new Button.with_mnemonic (_("_Undo"));
......
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