def refresh_filenames(self): self._tree.clear() if self.a and self.b is None: filenames = gitcmds.diff_index_filenames(self.a) else: filenames = gitcmds.diff(self.diff_arg) if not filenames: return icon = qtutils.file_icon() items = [] for filename in filenames: item = QtGui.QTreeWidgetItem() item.setIcon(0, icon) item.setText(0, filename) item.setData(0, QtCore.Qt.UserRole, QtCore.QVariant(filename)) items.append(item) self._tree.addTopLevelItems(items)
def refresh_filenames(self): if self.a and self.b is None: filenames = gitcmds.diff_index_filenames(self.a) else: filenames = gitcmds.diff(self.diff_arg) self.tree.set_filenames(filenames, select=True)