diff options
author | Robert C. Helling <helling@atdotde.de> | 2014-08-02 22:52:46 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-08-02 15:11:43 -0700 |
commit | a7eb316b1f8270500f608293cc40c29fde3056dc (patch) | |
tree | 1750e7dbe9a1784e9b87b008ba3149b0d1968da5 /qt-ui/mainwindow.cpp | |
parent | 6c15647858e866d1366de57f49e52a4a2b69aa0f (diff) | |
download | subsurface-a7eb316b1f8270500f608293cc40c29fde3056dc.tar.gz |
In recent files use native directory separators
Qt internally always uses / as directory separator. #651 shows that in the recent
files menu, under windows we can have double entries with both versions of the
separator. This patch should normalize the menu entires to use the native separator
(i.e. \ on Windows). (Untested due to lack of Windows computer).
See #651
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/mainwindow.cpp')
-rw-r--r-- | qt-ui/mainwindow.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp index bbee51b8b..fece00848 100644 --- a/qt-ui/mainwindow.cpp +++ b/qt-ui/mainwindow.cpp @@ -970,7 +970,7 @@ void MainWindow::addRecentFile(const QStringList &newFiles) } foreach (const QString &file, newFiles) { - int index = files.indexOf(file); + int index = files.indexOf(QDir::toNativeSeparators(file)); if (index >= 0) { files.removeAt(index); @@ -979,7 +979,7 @@ void MainWindow::addRecentFile(const QStringList &newFiles) foreach (const QString &file, newFiles) { if (QFile::exists(file)) { - files.prepend(file); + files.prepend(QDir::toNativeSeparators(file)); } } |