Fix checkbox for automatic plug-in update checking

The checkbox was still there in the preferences page, but it didn't work at all, for two reasons:
- The preference entry didn't exist. This was causing warnings in the log (which is why I saw it).
- It wasn't checking the preference before making that API call. Could make a bunch of people pretty angry.
This commit is contained in:
Ghostkeeper 2022-03-11 10:25:31 +01:00
parent d778b539c2
commit 25e914b1cb
No known key found for this signature in database
GPG key ID: D2A8871EE34EC59A

View file

@ -31,8 +31,11 @@ class Marketplace(Extension, QObject):
# Not entirely the cleanest code, since the localPackage list also checks the server if there are updates
# Since that in turn will trigger notifications to be shown, we do need to construct it here and make sure
# that it checks for updates...
preferences = CuraApplication.getInstance().getPreferences()
preferences.addPreference("info/automatic_plugin_update_check", True)
self._local_package_list = LocalPackageList(self)
self._local_package_list.checkForUpdates(self._package_manager.local_packages)
if preferences.getValue("info/automatic_plugin_update_check"):
self._local_package_list.checkForUpdates(self._package_manager.local_packages)
self._package_manager.installedPackagesChanged.connect(self.checkIfRestartNeeded)