X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/8679115552ec65ccfc6cbc1db68414d80e3a081b..c68f1f6f8d6c24123c9c5df4d2e91a9d2462ceb6:/src/tests/testdir.cpp diff --git a/src/tests/testdir.cpp b/src/tests/testdir.cpp index b84b344b7..5d75a5343 100644 --- a/src/tests/testdir.cpp +++ b/src/tests/testdir.cpp @@ -1,26 +1,11 @@ -/***************************************************************************** - * 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 + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ #include "testdir.h" -#include - #ifdef Q_OS_UNIX #include #else @@ -46,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(path.utf16()), &utbuf); #endif @@ -76,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); } } @@ -96,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); } }