Skip to content

Commit 07f4389

Browse files
committed
Fix open dialog incorrectly setting whether a document is new
1 parent 70bfc97 commit 07f4389

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/prompter/Prompter.qml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1385,6 +1385,7 @@ Flickable {
13851385
//i18nc("Format name (FORMAT_EXTENSION)", "Portable Document Format (%1)", "PDF") + "(*.pdf *.PDF)",
13861386
i18nc("All file formats", "All Formats") + "(*.*)"
13871387
]
1388+
selectedNameFilter.index: 0
13881389

13891390
folder: StandardPaths.writableLocation(StandardPaths.DocumentsLocation)
13901391
fileMode: Labs.FileDialog.OpenFile
@@ -1395,11 +1396,7 @@ Flickable {
13951396
editor.resetPosition = true;
13961397
if (parseInt(prompter.state)!==Prompter.States.Editing)
13971398
prompter.state = Prompter.States.Editing;
1398-
document.isNewFile = !(nameFilters[0]===selectedNameFilter || Qt.platform.os!=="android" && nameFilters[2]===selectedNameFilter)
1399-
if (nameFilters[0]===selectedNameFilter || Qt.platform.os!=="android" && nameFilters[2]===selectedNameFilter)
1400-
document.isNewFile = false;
1401-
else
1402-
document.isNewFile = true;
1399+
document.isNewFile = !(selectedNameFilter.index===0 || Qt.platform.os!=="android" && selectedNameFilter.index===2)
14031400
}
14041401
}
14051402

0 commit comments

Comments
 (0)