summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/corelib/io/qfilesystemengine_unix.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/corelib/io/qfilesystemengine_unix.cpp b/src/corelib/io/qfilesystemengine_unix.cpp
index a3d71aeeab..cf33dde975 100644
--- a/src/corelib/io/qfilesystemengine_unix.cpp
+++ b/src/corelib/io/qfilesystemengine_unix.cpp
@@ -1193,8 +1193,10 @@ static QString freeDesktopTrashLocation(const QString &sourcePath)
| QFileDevice::ExeOwner;
QString targetDir = topDir.filePath(trashDir);
// deliberately not using mkpath, since we want to fail if topDir doesn't exist
- if (topDir.mkdir(trashDir))
- QFile::setPermissions(targetDir, ownerPerms);
+ bool created = QFileSystemEngine::createDirectory(QFileSystemEntry(targetDir), false, ownerPerms);
+ if (created)
+ return targetDir;
+ // maybe it already exists and is a directory
if (QFileInfo(targetDir).isDir())
return targetDir;
return QString();