Remove usage of canUpdate slot

This makes it a bit cleaner, since having it as a slot is a bit weird in the first place (and forced
all kinds of hacks to ensure it got re-evaluated)

CURA-6151
This commit is contained in:
Jaime van Kessel 2019-03-27 12:54:20 +01:00
parent f4f94b10d2
commit e3f2c06542
3 changed files with 2 additions and 23 deletions

View file

@ -461,24 +461,6 @@ class Toolbox(QObject, Extension):
break
return remote_package
# Give a list of package ids that have an update available.
@pyqtProperty(bool, notify=metadataChanged)
def packagesWithUpdateAvailable(self) -> List[str]:
all_installed_packages = self._package_manager.getAllInstalledPackageIDs()
packages_with_update_available = []
for package_id in all_installed_packages:
if self.canUpdate(package_id):
packages_with_update_available.append(package_id)
return packages_with_update_available
# Checks
# --------------------------------------------------------------------------
@pyqtSlot(str, result = bool)
def canUpdate(self, package_id: str) -> bool:
return package_id in self._package_manager.packagesWithUpdate
@pyqtSlot(str, result = bool)
def canDowngrade(self, package_id: str) -> bool:
# If the currently installed version is higher than the bundled version (if present), the we can downgrade