[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
title: {
var t = _reconstruction.graph.filepath || "Untitled"
var t = (_reconstruction.graph && _reconstruction.graph.filepath) ? _reconstruction.graph.filepath : "Untitled"
if(!_reconstruction.undoStack.clean)
t += "*"
t += " - " + Qt.application.name + " " + Qt.application.version
@ -323,7 +323,7 @@ ApplicationWindow {
id: saveAction
text: "Save"
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()
}
Action {