8487: Use place displayer to generate title in views

This commit is contained in:
Nick Hall 2015-05-28 14:41:32 +01:00
parent 19acd368c0
commit ed0b50e9b8

View File

@ -44,9 +44,10 @@ from gi.repository import Gtk
# GRAMPS modules # GRAMPS modules
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
from gramps.gen.lib.placetype import PlaceType from gramps.gen.lib import Place, PlaceType
from gramps.gen.datehandler import format_time from gramps.gen.datehandler import format_time
from gramps.gen.utils.place import conv_lat_lon from gramps.gen.utils.place import conv_lat_lon
from gramps.gen.display.place import displayer as place_displayer
from gramps.gen.constfunc import cuni from gramps.gen.constfunc import cuni
from .flatbasemodel import FlatBaseModel from .flatbasemodel import FlatBaseModel
from .treebasemodel import TreeBaseModel from .treebasemodel import TreeBaseModel
@ -116,7 +117,9 @@ class PlaceBaseModel(object):
return len(self.fmap)+1 return len(self.fmap)+1
def column_title(self, data): def column_title(self, data):
return cuni(data[2]) place = Place()
place.unserialize(data)
return place_displayer.display(self.db, place)
def column_name(self, data): def column_name(self, data):
return cuni(data[6]) return cuni(data[6])