mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-11 02:49:03 +08:00
Add check if resulting profile is empty
If it is, a warning is logged. Contributes to issue CURA-37.
This commit is contained in:
parent
e7b2586d36
commit
f09b927288
@ -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
|
Loading…
x
Reference in New Issue
Block a user