]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/tests/testdir.cpp
Merge branch 'release/21.12'
[dolphin.git] / src / tests / testdir.cpp
index de81378d844aee45464cef8ae6f6dcb91233a7d2..5d75a5343baaef7175b75993f4217e7b3b608b39 100644 (file)
@@ -1,21 +1,8 @@
-/*****************************************************************************
- *   Copyright (C) 2010-2011 by Frank Reininghaus (frank78ac@googlemail.com) *
- *                                                                           *
- *   This program is free software; you can redistribute it and/or modify    *
- *   it under the terms of the GNU General Public License as published by    *
- *   the Free Software Foundation; either version 2 of the License, or       *
- *   (at your option) any later version.                                     *
- *                                                                           *
- *   This program is distributed in the hope that it will be useful,         *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of          *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the           *
- *   GNU General Public License for more details.                            *
- *                                                                           *
- *   You should have received a copy of the GNU General Public License       *
- *   along with this program; if not, write to the                           *
- *   Free Software Foundation, Inc.,                                         *
- *   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA              *
- *****************************************************************************/
+/*
+ *   SPDX-FileCopyrightText: 2010-2011 Frank Reininghaus <frank78ac@googlemail.com>
+ *
+ *   SPDX-License-Identifier: GPL-2.0-or-later
+ */
 
 #include "testdir.h"
 
@@ -44,12 +31,12 @@ static void setTimeStamp(const QString& path, const QDateTime& mtime)
 {
 #ifdef Q_OS_UNIX
     struct utimbuf utbuf;
-    utbuf.actime = mtime.toTime_t();
+    utbuf.actime = mtime.toSecsSinceEpoch();
     utbuf.modtime = utbuf.actime;
     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<const wchar_t *>(path.utf16()), &utbuf);
 #endif
@@ -74,7 +61,7 @@ void TestDir::createFile(const QString& path, const QByteArray& data, const QDat
 
 void TestDir::createFiles(const QStringList& files)
 {
-    foreach (const QString& path, files) {
+    for (const QString& path : files) {
         createFile(path);
     }
 }
@@ -94,7 +81,7 @@ void TestDir::createDir(const QString& path, const QDateTime& time)
 
 void TestDir::removeFiles(const QStringList& files)
 {
-    foreach (const QString& path, files) {
+    for (const QString& path : files) {
         removeFile(path);
     }
 }