diff options
author | Ghostkeeper <rubend@tutanota.com> | 2017-09-26 10:49:40 +0300 |
---|---|---|
committer | Ghostkeeper <rubend@tutanota.com> | 2017-09-26 10:56:49 +0300 |
commit | 2fbcfe65ea7e29a591e3e3b247cbd182864c6913 (patch) | |
tree | 4fd6ea50ad7e88332a1b85494c4f5da3a08245f6 /plugins/3MFWriter/ThreeMFWorkspaceWriter.py | |
parent | 583b776c6c372a17490cb2a57de727c7c7321609 (diff) |
Only write the information we need to workspaces
This way we can be sure that no sensitive information enters the workspaces even if some future developer or a plug-in puts it there.
Contributes to issue CURA-4371.
Diffstat (limited to 'plugins/3MFWriter/ThreeMFWorkspaceWriter.py')
-rw-r--r-- | plugins/3MFWriter/ThreeMFWorkspaceWriter.py | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/plugins/3MFWriter/ThreeMFWorkspaceWriter.py b/plugins/3MFWriter/ThreeMFWorkspaceWriter.py index 0a915d610e..aaa590cbaf 100644 --- a/plugins/3MFWriter/ThreeMFWorkspaceWriter.py +++ b/plugins/3MFWriter/ThreeMFWorkspaceWriter.py @@ -1,3 +1,6 @@ +# Copyright (c) 2017 Ultimaker B.V. +# Cura is released under the terms of the AGPLv3 or higher. + from UM.Workspace.WorkspaceWriter import WorkspaceWriter from UM.Application import Application from UM.Preferences import Preferences @@ -42,9 +45,14 @@ class ThreeMFWorkspaceWriter(WorkspaceWriter): self._writeContainerToArchive(container, archive) # Write preferences to archive - preferences_file = zipfile.ZipInfo("Cura/preferences.cfg") + original_preferences = Preferences.getInstance() #Copy only the preferences that we use to the workspace. + temp_preferences = Preferences() + for preference in {"general/visible_settings", "cura/active_mode", "cura/categories_expanded"}: + temp_preferences.addPreference(preference, None) + temp_preferences.setValue(preference, original_preferences.getValue(preference)) preferences_string = StringIO() - Preferences.getInstance().writeToFile(preferences_string) + temp_preferences.writeToFile(preferences_string) + preferences_file = zipfile.ZipInfo("Cura/preferences.cfg") archive.writestr(preferences_file, preferences_string.getvalue()) # Save Cura version |