diff options
author | Kai Köhne <kai.koehne@qt.io> | 2021-06-13 14:28:53 +0200 |
---|---|---|
committer | Kai Köhne <kai.koehne@qt.io> | 2021-06-21 13:39:50 +0200 |
commit | 0fd4f2a8def276aab0cb6465ba7b9ce75beb3a86 (patch) | |
tree | 8b487cfa1f4186b4e86f1305a83a66186b30c654 /examples/assistant/simpletextviewer/findfiledialog.cpp | |
parent | 6db694453636a0f7b8c4f51048f352da80d912d2 (diff) |
Examples: Don't use QDir::separator() in internal paths
Documentation says:
You do not need to use this function to build file paths.
If you always use "/", Qt will translate your paths to conform
to the underlying operating system.
Change-Id: Iba62a197821b9abc819c3d333e44c9f1ed989898
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
(cherry picked from commit 8329ec476b3dc9bb7ffd17ee724b6b21c17e90ec)
Diffstat (limited to 'examples/assistant/simpletextviewer/findfiledialog.cpp')
-rw-r--r-- | examples/assistant/simpletextviewer/findfiledialog.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/assistant/simpletextviewer/findfiledialog.cpp b/examples/assistant/simpletextviewer/findfiledialog.cpp index 1eab5ad7f..51b184075 100644 --- a/examples/assistant/simpletextviewer/findfiledialog.cpp +++ b/examples/assistant/simpletextviewer/findfiledialog.cpp @@ -112,9 +112,9 @@ void FindFileDialog::openFile() return; QString fileName = item->text(0); - QString path = directoryComboBox->currentText() + QDir::separator(); + QString path = QDir(directoryComboBox->currentText()).filePath(fileName); - currentEditor->setContents(path + fileName); + currentEditor->setContents(path); close(); } |