Remove canInstallChanged signal

It's not needed, this can just be handled with a direct call!

CURA-8587
This commit is contained in:
Jaime van Kessel 2021-12-17 16:41:52 +01:00
parent 8a198f7911
commit 83c78c4b4d

View file

@ -46,7 +46,6 @@ class PackageList(ListModel):
self._has_more = False self._has_more = False
self._has_footer = True self._has_footer = True
self._to_install: Dict[str, str] = {} self._to_install: Dict[str, str] = {}
self.canInstallChanged.connect(self._requestInstall)
self._ongoing_requests: Dict[str, Optional[HttpRequestData]] = {"download_package": None} self._ongoing_requests: Dict[str, Optional[HttpRequestData]] = {"download_package": None}
self._scope = JsonDecoratorScope(UltimakerCloudScope(CuraApplication.getInstance())) self._scope = JsonDecoratorScope(UltimakerCloudScope(CuraApplication.getInstance()))
@ -135,8 +134,6 @@ class PackageList(ListModel):
index = self.find("package", package_id) index = self.find("package", package_id)
return self.getItem(index)["package"] return self.getItem(index)["package"]
canInstallChanged = pyqtSignal(str, bool)
def _openLicenseDialog(self, package_id: str, license_content: str) -> None: def _openLicenseDialog(self, package_id: str, license_content: str) -> None:
plugin_path = self._plugin_registry.getPluginPath("Marketplace") plugin_path = self._plugin_registry.getPluginPath("Marketplace")
if plugin_path is None: if plugin_path is None:
@ -236,7 +233,8 @@ class PackageList(ListModel):
temp_file.close() temp_file.close()
self._to_install[package_id] = temp_file.name self._to_install[package_id] = temp_file.name
self._ongoing_requests["download_package"] = None self._ongoing_requests["download_package"] = None
self.canInstallChanged.emit(package_id, update) self._requestInstall(package_id, update)
def _downloadError(self, package_id: str, update: bool = False, reply: Optional["QNetworkReply"] = None, error: Optional["QNetworkReply.NetworkError"] = None) -> None: def _downloadError(self, package_id: str, update: bool = False, reply: Optional["QNetworkReply"] = None, error: Optional["QNetworkReply.NetworkError"] = None) -> None:
if reply: if reply: