How to use the continuum.project.Project.file_to_idb function in continuum

To help you get started, we’ve selected a few continuum examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github zyantific / continuum / continuum / ui.py View on Github external
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)