From f09b92728860a3ae4c29ebf07222aeb40667e0bf Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 26 Jan 2016 13:58:00 +0100 Subject: [PATCH] Add check if resulting profile is empty If it is, a warning is logged. Contributes to issue CURA-37. --- plugins/LegacyProfileReader/LegacyProfileReader.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugins/LegacyProfileReader/LegacyProfileReader.py b/plugins/LegacyProfileReader/LegacyProfileReader.py index bd38b50a84..6b5a4a3aca 100644 --- a/plugins/LegacyProfileReader/LegacyProfileReader.py +++ b/plugins/LegacyProfileReader/LegacyProfileReader.py @@ -63,6 +63,7 @@ class LegacyProfileReader(ProfileReader): # file could not be read or didn't contain a valid profile, \code None # \endcode is returned. def read(self, file_name): + Logger.log("i", "Importing legacy profile from file " + file_name + ".") profile = Profile(machine_manager = Application.getInstance().getMachineManager(), read_only = False) #Create an empty profile. profile.setName("Imported Legacy Profile") @@ -120,4 +121,7 @@ class LegacyProfileReader(ProfileReader): if new_value != value_using_defaults and profile.getSettingValue(new_setting) != new_value: #Not equal to the default in the new Cura OR the default in the legacy Cura. profile.setSettingValue(new_setting, new_value) #Store the setting in the profile! + if len(profile.getChangedSettings()) == 0: + Logger.log("i", "A legacy profile was imported but everything evaluates to the defaults, creating an empty profile.") + return profile \ No newline at end of file