Commit 8e61e2a5 authored by Laurent Montel's avatar Laurent Montel 😁

Port Q_FOREACH

parent 9b049902
......@@ -104,7 +104,7 @@ void MigrateApplicationFilesTest::shouldMigrateFolders()
QStringList files;
files << QStringLiteral("file1") << QStringLiteral("file2");
const QString xdgDatahome = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QLatin1Char('/') + folderName;
Q_FOREACH (const QString &file, files) {
for (const QString &file : qAsConst(files)) {
QFile fooFile(QLatin1String(MIGRATION_DATA_DIR) + QLatin1Char('/') + file);
QVERIFY(fooFile.exists());
const QString storedConfigFilePath = appsPath + QLatin1Char('/') + file;
......@@ -126,7 +126,7 @@ void MigrateApplicationFilesTest::shouldMigrateFolders()
QVERIFY(migrate.checkIfNecessary());
QVERIFY(migrate.start());
Q_FOREACH (const QString &file, files) {
for (const QString &file : qAsConst(files)) {
QVERIFY(QFile(xdgDatahome + file).exists());
}
}
......@@ -147,7 +147,7 @@ void MigrateApplicationFilesTest::shouldNotMigrateFoldersIfAlreadyDone()
QStringList files;
files << QStringLiteral("file1") << QStringLiteral("file2");
const QString xdgDatahome = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QLatin1Char('/') + folderName;
Q_FOREACH (const QString &file, files) {
for (const QString &file : qAsConst(files)) {
QFile fooFile(QLatin1String(MIGRATION_DATA_DIR) + QLatin1Char('/') + file);
QVERIFY(fooFile.exists());
const QString storedConfigFilePath = appsPath + QLatin1Char('/') + file;
......@@ -171,7 +171,7 @@ void MigrateApplicationFilesTest::shouldNotMigrateFoldersIfAlreadyDone()
migrate.insertMigrateInfo(info);
QVERIFY(migrate.start());
Q_FOREACH (const QString &file, files) {
for (const QString &file : qAsConst(files)) {
QVERIFY(!QFile(xdgDatahome + file).exists());
}
}
......@@ -192,7 +192,7 @@ void MigrateApplicationFilesTest::shouldMigrateFoldersWithSubFolders()
QStringList files;
files << QStringLiteral("file1") << QStringLiteral("file2");
const QString xdgDatahome = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QLatin1Char('/') + folderName;
Q_FOREACH (const QString &file, files) {
for (const QString &file : qAsConst(files)) {
QFile fooFile(QLatin1String(MIGRATION_DATA_DIR) + QLatin1Char('/') + file);
QVERIFY(fooFile.exists());
const QString storedConfigFilePath = appsPath + QLatin1Char('/') + file;
......@@ -208,7 +208,7 @@ void MigrateApplicationFilesTest::shouldMigrateFoldersWithSubFolders()
QDir().mkpath(appsPathSubfolder);
QVERIFY(QDir(appsPathSubfolder).exists());
const QString xdgDatahomeSubfolder = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QLatin1Char('/') + subFolder;
Q_FOREACH (const QString &file, files) {
for (const QString &file : qAsConst(files)) {
QFile fooFile(QLatin1String(MIGRATION_DATA_DIR) + QLatin1Char('/') + file);
QVERIFY(fooFile.exists());
const QString storedConfigFilePath = appsPathSubfolder + QLatin1Char('/') + file;
......@@ -232,7 +232,7 @@ void MigrateApplicationFilesTest::shouldMigrateFoldersWithSubFolders()
migrate.setCurrentConfigVersion(1);
QVERIFY(migrate.start());
Q_FOREACH (const QString &file, files) {
for (const QString &file : qAsConst(files)) {
QVERIFY(QFile(xdgDatahome + file).exists());
QVERIFY(QFile(xdgDatahomeSubfolder + file).exists());
}
......@@ -255,7 +255,7 @@ void MigrateApplicationFilesTest::shouldNotMigrateIfAlreadyDone()
QStringList files;
files << QStringLiteral("file1") << QStringLiteral("file2");
Q_FOREACH (const QString &file, files) {
for (const QString &file : qAsConst(files)) {
QFile fooFile(QLatin1String(MIGRATION_DATA_DIR) + QLatin1Char('/') + file);
QVERIFY(fooFile.exists());
const QString storedConfigFilePath = appsPath + QLatin1Char('/') + file;
......@@ -283,7 +283,7 @@ void MigrateApplicationFilesTest::shouldNotMigrateIfAlreadyDone()
//We have a current version == 3 => don't migrate old info.
migrate.setCurrentConfigVersion(3);
QVERIFY(migrate.start());
Q_FOREACH (const QString &file, files) {
for (const QString &file : qAsConst(files)) {
QVERIFY(!QFile(xdgDatahome + file).exists());
}
}
......@@ -305,7 +305,7 @@ void MigrateApplicationFilesTest::shouldMigrateFiles()
QStringList files;
files << QStringLiteral("file1") << QStringLiteral("file2");
Q_FOREACH (const QString &file, files) {
for (const QString &file : qAsConst(files)) {
QFile fooFile(QLatin1String(MIGRATION_DATA_DIR) + QLatin1Char('/') + file);
QVERIFY(fooFile.exists());
const QString storedConfigFilePath = appsPath + QLatin1Char('/') + file;
......@@ -330,7 +330,7 @@ void MigrateApplicationFilesTest::shouldMigrateFiles()
QVERIFY(migrate.checkIfNecessary());
QVERIFY(migrate.start());
Q_FOREACH (const QString &file, files) {
for (const QString &file : qAsConst(files)) {
QVERIFY(QFile(xdgDatahome + file).exists());
}
}
......@@ -357,7 +357,7 @@ void MigrateApplicationFilesTest::shouldMigrateFilesWithPattern()
filesMustNotBeMigrated << QStringLiteral("file1") << QStringLiteral("file2");
files << filesMustBeMigrated << filesMustNotBeMigrated;
Q_FOREACH (const QString &file, files) {
for (const QString &file : qAsConst(files)) {
QFile fooFile(QLatin1String(MIGRATION_DATA_DIR) + QLatin1Char('/') + file);
QVERIFY(fooFile.exists());
const QString storedConfigFilePath = appsPath + QLatin1Char('/') + file;
......@@ -380,10 +380,10 @@ void MigrateApplicationFilesTest::shouldMigrateFilesWithPattern()
QVERIFY(migrate.checkIfNecessary());
QVERIFY(migrate.start());
Q_FOREACH (const QString &file, filesMustBeMigrated) {
for (const QString &file : qAsConst(filesMustBeMigrated)) {
QVERIFY(QFile(xdgDatahome + file).exists());
}
Q_FOREACH (const QString &file, filesMustNotBeMigrated) {
for (const QString &file : qAsConst(filesMustNotBeMigrated)) {
QVERIFY(!QFile(xdgDatahome + file).exists());
}
}
......
......@@ -89,7 +89,7 @@ void PluginInterface::createPluginInterface()
qCWarning(PIMCOMMONAKONADI_LOG) << "Missing action collection";
return;
}
Q_FOREACH (PimCommon::GenericPlugin *plugin, d->mGenericPluginManager->pluginsList()) {
for (PimCommon::GenericPlugin *plugin : d->mGenericPluginManager->pluginsList()) {
if (plugin->isEnabled()) {
PimCommon::GenericPluginInterface *interface = static_cast<PimCommon::GenericPluginInterface *>(plugin->createInterface(this));
interface->setParentWidget(d->mParentWidget);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment