def data(self, column, role): if role == Qt.DecorationRole and column == 0: baseiconname = 'hg' if paths.is_unc_path(self.rootpath()): baseiconname = 'thg-remote-repo' ico = qtlib.geticon(baseiconname) if not self._valid: ico = qtlib.getoverlaidicon(ico, qtlib.geticon('dialog-warning')) return ico elif role in (Qt.DisplayRole, Qt.EditRole): return [self.shortname, self.shortpath][column]()
def data(self, column, role): if role == Qt.DecorationRole: if column == 0: baseiconname = 'hg' if paths.is_unc_path(self.rootpath()): baseiconname = 'thg-remote-repo' ico = qtlib.geticon(baseiconname) if not self._valid: ico = qtlib.getoverlaidicon(ico, qtlib.geticon('dialog-warning')) return QVariant(ico) return QVariant() elif role == Qt.FontRole: if self._isActiveTab: font = QFont() font.setBold(True) else: return QVariant() return QVariant(font) if column == 0: return QVariant(self.shortname()) elif column == 1: return QVariant(self.shortpath()) return QVariant()