diff options
author | Remco Burema <r.burema@ultimaker.com> | 2022-05-20 15:32:28 +0300 |
---|---|---|
committer | Remco Burema <r.burema@ultimaker.com> | 2022-05-20 15:32:28 +0300 |
commit | 050a73166360106d2c2733b22e9c31be400f6db8 (patch) | |
tree | fd2d0b2f87a3b3f2ce58fc435e14dcdcb306bedb | |
parent | 4d3f312cb6726488797df87ffde31675ce86c7e4 (diff) |
In secure version: disable loading themes from unbundled folders.SEC-255_fix_theme_5.0
This was a bit more tricky then it at first seemed, since the information wether this is a 'secure version' comes from the user-application and is not known in the Uranium library. This is not normally such a point, but both the theme and the preferences objects are loaded _very_ early in the process, and that information needs to be injected before then. (Well, in the case of the Theme object it's less important, since in the implementation choseen that is now security wise at least only in charge of wheter or not to even show the theme as selectable in the interface, so that it only needs to be aware of the 'security' status any time before the user can see a preference screen, but not nescesarily earlier.)
SEC-255 | CURA-8966
-rwxr-xr-x | cura/CuraApplication.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/cura/CuraApplication.py b/cura/CuraApplication.py index ee3c6e361e..a324168f31 100755 --- a/cura/CuraApplication.py +++ b/cura/CuraApplication.py @@ -315,7 +315,7 @@ class CuraApplication(QtApplication): def initialize(self) -> None: self.__addExpectedResourceDirsAndSearchPaths() # Must be added before init of super - super().initialize() + super().initialize(ApplicationMetadata.IsEnterpriseVersion) self._preferences.addPreference("cura/single_instance", False) self._use_single_instance = self._preferences.getValue("cura/single_instance") or self._cli_args.single_instance @@ -942,6 +942,7 @@ class CuraApplication(QtApplication): self._qml_import_paths.append(Resources.getPath(self.ResourceTypes.QmlFiles)) self._setLoadingHint(self._i18n_catalog.i18nc("@info:progress", "Initializing engine...")) self.initializeEngine() + self.getTheme().setCheckIfTrusted(ApplicationMetadata.IsEnterpriseVersion) # Initialize UI state controller.setActiveStage("PrepareStage") |