Some unnecessary unicode conversion cleanup after fix of issue 4078.
svn: r15607
This commit is contained in:
@@ -137,7 +137,7 @@ class NameModel(gtk.TreeStore):
|
|||||||
nlist = name.get_note_list()
|
nlist = name.get_note_list()
|
||||||
if nlist:
|
if nlist:
|
||||||
note = self.db.get_note_from_handle(nlist[0])
|
note = self.db.get_note_from_handle(nlist[0])
|
||||||
text = note.get().replace('\n', ' ')
|
text = note.get().replace(u'\n', u' ')
|
||||||
if len(text) > 80:
|
if len(text) > 80:
|
||||||
text = text[:80]+"..."
|
text = text[:80]+"..."
|
||||||
return text
|
return text
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ class NoteModel(gtk.ListStore):
|
|||||||
self.db = db
|
self.db = db
|
||||||
for handle in note_list:
|
for handle in note_list:
|
||||||
note = self.db.get_note_from_handle(handle)
|
note = self.db.get_note_from_handle(handle)
|
||||||
text = note.get().replace('\n', ' ')
|
text = note.get().replace(u'\n', u' ')
|
||||||
if len(text) > 80:
|
if len(text) > 80:
|
||||||
text = text[:80]+"..."
|
text = text[:80]+"..."
|
||||||
self.append(row=[
|
self.append(row=[
|
||||||
|
|||||||
@@ -385,9 +385,7 @@ class NoteEntry(ObjEntry):
|
|||||||
return self.db.get_note_from_handle(handle)
|
return self.db.get_note_from_handle(handle)
|
||||||
|
|
||||||
def get_label(self, note):
|
def get_label(self, note):
|
||||||
txt = " ".join(note.get().split())
|
txt = u" ".join(note.get().split())
|
||||||
#String must be unicode for truncation to work for non ascii characters
|
|
||||||
txt = unicode(txt)
|
|
||||||
if len(txt) > 35:
|
if len(txt) > 35:
|
||||||
txt = txt[:35] + "..."
|
txt = txt[:35] + "..."
|
||||||
return "%s [%s]" % (txt, note.gramps_id)
|
return "%s [%s]" % (txt, note.gramps_id)
|
||||||
|
|||||||
Reference in New Issue
Block a user