Merge branch 'feature-backup-manager' of https://github.com/Ultimaker/Cura into feature-backup-manager

* 'feature-backup-manager' of https://github.com/Ultimaker/Cura:
  Save settings before moving config file on Linux
This commit is contained in:
ChrisTerBeke 2018-05-22 19:03:14 +02:00
commit 2c896010c7
No known key found for this signature in database
GPG Key ID: A49F1AB9D7E0C263

View File

@ -43,6 +43,9 @@ class Backup:
Logger.log("d", "Creating backup for Cura %s, using folder %s", cura_release, version_data_dir)
# Ensure all current settings are saved.
CuraApplication.getInstance().saveSettings()
# We copy the preferences file to the user data directory in Linux as it's in a different location there.
# When restoring a backup on Linux, we move it back.
if Platform.isLinux():
@ -52,9 +55,6 @@ class Backup:
Logger.log("d", "Copying preferences file from %s to %s", preferences_file, backup_preferences_file)
shutil.copyfile(preferences_file, backup_preferences_file)
# Ensure all current settings are saved.
CuraApplication.getInstance().saveSettings()
# Create an empty buffer and write the archive to it.
buffer = io.BytesIO()
archive = self._makeArchive(buffer, version_data_dir)