Defensive coding: Old file-extensions may have been saved as all-caps. [CURA-5896]

This commit is contained in:
Remco Burema 2018-11-06 17:16:29 +01:00
parent 3db85b2493
commit 94924783b6

View file

@ -371,12 +371,12 @@ class PrintInformation(QObject):
# Strip the old "curaproject" extension from the name
OLD_CURA_PROJECT_EXT = ".curaproject"
if self._base_name.endswith(OLD_CURA_PROJECT_EXT):
if self._base_name.lower().endswith(OLD_CURA_PROJECT_EXT):
self._base_name = self._base_name[:len(self._base_name) - len(OLD_CURA_PROJECT_EXT)]
# CURA-5896 Try to strip extra extensions with an infinite amount of ".curaproject.3mf".
OLD_CURA_PROJECT_3MF_EXT = ".curaproject.3mf"
while self._base_name.endswith(OLD_CURA_PROJECT_3MF_EXT):
while self._base_name.lower().endswith(OLD_CURA_PROJECT_3MF_EXT):
self._base_name = self._base_name[:len(self._base_name) - len(OLD_CURA_PROJECT_3MF_EXT)]
self._updateJobName()