X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/caf49dafa557caa9bd985702a240284348c82b40..a2c9c05de2dfabbb2bb614390c8e03023dad2bd1:/src/tests/testdir.cpp diff --git a/src/tests/testdir.cpp b/src/tests/testdir.cpp index c05752171..6fbc4c426 100644 --- a/src/tests/testdir.cpp +++ b/src/tests/testdir.cpp @@ -36,7 +36,7 @@ static void setTimeStamp(const QString& path, const QDateTime& mtime) utime(QFile::encodeName(path), &utbuf); #elif defined(Q_OS_WIN) struct _utimbuf utbuf; - utbuf.actime = mtime.toTime_t(); + utbuf.actime = mtime.toSecsSinceEpoch(); utbuf.modtime = utbuf.actime; _wutime(reinterpret_cast(path.utf16()), &utbuf); #endif @@ -96,6 +96,17 @@ void TestDir::removeFile(const QString& path) QFile::remove(absolutePath); } +void TestDir::removeDir(const QString& path) +{ + QString absolutePath = path; + QFileInfo fileInfo(absolutePath); + if (!fileInfo.isAbsolute()) { + absolutePath = TestDir::path() + QLatin1Char('/') + path; + } + QDir dirToRemove = QDir(absolutePath); + dirToRemove.removeRecursively(); +} + void TestDir::makePathAbsoluteAndCreateParents(QString& path) { QFileInfo fileInfo(path);