Fix: filenames cut by first dot, remove only file extension because file might have dot in name

CURA-5323
This commit is contained in:
Aleksei S 2018-05-02 17:17:45 +02:00
parent 24684d5d9c
commit b1c9b04a7a
2 changed files with 9 additions and 14 deletions

View file

@ -335,8 +335,15 @@ class PrintInformation(QObject):
# name is "" when I first had some meshes and afterwards I deleted them so the naming should start again
is_empty = name == ""
if is_gcode or is_project_file or (is_empty or (self._base_name == "" and self._base_name != name)):
# Only take the file name part
# Only take the file name part, Note : file name might have 'dot' in name as well
if is_project_file:
self._base_name = ".".join(filename_parts)
elif len(filename_parts) > 1:
self._base_name = ".".join(filename_parts[0:-1])
else:
self._base_name = filename_parts[0]
self._updateJobName()
@pyqtProperty(str, fset = setBaseName, notify = baseNameChanged)

View file

@ -19,18 +19,6 @@ Item {
height: childrenRect.height
Connections
{
target: backgroundItem
onHasMesh:
{
if (PrintInformation.baseName == "")
{
PrintInformation.baseName = name;
}
}
}
onActivityChanged: {
if (activity == false) {
//When there is no mesh in the buildplate; the printJobTextField is set to an empty string so it doesn't set an empty string as a jobName (which is later used for saving the file)