From 2ada8cec72234794c35f83825ae23a6d00bc7fe6 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Mon, 20 May 2019 13:33:14 +0200 Subject: [PATCH] Cast autosave delay preference to int Oops. How long has this been in there, you think? At least 3 years. As seen in #5729, when changing this preference it results in an error that it can't set the interval to a string. The default is an integer, so if you don't edit it it works fine, but if you edited the preferences file, it gets a string from the preferences file. Casting both to an int should work. --- cura/AutoSave.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cura/AutoSave.py b/cura/AutoSave.py index 605a1e7beb..3b42fdafdf 100644 --- a/cura/AutoSave.py +++ b/cura/AutoSave.py @@ -1,4 +1,4 @@ -# Copyright (c) 2016 Ultimaker B.V. +# Copyright (c) 2019 Ultimaker B.V. # Cura is released under the terms of the LGPLv3 or higher. from PyQt5.QtCore import QTimer @@ -16,7 +16,7 @@ class AutoSave: self._application.getPreferences().addPreference("cura/autosave_delay", 1000 * 10) self._change_timer = QTimer() - self._change_timer.setInterval(self._application.getPreferences().getValue("cura/autosave_delay")) + self._change_timer.setInterval(int(self._application.getPreferences().getValue("cura/autosave_delay"))) self._change_timer.setSingleShot(True) self._enabled = True