def data(self, index, role):
if not index.isValid():
return None
cat = self._categories[index.row()]
role = self.COLUMNS[role]
if role == "_name":
return unicode(cat.name, "utf8", "ignore")
elif role == "_iconname":
# funny, but it appears like Qt does not have something
# to lookup the icon path in QIcon
icons = Gtk.IconTheme.get_default()
info = icons.lookup_icon(cat.iconname, 48, 0)
if info:
return info.get_filename()
return ""
评论列表
文章目录