Commit 47fb4d4e authored by Fabian Kosmale's avatar Fabian Kosmale Committed by Fabian Kosmale

fix clazy warning: qstring-arg

parent e1784cbd
......@@ -106,19 +106,19 @@ QString Delta::xdeltaApplyCommand(const QString& pathToDest) const
QString retstring;
if (d->pathToDelta.endsWith(".gz")) {
retstring = QString("xdelta3 -d -q -R -c -s %1 %2 | gzip -n > %3")
.arg(d->pathToOldFile)
.arg(d->pathToDelta)
.arg(pathToDest);
retstring = QString("xdelta3 -d -q -R -c -s %1 %2 | gzip -n > %3").arg(
d->pathToOldFile,
d->pathToDelta,
pathToDest);
} else {
ArchiveHandler handle(d->pathToDelta);
QString deltaPath = Akabei::Config::instance()->rootDir().absoluteFilePath("tmp/" + d->pathToDelta.split('/').last().remove(".tar.xz"));
handle.extract(d->pathToDelta.split('/').last().remove(".tar.xz"), deltaPath, true);
retstring = QString("xdelta3 -d -q -s %1 %2 %3")
.arg(d->pathToOldFile)
.arg(deltaPath)
.arg(pathToDest);
retstring = QString("xdelta3 -d -q -s %1 %2 %3").arg(
d->pathToOldFile,
deltaPath,
pathToDest);
}
return retstring;
......
......@@ -196,9 +196,9 @@ void ValidatorWorker::processNextPhase()
// Problem. There are two operations trying to add the same target.
errors << Error(Error::DuplicateTargetError,
tr("The target %1 is being added by %2 and %3")
.arg(target)
.arg(targetNames[target]->targetName())
.arg(op->targetName()));
.arg(target,
targetNames[target]->targetName(),
op->targetName()));
}
}
}
......@@ -298,7 +298,7 @@ void ValidatorWorker::processNextPhase()
foreach (const QString &uD, unresolvableDeps) {
// failure.
errors << Error(Error::UnresolvableDependenciesError,
tr("A dependency of %1 is not resolvable: %2").arg(i.key()).arg(uD));
tr("A dependency of %1 is not resolvable: %2").arg(i.key(), uD));
}
// Good. Any errors?
......@@ -350,8 +350,7 @@ void ValidatorWorker::processNextPhase()
// Problem, attempting to install a package conflicting with something in the transaction.
errors << Error(Error::PackageConflictError,
tr("%1 is about to be installed, but conflicts with %2, which is being installed as well.")
.arg(target)
.arg(op->targetName()));
.arg(target, op->targetName()));
}
}
// Now check the local database
......@@ -360,8 +359,7 @@ void ValidatorWorker::processNextPhase()
// Problem, trying to install a package conflicting with an installed package
errors << Error(Error::PackageConflictError,
tr("%1 is about to be installed, but conflicts with %2, which is installed")
.arg(op->targetName())
.arg(Backend::instance()->localDatabase()->queryPackages(queryFromName(target)).first()->name()));
.arg(op->targetName(), Backend::instance()->localDatabase()->queryPackages(queryFromName(target)).first()->name()));
}
}
}
......@@ -418,8 +416,7 @@ void ValidatorWorker::processNextPhase()
// Problem, attempting to remove a package which some installed packages depend on.
errors << Error(Error::UnresolvableDependenciesError,
tr("%1 depends on %2, which is being removed")
.arg(p->name())
.arg(target));;
.arg(p->name(), target));;
}
}
}
......
......@@ -532,13 +532,14 @@ bool InstallFunctor::operator()(const ArchiveEntry& currentEntry)
bool done = QFile::rename(file, file + ".akabeisave");
if (done) {
m_caller->addMessage(
QObject::tr("As %1 is the ultimate owner of %2, akabei moved the old file to %3!").arg(m_caller->targetName())
.arg(file).arg(file + ".akabeisave"));
QObject::tr("As %1 is the ultimate owner of %2, akabei moved the old file to %3!").arg(
m_caller->targetName(),
file, file + ".akabeisave"));
} else if (QFile::exists(file)) {
m_caller->addMessage(
QObject::tr("As %1 is the ultimate owner of %2, akabei tried to move the old file to %3 but failed! "
"Please fix it yourself!"
).arg(m_caller->targetName()).arg(file).arg(file + ".akabeisave"));
).arg(m_caller->targetName(), file, file + ".akabeisave"));
}
}
......@@ -616,13 +617,14 @@ bool ReinstallUpgradeFunctor::operator()(const ArchiveEntry& currentEntry)
bool done = QFile::rename(file, file + ".akabeisave");
if (done) {
m_caller->addMessage(
QObject::tr("As %1 is the ultimate owner of %2, akabei moved the old file to %3!").arg(m_caller->targetName())
.arg(file).arg(file + ".akabeisave"));
QObject::tr("As %1 is the ultimate owner of %2, akabei moved the old file to %3!").arg(
m_caller->targetName(),
file, file + ".akabeisave"));
} else if (QFile::exists(file)) {
m_caller->addMessage(
QObject::tr("As %1 is the ultimate owner of %2, akabei tried to move the old file to %3 but failed! "
"Please fix it yourself!"
).arg(m_caller->targetName()).arg(file).arg(file + ".akabeisave"));
).arg(m_caller->targetName(), file, file + ".akabeisave"));
}
}
......
......@@ -124,7 +124,7 @@ void PlainHookOperation::Private::slotErrors(Akabei::Error::List errors)
void PlainHookOperation::Private::slotFinished(bool fin)
{
if (!fin) {
q->addMessage(tr("There has been an error executing the hook for %1: %2").arg(it->first->name()).arg(pro->errorString()));
q->addMessage(tr("There has been an error executing the hook for %1: %2").arg(it->first->name(), pro->errorString()));
}
akabeiDebug() << "Process next" << pro->readAll();
it++;
......
......@@ -65,7 +65,7 @@ void ChrootedProcess::slotFinished(int exitCode)
emit scriptFinished(true);
} else {
// Bad.
emit errorsOccured(Error::List() << Error(Akabei::Error::ScriptletError, tr("The scriptlet for the following package failed to execute: %1: %2").arg(m_operation->targetName()).arg(errorString()), m_operation));
emit errorsOccured(Error::List() << Error(Akabei::Error::ScriptletError, tr("The scriptlet for the following package failed to execute: %1: %2").arg(m_operation->targetName(), errorString()), m_operation));
emit scriptFinished(false);
}
deleteLater();
......
......@@ -285,9 +285,9 @@ bool DatabaseWorker::add(const QStringList& targets, const QHash< QString, Akabe
QDir sourceDir = QFileInfo((*j)->pathToArchive()).absoluteDir();
deltaName = sourceDir.absoluteFilePath(deltaName);
QString command = QString("xdelta3 -e -q -s %1 %2 %3")
.arg((*j)->pathToArchive())
.arg((*k)->pathToArchive())
.arg(deltaName);
.arg((*j)->pathToArchive(),
(*k)->pathToArchive(),
deltaName);
// QString command = QString("xdelta delta %1 %2 %3").arg((*j)->pathToArchive())
// .arg((*k)->pathToArchive()).arg(deltaName);
QProcess proc;
......
......@@ -111,7 +111,7 @@ void FilesystemHelper::removeFiles(const QStringList& files, int processingOptio
QFile f(file);
if (!f.remove() && !((Akabei::ProcessingOptions) processingOptions).testFlag(Akabei::Force)) {
QString translated = QObject::tr("Removing %1 failed: %2").arg(file).arg(f.errorString());
QString translated = QObject::tr("Removing %1 failed: %2").arg(file, f.errorString());
errors << translated;
}
......
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