Skip to content

Commit

Permalink
Fix open dialog incorrectly setting whether a document is new
Browse files Browse the repository at this point in the history
  • Loading branch information
Cuperino committed Nov 21, 2024
1 parent 70bfc97 commit 07f4389
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/prompter/Prompter.qml
Original file line number Diff line number Diff line change
Expand Up @@ -1385,6 +1385,7 @@ Flickable {
//i18nc("Format name (FORMAT_EXTENSION)", "Portable Document Format (%1)", "PDF") + "(*.pdf *.PDF)",
i18nc("All file formats", "All Formats") + "(*.*)"
]
selectedNameFilter.index: 0

folder: StandardPaths.writableLocation(StandardPaths.DocumentsLocation)
fileMode: Labs.FileDialog.OpenFile
Expand All @@ -1395,11 +1396,7 @@ Flickable {
editor.resetPosition = true;
if (parseInt(prompter.state)!==Prompter.States.Editing)
prompter.state = Prompter.States.Editing;
document.isNewFile = !(nameFilters[0]===selectedNameFilter || Qt.platform.os!=="android" && nameFilters[2]===selectedNameFilter)
if (nameFilters[0]===selectedNameFilter || Qt.platform.os!=="android" && nameFilters[2]===selectedNameFilter)
document.isNewFile = false;
else
document.isNewFile = true;
document.isNewFile = !(selectedNameFilter.index===0 || Qt.platform.os!=="android" && selectedNameFilter.index===2)
}
}

Expand Down

0 comments on commit 07f4389

Please sign in to comment.