Ugly fix for uninstalling installed packages, but not uninstalling bundled packages.

This commit is contained in:
Jack Ha 2018-05-15 10:50:33 +02:00
parent c54957540b
commit 49c4f66d95

View file

@ -239,10 +239,16 @@ class CuraPackageManager(QObject):
Logger.log("i", "Attempt to remove package [%s] that is not installed, do nothing.", package_id) Logger.log("i", "Attempt to remove package [%s] that is not installed, do nothing.", package_id)
return return
# Temp hack
if package_id not in self._installed_package_dict and package_id in self._bundled_package_dict:
Logger.log("i", "Not uninstalling [%s] because it is a bundled package.")
return
if package_id not in self._to_install_package_dict or force_add: if package_id not in self._to_install_package_dict or force_add:
# Schedule for a delayed removal: # Schedule for a delayed removal:
self._to_remove_package_set.add(package_id) self._to_remove_package_set.add(package_id)
else: else:
if package_id in self._to_install_package_dict:
# Remove from the delayed installation list if present # Remove from the delayed installation list if present
del self._to_install_package_dict[package_id] del self._to_install_package_dict[package_id]