Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def update(self):
# Update files.
self._ui.project_tree.clear()
items = []
icon_provider = QFileIconProvider()
for cur_file in self.project.files:
file_info = QFileInfo(cur_file)
item = QTreeWidgetItem(None, [
os.path.relpath(cur_file, self.project.proj_dir),
"N/A",
])
item.setData(0, Qt.UserRole, Project.file_to_idb(cur_file))
item.setIcon(0, icon_provider.icon(file_info))
items.append(item)
self._ui.project_tree.insertTopLevelItems(0, items)
# Update other stuff.
self._ui.project_path.setText(self.project.proj_dir)