From 93cdce7b3360b2b285ca32f8b7cf7ba7522381a9 Mon Sep 17 00:00:00 2001 From: Thomas Karl Pietrowski Date: Fri, 24 Jun 2016 16:01:47 +0200 Subject: [PATCH] GCodeProfileReader: Fixing read of profiles from GCode --- plugins/GCodeProfileReader/GCodeProfileReader.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/GCodeProfileReader/GCodeProfileReader.py b/plugins/GCodeProfileReader/GCodeProfileReader.py index 5915395005..1ce1473582 100644 --- a/plugins/GCodeProfileReader/GCodeProfileReader.py +++ b/plugins/GCodeProfileReader/GCodeProfileReader.py @@ -75,15 +75,16 @@ class GCodeProfileReader(ProfileReader): # Create an empty profile - the id will be changed later profile = InstanceContainer("") - profile.addMetaDataEntry("type", "quality") try: profile.deserialize(serialized) except Exception as e: # Not a valid g-code file. Logger.log("e", "Unable to serialise the profile: %s", str(e)) return None + profile.addMetaDataEntry("type", "quality") + #Creating a unique name using the filename of the GCode - new_name = catalog.i18nc("@label", "Custom profile (%s)") %(os.path.splitext(os.path.basename(file_name))[0]) + new_name = catalog.i18nc("@label", "G-Code-imported profile") profile.setName(new_name) profile._id = new_name