summaryrefslogtreecommitdiff
path: root/src/corelib/io/qfsfileengine_unix.cpp
diff options
context:
space:
mode:
authorThomas Zander <t.zander@nokia.com>2010-09-03 09:37:43 +0200
committerThomas Zander <t.zander@nokia.com>2010-09-03 09:37:43 +0200
commit5b76ea63f5dba0a6b427d9d4dbcb7be6d7afeeec (patch)
treedea856ab744d35dd0ae40b7d707696a3db3f41b0 /src/corelib/io/qfsfileengine_unix.cpp
parente6747da757b4daba1fc17db9902a9c39b426455f (diff)
downloadqt4-tools-5b76ea63f5dba0a6b427d9d4dbcb7be6d7afeeec.tar.gz
Move rmdir code to createDirectory for unix'
migrate the QFSFileEngine::rmdir code to QFileSystemEngine::removeDirectory and make the former call the latter. Reviewed-by: João Abecasis
Diffstat (limited to 'src/corelib/io/qfsfileengine_unix.cpp')
-rw-r--r--src/corelib/io/qfsfileengine_unix.cpp23
1 files changed, 1 insertions, 22 deletions
diff --git a/src/corelib/io/qfsfileengine_unix.cpp b/src/corelib/io/qfsfileengine_unix.cpp
index c20d6ae78d..50b18fc94d 100644
--- a/src/corelib/io/qfsfileengine_unix.cpp
+++ b/src/corelib/io/qfsfileengine_unix.cpp
@@ -497,28 +497,7 @@ bool QFSFileEngine::mkdir(const QString &name, bool createParentDirectories) con
bool QFSFileEngine::rmdir(const QString &name, bool recurseParentDirectories) const
{
- QString dirName = name;
- if (recurseParentDirectories) {
- dirName = QDir::cleanPath(dirName);
-#if defined(Q_OS_SYMBIAN)
- dirName = QDir::toNativeSeparators(dirName);
-#endif
- for(int oldslash = 0, slash=dirName.length(); slash > 0; oldslash = slash) {
- QByteArray chunk = QFile::encodeName(dirName.left(slash));
- QT_STATBUF st;
- if (QT_STAT(chunk, &st) != -1) {
- if ((st.st_mode & S_IFMT) != S_IFDIR)
- return false;
- if (::rmdir(chunk) != 0)
- return oldslash != 0;
- } else {
- return false;
- }
- slash = dirName.lastIndexOf(QDir::separator(), oldslash-1);
- }
- return true;
- }
- return ::rmdir(QFile::encodeName(dirName)) == 0;
+ return QFileSystemEngine::removeDirectory(QFileSystemEntry(name), recurseParentDirectories);
}
bool QFSFileEngine::caseSensitive() const