Browse Source

Remove unused hasMesh signal

This is logic that shouldn't be in QML anyway. It's not used by anything at this point. Let's remove it.

Contributes to issue CURA-7868.
Ghostkeeper 4 years ago
parent
commit
4b375ce2fe

+ 1 - 10
resources/qml/Cura.qml

@@ -1,4 +1,4 @@
-// Copyright (c) 2020 Ultimaker B.V.
+// Copyright (c) 2021 Ultimaker B.V.
 // Cura is released under the terms of the LGPLv3 or higher.
 
 import QtQuick 2.7
@@ -149,15 +149,6 @@ UM.MainWindow
         id: backgroundItem
         anchors.fill: parent
 
-        signal hasMesh(string name) //this signal sends the filebase name so it can be used for the JobSpecs.qml
-        function getMeshName(path)
-        {
-            //takes the path the complete path of the meshname and returns only the filebase
-            var fileName = path.slice(path.lastIndexOf("/") + 1)
-            var fileBase = fileName.slice(0, fileName.indexOf("."))
-            return fileBase
-        }
-
         //DeleteSelection on the keypress backspace event
         Keys.onPressed:
         {

+ 1 - 7
resources/qml/Dialogs/AskOpenAsProjectOrModelsDialog.qml

@@ -1,4 +1,4 @@
-// Copyright (c) 2015 Ultimaker B.V.
+// Copyright (c) 2021 Ultimaker B.V.
 // Cura is released under the terms of the LGPLv3 or higher.
 
 import QtQuick 2.2
@@ -32,30 +32,24 @@ UM.Dialog
 
     // load the entire project
     function loadProjectFile() {
-
         // update preference
         if (rememberChoiceCheckBox.checked) {
             UM.Preferences.setValue("cura/choice_on_open_project", "open_as_project")
         }
 
         UM.WorkspaceFileHandler.readLocalFile(base.fileUrl)
-        var meshName = backgroundItem.getMeshName(base.fileUrl.toString())
-        backgroundItem.hasMesh(decodeURIComponent(meshName))
 
         base.hide()
     }
 
     // load the project file as separated models
     function loadModelFiles() {
-
         // update preference
         if (rememberChoiceCheckBox.checked) {
             UM.Preferences.setValue("cura/choice_on_open_project", "open_as_model")
         }
 
         CuraApplication.readLocalFile(base.fileUrl, "open_as_model")
-        var meshName = backgroundItem.getMeshName(base.fileUrl.toString())
-        backgroundItem.hasMesh(decodeURIComponent(meshName))
 
         base.hide()
     }

+ 8 - 8
resources/qml/Dialogs/OpenFilesIncludingProjectsDialog.qml

@@ -1,4 +1,4 @@
-// Copyright (c) 2017 Ultimaker B.V.
+// Copyright (c) 2021 Ultimaker B.V.
 // Cura is released under the terms of the LGPLv3 or higher.
 
 import QtQuick 2.2
@@ -33,9 +33,6 @@ UM.Dialog
     function loadProjectFile(projectFile)
     {
         UM.WorkspaceFileHandler.readLocalFile(projectFile);
-
-        var meshName = backgroundItem.getMeshName(projectFile.toString());
-        backgroundItem.hasMesh(decodeURIComponent(meshName));
     }
 
     function loadModelFiles(fileUrls)
@@ -44,9 +41,6 @@ UM.Dialog
         {
             CuraApplication.readLocalFile(fileUrls[i], "open_as_model");
         }
-
-        var meshName = backgroundItem.getMeshName(fileUrls[0].toString());
-        backgroundItem.hasMesh(decodeURIComponent(meshName));
     }
 
     Column
@@ -108,5 +102,11 @@ UM.Dialog
                 }
             }
         }
+
+        UM.I18nCatalog
+        {
+            id: catalog
+            name: "cura"
+        }
     }
-}
+}

+ 2 - 8
resources/qml/Menus/RecentFilesMenu.qml

@@ -1,4 +1,4 @@
-// Copyright (c) 2016 Ultimaker B.V.
+// Copyright (c) 2021 Ultimaker B.V.
 // Cura is released under the terms of the LGPLv3 or higher.
 
 import QtQuick 2.2
@@ -27,13 +27,7 @@ Menu
                 var path = decodeURIComponent(modelData.toString())
                 return (index + 1) + ". " + path.slice(path.lastIndexOf("/") + 1);
             }
-            onTriggered:
-            {
-                CuraApplication.readLocalFile(modelData);
-
-                var meshName = backgroundItem.getMeshName(modelData.toString())
-                backgroundItem.hasMesh(decodeURIComponent(meshName))
-            }
+            onTriggered: CuraApplication.readLocalFile(modelData)
         }
         onObjectAdded: menu.insertItem(index, object)
         onObjectRemoved: menu.removeItem(object)