From 080e3b9f27610aa2ea6147be9b0f423d9bb4a144 Mon Sep 17 00:00:00 2001 From: "j.spijker@ultimaker.com" Date: Wed, 3 Nov 2021 12:04:10 +0100 Subject: [PATCH] To be removed packages are still listed for the current session A user might still need to interact with a **to be removed** package and it is also still being used in the current Cura session. But the current package list doesn't list that package anymore. Introduced a `getPackagesToRemove()` method in the Uranium PackageManager to circumvent this issue. Contributes to CURA-8558 --- plugins/Marketplace/LocalPackageList.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/plugins/Marketplace/LocalPackageList.py b/plugins/Marketplace/LocalPackageList.py index 171751c238..589ba26226 100644 --- a/plugins/Marketplace/LocalPackageList.py +++ b/plugins/Marketplace/LocalPackageList.py @@ -70,9 +70,11 @@ class LocalPackageList(PackageList): def _allPackageInfo(self): manager = self._application.getPackageManager() - for package_id in manager.getAllInstalledPackageIDs(): - package_data = manager.getInstalledPackageInfo(package_id) - bundled_or_installed = "bundled" if package_data["is_bundled"] else "installed" - package_type = package_data["package_type"] - package_data["section_title"] = self.PACKAGE_SECTION_HEADER[bundled_or_installed][package_type] - yield package_data + for package_type, packages in manager.getAllInstalledPackagesInfo().items(): + for package_data in packages: + bundled_or_installed = "installed" if manager.isUserInstalledPackage(package_data["package_id"]) else "bundled" + package_data["section_title"] = self.PACKAGE_SECTION_HEADER[bundled_or_installed][package_type] + yield package_data + + for package_data in manager.getPackagesToRemove().values(): + yield package_data["package_info"]