summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/corelib/io/qstandardpaths_win.cpp4
-rw-r--r--tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp14
2 files changed, 16 insertions, 2 deletions
diff --git a/src/corelib/io/qstandardpaths_win.cpp b/src/corelib/io/qstandardpaths_win.cpp
index 478db6c299..d4e0779381 100644
--- a/src/corelib/io/qstandardpaths_win.cpp
+++ b/src/corelib/io/qstandardpaths_win.cpp
@@ -160,10 +160,10 @@ QString QStandardPaths::writableLocation(StandardLocation type)
// Although Microsoft has a Cache key it is a pointer to IE's cache, not a cache
// location for everyone. Most applications seem to be using a
// cache directory located in their AppData directory
- return writableLocation(DataLocation) + QLatin1String("\\cache");
+ return writableLocation(DataLocation) + QLatin1String("/cache");
case GenericCacheLocation:
- return writableLocation(GenericDataLocation) + QLatin1String("\\cache");
+ return writableLocation(GenericDataLocation) + QLatin1String("/cache");
case RuntimeLocation:
case HomeLocation:
diff --git a/tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp b/tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp
index c4453fd5f2..f94c8eac4f 100644
--- a/tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp
+++ b/tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp
@@ -45,6 +45,7 @@
#include <qstandardpaths.h>
#include <qfileinfo.h>
#include <qsysinfo.h>
+#include <qregexp.h>
#ifdef Q_OS_UNIX
#include <unistd.h>
@@ -72,6 +73,7 @@ private slots:
void testCustomRuntimeDirectory();
void testAllWritableLocations_data();
void testAllWritableLocations();
+ void testCleanPath();
private:
#ifdef Q_XDG_PLATFORM
@@ -430,6 +432,18 @@ void tst_qstandardpaths::testAllWritableLocations()
QCOMPARE(loc.endsWith(QLatin1Char('/')), false);
}
+void tst_qstandardpaths::testCleanPath()
+{
+ const QRegExp filter(QStringLiteral("\\\\"));
+ QVERIFY(filter.isValid());
+ for (int i = 0; i <= QStandardPaths::GenericCacheLocation; ++i) {
+ const QStringList paths = QStandardPaths::standardLocations(QStandardPaths::StandardLocation(i));
+ QVERIFY2(paths.filter(filter).isEmpty(),
+ qPrintable(QString::fromLatin1("Backslash found in %1 %2")
+ .arg(i).arg(paths.join(QLatin1Char(',')))));
+ }
+}
+
QTEST_MAIN(tst_qstandardpaths)
#include "tst_qstandardpaths.moc"