Only remove Card from List when package is deleted

Updated packages should still be present in the list

Contribute to CURA-8587
This commit is contained in:
Jelle Spijker 2021-12-16 17:03:14 +01:00
parent ffa34ab5fe
commit 0a7aee5c09
No known key found for this signature in database
GPG key ID: 6662DC033BE6B99A

View file

@ -48,7 +48,8 @@ class LocalPackageList(PackageList):
self.sort(lambda model: f"{SECTION_ORDER[model.sectionTitle]}_{model._can_update}_{model.displayName}".lower(), key = "package")
def _removePackageModel(self, package_id):
if package_id not in self._package_manager.local_packages_ids:
package = self.getPackageModel(package_id)
if not package.canUpdate and package_id in self._package_manager.getPackagesToRemove() and package_id not in self._package_manager.getPackagesToInstall():
index = self.find("package", package_id)
if index < 0:
Logger.error(f"Could not find card in Listview corresponding with {package_id}")