From 4b375ce2fe70815ba2e07024c132b2bd11e1c226 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Mon, 4 Jan 2021 15:19:17 +0100 Subject: [PATCH] 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. --- resources/qml/Cura.qml | 11 +---------- .../Dialogs/AskOpenAsProjectOrModelsDialog.qml | 8 +------- .../Dialogs/OpenFilesIncludingProjectsDialog.qml | 16 ++++++++-------- resources/qml/Menus/RecentFilesMenu.qml | 10 ++-------- 4 files changed, 12 insertions(+), 33 deletions(-) diff --git a/resources/qml/Cura.qml b/resources/qml/Cura.qml index 9f24d91caf..bb7b5ac19c 100644 --- a/resources/qml/Cura.qml +++ b/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: { diff --git a/resources/qml/Dialogs/AskOpenAsProjectOrModelsDialog.qml b/resources/qml/Dialogs/AskOpenAsProjectOrModelsDialog.qml index 8cdaeea5fa..68f58616f1 100644 --- a/resources/qml/Dialogs/AskOpenAsProjectOrModelsDialog.qml +++ b/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() } diff --git a/resources/qml/Dialogs/OpenFilesIncludingProjectsDialog.qml b/resources/qml/Dialogs/OpenFilesIncludingProjectsDialog.qml index 187578f12c..62cded866c 100644 --- a/resources/qml/Dialogs/OpenFilesIncludingProjectsDialog.qml +++ b/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" + } } -} +} \ No newline at end of file diff --git a/resources/qml/Menus/RecentFilesMenu.qml b/resources/qml/Menus/RecentFilesMenu.qml index 9de523280c..de6d2e3817 100644 --- a/resources/qml/Menus/RecentFilesMenu.qml +++ b/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)