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>
This commit is contained in:
Robert C. Helling 2014-08-02 22:52:46 +02:00 committed by Dirk Hohndel
parent 6c15647858
commit a7eb316b1f

View file

@ -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));
}
}