Fix another handle type bug

This commit is contained in:
Nick Hall 2015-03-12 18:13:38 +00:00
parent b02e1fe467
commit 1a0784b154

View File

@ -29,6 +29,7 @@ from gi.repository import Pango
from ... import widgets from ... import widgets
from ...dbguielement import DbGUIElement from ...dbguielement import DbGUIElement
from gramps.gen.config import config from gramps.gen.config import config
from gramps.gen.constfunc import UNITYPE
_RETURN = Gdk.keyval_from_name("Return") _RETURN = Gdk.keyval_from_name("Return")
_KP_ENTER = Gdk.keyval_from_name("KP_Enter") _KP_ENTER = Gdk.keyval_from_name("KP_Enter")
@ -212,6 +213,9 @@ class SidebarFilter(DbGUIElement):
self.__tag_list = [] self.__tag_list = []
for handle in self.dbstate.db.get_tag_handles(sort_handles=True): for handle in self.dbstate.db.get_tag_handles(sort_handles=True):
tag = self.dbstate.db.get_tag_from_handle(handle) tag = self.dbstate.db.get_tag_from_handle(handle)
# for python3 this returns a byte object, so conversion needed
if not isinstance(handle, UNITYPE):
handle = handle.decode('utf-8')
self.__tag_list.append((tag.get_name(), handle)) self.__tag_list.append((tag.get_name(), handle))
self.on_tags_changed([item[0] for item in self.__tag_list]) self.on_tags_changed([item[0] for item in self.__tag_list])