summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/corelib/io/qfilesystemengine_symbian.cpp11
-rw-r--r--tests/auto/qdir/tst_qdir.cpp6
2 files changed, 15 insertions, 2 deletions
diff --git a/src/corelib/io/qfilesystemengine_symbian.cpp b/src/corelib/io/qfilesystemengine_symbian.cpp
index 9eabdc1..edbe945 100644
--- a/src/corelib/io/qfilesystemengine_symbian.cpp
+++ b/src/corelib/io/qfilesystemengine_symbian.cpp
@@ -237,12 +237,19 @@ bool QFileSystemEngine::createDirectory(const QFileSystemEntry &entry, bool crea
if (!abspath.endsWith(QLatin1Char('\\')))
abspath.append(QLatin1Char('\\'));
TInt r;
+ TPtrC symPath(qt_QString2TPtrC(abspath));
if (createParents)
- r = qt_s60GetRFs().MkDirAll(qt_QString2TPtrC(abspath));
+ r = qt_s60GetRFs().MkDirAll(symPath);
else
- r = qt_s60GetRFs().MkDir(qt_QString2TPtrC(abspath));
+ r = qt_s60GetRFs().MkDir(symPath);
if (createParents && r == KErrAlreadyExists)
return true; //# Qt5 - QDir::mkdir returns false for existing dir, QDir::mkpath returns true (should be made consistent in Qt 5)
+ if (createParents && r == KErrPermissionDenied) {
+ // check for already exists, which is not returned from RFs when it denies permission
+ TEntry entry;
+ if (qt_s60GetRFs().Entry(symPath, entry) == KErrNone)
+ r = KErrNone;
+ }
return (r == KErrNone);
}
diff --git a/tests/auto/qdir/tst_qdir.cpp b/tests/auto/qdir/tst_qdir.cpp
index c507037..56862a8 100644
--- a/tests/auto/qdir/tst_qdir.cpp
+++ b/tests/auto/qdir/tst_qdir.cpp
@@ -299,6 +299,12 @@ void tst_QDir::mkdir_data()
QDir dir;
for (int i = 0; i < dirs.count(); ++i)
dir.rmpath(dirs.at(i));
+
+#ifdef Q_OS_SYMBIAN
+ // testing for directories that exist, but which we cannot necessarily create
+ QTest::newRow("symbian0") << QString::fromLatin1("C:/private") << true;
+ QTest::newRow("symbian1") << QString::fromLatin1("C:/private/E0340002") << true;
+#endif
}
void tst_QDir::mkdir()