Save settings before moving config file on Linux

This commit is contained in:
ChrisTerBeke 2018-05-22 17:45:30 +02:00
parent dd581b59e4
commit 2bbcb2dd7d

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)