def add_path(self, path): if path not in self._paths: self._paths.append(path) item = QStandardItem(path) self.appendRow(item) self._save_settings()