def __init__(self): QFileIconProvider.__init__(self) self.icons = {} for key in self.__class__.ICONS.keys(): self.icons[key] = I('mimetypes/')+self.__class__.ICONS[key]+'.png' self.icons['calibre'] = I('lt.png') for i in ('dir', 'default', 'zero'): self.icons[i] = QIcon(self.icons[i])
def __init__(self): QFileIconProvider.__init__(self) self.icons = {} for key in self.__class__.ICONS.keys(): self.icons[key] = I("mimetypes/") + self.__class__.ICONS[key] + ".png" self.icons["calibre"] = I("lt.png") for i in ("dir", "default", "zero"): self.icons[i] = QIcon(self.icons[i])
def icon(self, arg): if isinstance(arg, QFileInfo): return self.load_icon(arg) if arg == QFileIconProvider.Folder: return self.icons['dir'] if arg == QFileIconProvider.File: return self.icons['default'] return QFileIconProvider.icon(self, arg)