[ui] fix warnings for undefined _reconstruction.graph

This commit is contained in:
Fabien Castan 2020-03-04 19:05:38 +01:00
parent eae0f4b1f4
commit 7d0f1ec05f

View file

@ -24,7 +24,7 @@ ApplicationWindow {
readonly property bool graphLocked: _reconstruction.computing && GraphEditorSettings.lockOnCompute readonly property bool graphLocked: _reconstruction.computing && GraphEditorSettings.lockOnCompute
title: { title: {
var t = _reconstruction.graph.filepath || "Untitled" var t = (_reconstruction.graph && _reconstruction.graph.filepath) ? _reconstruction.graph.filepath : "Untitled"
if(!_reconstruction.undoStack.clean) if(!_reconstruction.undoStack.clean)
t += "*" t += "*"
t += " - " + Qt.application.name + " " + Qt.application.version t += " - " + Qt.application.name + " " + Qt.application.version
@ -323,7 +323,7 @@ ApplicationWindow {
id: saveAction id: saveAction
text: "Save" text: "Save"
shortcut: "Ctrl+S" shortcut: "Ctrl+S"
enabled: !_reconstruction.graph.filepath || !_reconstruction.undoStack.clean enabled: (_reconstruction.graph && !_reconstruction.graph.filepath) || !_reconstruction.undoStack.clean
onTriggered: _reconstruction.graph.filepath ? _reconstruction.save() : saveFileDialog.open() onTriggered: _reconstruction.graph.filepath ? _reconstruction.save() : saveFileDialog.open()
} }
Action { Action {