Fixed update buttons

Contributes to: CURA-8587
This commit is contained in:
Jelle Spijker 2021-12-09 10:24:26 +01:00
parent 8dc88e52c2
commit 0299bb1694
No known key found for this signature in database
GPG key ID: 6662DC033BE6B99A
3 changed files with 10 additions and 11 deletions

View file

@ -51,7 +51,7 @@ class LocalPackageList(PackageList):
# Obtain and sort the local packages
self.setItems([{"package": p} for p in [self._makePackageModel(p) for p in self._manager.local_packages]])
self.sort(attrgetter("sectionTitle", "can_update", "displayName"), key = "package", reverse = True)
self.sort(attrgetter("sectionTitle", "_can_update", "displayName"), key = "package", reverse = True)
self.checkForUpdates(self._manager.local_packages)
self.setIsLoading(False)
@ -97,9 +97,9 @@ class LocalPackageList(PackageList):
for package_data in response_data["data"]:
package = self.getPackageModel(package_data["package_id"])
package.download_url = package_data.get("download_url", "")
package.can_update = True
package.setCanUpdate(True)
self.sort(attrgetter("sectionTitle", "can_update", "displayName"), key = "package", reverse = True)
self.sort(attrgetter("sectionTitle", "_can_update", "displayName"), key = "package", reverse = True)
self._ongoing_requests["check_updates"] = None
except RuntimeError:
# Setting the ownership of this object to not qml can still result in a RuntimeError. Which can occur when quickly toggling