From 25e914b1cbc3698844582913dd77d083f9739ca0 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Fri, 11 Mar 2022 10:25:31 +0100 Subject: [PATCH] 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. --- plugins/Marketplace/Marketplace.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/Marketplace/Marketplace.py b/plugins/Marketplace/Marketplace.py index 2d98947572..b9632e5fb0 100644 --- a/plugins/Marketplace/Marketplace.py +++ b/plugins/Marketplace/Marketplace.py @@ -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)