Commit e5f6c5d4 authored by Fabian Kosmale's avatar Fabian Kosmale

fix clazy warning: foreach

parent 07d66670
...@@ -372,7 +372,7 @@ void BackendPrivate::packageQueryFinished() ...@@ -372,7 +372,7 @@ void BackendPrivate::packageQueryFinished()
QList< Package* > result; QList< Package* > result;
// TODO: why do we append one by one here? // TODO: why do we append one by one here?
foreach (QList< Package* > res, future.results()) { foreach (const QList< Package* >& res, future.results()) {
result += res; result += res;
} }
...@@ -396,7 +396,7 @@ void BackendPrivate::orphanQueryFinished() ...@@ -396,7 +396,7 @@ void BackendPrivate::orphanQueryFinished()
sender()->deleteLater(); sender()->deleteLater();
QList< Package* > result; QList< Package* > result;
foreach (QList< Package* > res, future.results()) { foreach (const QList< Package* >& res, future.results()) {
result += res; result += res;
} }
result.removeAll(nullptr); result.removeAll(nullptr);
...@@ -423,7 +423,7 @@ void BackendPrivate::groupQueryFinished() ...@@ -423,7 +423,7 @@ void BackendPrivate::groupQueryFinished()
* avoid adding duplicates to the final list. * avoid adding duplicates to the final list.
*/ */
foreach (QList< Group* > groupList, future.results()) { foreach (const QList< Group* >& groupList, future.results()) {
foreach (Group* g, groupList) { foreach (Group* g, groupList) {
pool.group( g->name() ); pool.group( g->name() );
} }
......
...@@ -339,7 +339,7 @@ void ValidatorWorker::processNextPhase() ...@@ -339,7 +339,7 @@ void ValidatorWorker::processNextPhase()
foreach (const QString &target, op->conflictingTargets()) { foreach (const QString &target, op->conflictingTargets()) {
// if is a pkg to remove or replace skip the checks // if is a pkg to remove or replace skip the checks
bool skip = false; bool skip = false;
foreach (const QString targetRemove, targetRemovals){ foreach (const QString& targetRemove, targetRemovals){
if(targetRemove.contains(target)) skip = true; if(targetRemove.contains(target)) skip = true;
} }
if (skip) continue; if (skip) continue;
......
...@@ -89,7 +89,7 @@ void PlainReplaceOperation::run() ...@@ -89,7 +89,7 @@ void PlainReplaceOperation::run()
int filesSize = replacedpkg->retrieveFiles().size(); int filesSize = replacedpkg->retrieveFiles().size();
QMap<QString, QString> backup = replacedpkg->backupFiles(); QMap<QString, QString> backup = replacedpkg->backupFiles();
foreach (QString file, replacedpkg->retrieveFiles()) { foreach (const QString& file, replacedpkg->retrieveFiles()) {
if ((file.endsWith('/') && !QFileInfo(file).isSymLink()) || (backup.contains(file) && !backup[file].isEmpty())) { if ((file.endsWith('/') && !QFileInfo(file).isSymLink()) || (backup.contains(file) && !backup[file].isEmpty())) {
++idx; ++idx;
// It's a directory // It's a directory
......
...@@ -140,7 +140,7 @@ void PlainScriptletOperation::validate() ...@@ -140,7 +140,7 @@ void PlainScriptletOperation::validate()
void PlainScriptletOperation::slotErrors(Akabei::Error::List errs) void PlainScriptletOperation::slotErrors(Akabei::Error::List errs)
{ {
setErrors(errs); setErrors(errs);
foreach (Akabei::Error err, errs) foreach (const Akabei::Error& err, errs)
addMessage(err.description()); addMessage(err.description());
} }
......
...@@ -77,7 +77,7 @@ void FilesystemHelper::removeFiles(const QStringList& files, int processingOptio ...@@ -77,7 +77,7 @@ void FilesystemHelper::removeFiles(const QStringList& files, int processingOptio
int idx = 0; int idx = 0;
int filesSize = files.size(); int filesSize = files.size();
QStringList errors; QStringList errors;
foreach (QString file, files) { foreach (const QString& file, files) {
struct stat buffer; struct stat buffer;
int status = lstat(file.toUtf8().data(), &buffer); int status = lstat(file.toUtf8().data(), &buffer);
......
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