Commit e5f6c5d4 authored by Fabian Kosmale's avatar Fabian Kosmale

fix clazy warning: foreach

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