[kupfer] browser: Use object's real name in the results list



commit 3efefa0bc616db4302a1f99c6b421a130c8cfc27
Author: Ulrik Sverdrup <ulrik sverdrup gmail com>
Date:   Sat Sep 12 20:33:00 2009 +0200

    browser: Use object's real name in the results list
    
    While we show the actual alias that was matched in the match view (for
    example gedit), we show the canonical/true name of the object in the
    results list (Text Editor).
    
    Now the results list always shows the same item under the same name,
    offers insight that the matched alias is only an alias, and is less
    ugly in case the matched alias is a folded name.

 kupfer/browser.py |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/kupfer/browser.py b/kupfer/browser.py
index 3f8d5e7..e448a6a 100644
--- a/kupfer/browser.py
+++ b/kupfer/browser.py
@@ -158,7 +158,10 @@ class LeafModel (object):
 
 	def get_label_markup(self, rankable):
 		leaf = rankable.object
-		name = escape_markup_str(rankable.value)
+		# Here we use the items real name
+		# Previously we used the alias that was matched,
+		# but it can be too confusing or ugly
+		name = escape_markup_str(unicode(leaf))
 		desc = escape_markup_str(leaf.get_description() or "")
 		if desc:
 			text = u'%s\n<small>%s</small>' % (name, desc, )



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