[gnome-shell] contact-display: Try harder to display a meaningful name



commit 0d5618fdd1dd30d7594aa450d46ed91df43f8f24
Author: Florian MÃllner <fmuellner gnome org>
Date:   Sat Oct 1 00:33:36 2011 +0200

    contact-display: Try harder to display a meaningful name
    
    We now match individuals on other properties than alias, so take
    this into account when representing a contact in search results
    to avoid having them show up as "Unknown".
    
    https://bugzilla.gnome.org/show_bug.cgi?id=660580

 js/ui/contactDisplay.js |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/js/ui/contactDisplay.js b/js/ui/contactDisplay.js
index 10048af..8cc46e0 100644
--- a/js/ui/contactDisplay.js
+++ b/js/ui/contactDisplay.js
@@ -26,7 +26,8 @@ function Contact(id) {
 
 Contact.prototype = {
     _init: function(id) {
-        this.individual = Shell.ContactSystem.get_default().get_individual(id);
+        this._contactSys = Shell.ContactSystem.get_default();
+        this.individual = this._contactSys.get_individual(id);
 
         this.actor = new St.Bin({ style_class: 'contact',
                                   reactive: true,
@@ -56,7 +57,12 @@ Contact.prototype = {
                                x_align: St.Align.START,
                                y_align: St.Align.MIDDLE });
 
-        let aliasText = this.individual.alias || _("Unknown");
+        let email = this._contactSys.get_email_for_display(this.individual);
+        let aliasText = this.individual.alias     ||
+                        this.individual.full_name ||
+                        this.individual.nickname  ||
+                        email                     ||
+                        _("Unknown");
         let aliasLabel = new St.Label({ text: aliasText,
                                         style_class: 'contact-details-alias' });
         details.add(aliasLabel, { x_fill: true,



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