diff --git a/gui/codeeditor.cpp b/gui/codeeditor.cpp index 0703f9aeed0..02ddd4bc4e8 100644 --- a/gui/codeeditor.cpp +++ b/gui/codeeditor.cpp @@ -448,14 +448,15 @@ void CodeEditor::lineNumberAreaPaintEvent(const QPaintEvent *event) QString CodeEditor::generateStyleString() { QString bgcolor = QString("background:rgb(%1,%2,%3);") - .arg(mWidgetStyle->widgetBGColor.red(), - mWidgetStyle->widgetBGColor.green(), - mWidgetStyle->widgetBGColor.blue()); + .arg(mWidgetStyle->widgetBGColor.red()) + .arg(mWidgetStyle->widgetBGColor.green()) + .arg(mWidgetStyle->widgetBGColor.blue()); QString fgcolor = QString("color:rgb(%1,%2,%3);") - .arg(mWidgetStyle->widgetFGColor.red(), - mWidgetStyle->widgetFGColor.green(), - mWidgetStyle->widgetFGColor.blue()); + .arg(mWidgetStyle->widgetFGColor.red()) + .arg(mWidgetStyle->widgetFGColor.green()) + .arg(mWidgetStyle->widgetFGColor.blue()); QString style = QString("%1 %2") - .arg(bgcolor, fgcolor); + .arg(bgcolor) + .arg(fgcolor); return style; } diff --git a/gui/common.cpp b/gui/common.cpp index c0a5541d8d8..a1547538d0a 100644 --- a/gui/common.cpp +++ b/gui/common.cpp @@ -66,7 +66,7 @@ QString toFilterString(const QMap& filters, bool addAllSupporte // name patterns are our values. The generated filter string list will // thus be sorted alphabetically over the descriptions. for (const auto& k: filters.keys()) { - entries << QString("%1 (%2)").arg(k, filters.value(k)); + entries << QString("%1 (%2)").arg(k).arg(filters.value(k)); } return entries.join(";;"); diff --git a/gui/compliancereportdialog.cpp b/gui/compliancereportdialog.cpp index 316a71e40cc..358e95abe10 100644 --- a/gui/compliancereportdialog.cpp +++ b/gui/compliancereportdialog.cpp @@ -170,7 +170,7 @@ void ComplianceReportDialog::save() } catch (InternalError &e) { QMessageBox msg(QMessageBox::Critical, tr("Save compliance report"), - tr("Failed to import '%1' (%2), can not show files in compliance report").arg(prjfile, QString::fromStdString(e.errorMessage)), + tr("Failed to import '%1' (%2), can not show files in compliance report").arg(prjfile).arg(QString::fromStdString(e.errorMessage)), QMessageBox::Ok, this); msg.exec(); diff --git a/gui/cppchecklibrarydata.cpp b/gui/cppchecklibrarydata.cpp index 6840a2cb7cc..58caadf03e1 100644 --- a/gui/cppchecklibrarydata.cpp +++ b/gui/cppchecklibrarydata.cpp @@ -46,8 +46,8 @@ static std::string mandatoryAttibuteMissing(const QXmlStreamReader &xmlReader, c { throw std::runtime_error(QObject::tr("line %1: Mandatory attribute '%2' missing in '%3'") .arg(xmlReader.lineNumber()) - .arg(attributeName, xmlReader.name().toString()) - .toStdString()); + .arg(attributeName) + .arg(xmlReader.name().toString()).toStdString()); } static CppcheckLibraryData::Container loadContainer(QXmlStreamReader &xmlReader) diff --git a/gui/csvreport.cpp b/gui/csvreport.cpp index eb12eea37a8..740651cf06f 100644 --- a/gui/csvreport.cpp +++ b/gui/csvreport.cpp @@ -62,8 +62,8 @@ void CsvReport::writeError(const ErrorItem &error) */ const QString file = QDir::toNativeSeparators(error.errorPath.back().file); - QString line = QString("%1,%2,").arg(file, error.errorPath.back().line); - line += QString("%1,%2,%3").arg(GuiSeverity::toString(error.severity), error.errorId, error.summary); + QString line = QString("%1,%2,").arg(file).arg(error.errorPath.back().line); + line += QString("%1,%2,%3").arg(GuiSeverity::toString(error.severity)).arg(error.errorId).arg(error.summary); #if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)) mTxtWriter << line << Qt::endl; #else diff --git a/gui/librarydialog.cpp b/gui/librarydialog.cpp index 8ae362bd232..029f1ce2917 100644 --- a/gui/librarydialog.cpp +++ b/gui/librarydialog.cpp @@ -121,7 +121,7 @@ void LibraryDialog::openCfg() if (!errmsg.isNull()) { QMessageBox msg(QMessageBox::Critical, tr("Cppcheck"), - tr("Failed to load %1. %2.").arg(selectedFile, errmsg), + tr("Failed to load %1. %2.").arg(selectedFile).arg(errmsg), QMessageBox::Ok, this); msg.exec(); diff --git a/gui/mainwindow.cpp b/gui/mainwindow.cpp index 7f88449b635..87f70d5d574 100644 --- a/gui/mainwindow.cpp +++ b/gui/mainwindow.cpp @@ -861,7 +861,7 @@ bool MainWindow::tryLoadLibrary(Library *library, const QString& filename) const Library::Error error = loadLibrary(library, filename); if (error.errorcode != Library::ErrorCode::OK) { if (error.errorcode == Library::ErrorCode::UNKNOWN_ELEMENT) { - QMessageBox::information(this, tr("Information"), tr("The library '%1' contains unknown elements:\n%2").arg(filename, error.reason.c_str())); + QMessageBox::information(this, tr("Information"), tr("The library '%1' contains unknown elements:\n%2").arg(filename).arg(error.reason.c_str())); return true; } @@ -899,7 +899,7 @@ bool MainWindow::tryLoadLibrary(Library *library, const QString& filename) } if (!error.reason.empty()) errmsg += " '" + QString::fromStdString(error.reason) + "'"; - QMessageBox::information(this, tr("Information"), tr("Failed to load the selected library '%1'.\n%2").arg(filename, errmsg)); + QMessageBox::information(this, tr("Information"), tr("Failed to load the selected library '%1'.\n%2").arg(filename).arg(errmsg)); return false; } return true; @@ -958,7 +958,7 @@ Settings MainWindow::getCppcheckSettings() { const QString cfgErr = QString::fromStdString(result.loadCppcheckCfg()); if (!cfgErr.isEmpty()) - QMessageBox::critical(this, tr("Error"), tr("Failed to load %1 - %2").arg("cppcheck.cfg", cfgErr)); + QMessageBox::critical(this, tr("Error"), tr("Failed to load %1 - %2").arg("cppcheck.cfg").arg(cfgErr)); const auto cfgAddons = result.addons; result.addons.clear(); @@ -1787,7 +1787,7 @@ void MainWindow::analyzeProject(const ProjectFile *projectFile, const bool check if (!errorMessage.isEmpty()) { QMessageBox msg(QMessageBox::Critical, tr("Cppcheck"), - tr("Failed to import '%1': %2\n\nAnalysis is stopped.").arg(prjfile, errorMessage), + tr("Failed to import '%1': %2\n\nAnalysis is stopped.").arg(prjfile).arg(errorMessage), QMessageBox::Ok, this); msg.exec(); @@ -1796,7 +1796,7 @@ void MainWindow::analyzeProject(const ProjectFile *projectFile, const bool check } catch (InternalError &e) { QMessageBox msg(QMessageBox::Critical, tr("Cppcheck"), - tr("Failed to import '%1' (%2), analysis is stopped").arg(prjfile, QString::fromStdString(e.errorMessage)), + tr("Failed to import '%1' (%2), analysis is stopped").arg(prjfile).arg(QString::fromStdString(e.errorMessage)), QMessageBox::Ok, this); msg.exec(); @@ -2100,7 +2100,7 @@ void MainWindow::replyFinished(QNetworkReply *reply) { } mUI->mButtonHideInformation->setVisible(true); mUI->mLabelInformation->setVisible(true); - mUI->mLabelInformation->setText(tr("New version available: %1. %2").arg(str.trimmed(), install)); + mUI->mLabelInformation->setText(tr("New version available: %1. %2").arg(str.trimmed()).arg(install)); } } } diff --git a/gui/printablereport.cpp b/gui/printablereport.cpp index b95f9acd526..d9272632f45 100644 --- a/gui/printablereport.cpp +++ b/gui/printablereport.cpp @@ -46,7 +46,7 @@ void PrintableReport::writeError(const ErrorItem &error) { const QString file = QDir::toNativeSeparators(error.errorPath.back().file); QString line = QString("%1,%2,").arg(file).arg(error.errorPath.back().line); - line += QString("%1,%2").arg(GuiSeverity::toString(error.severity), error.summary); + line += QString("%1,%2").arg(GuiSeverity::toString(error.severity)).arg(error.summary); mFormattedReport += line; mFormattedReport += "\n"; diff --git a/gui/resultstree.cpp b/gui/resultstree.cpp index b54d1e2c186..c0010dbc79c 100644 --- a/gui/resultstree.cpp +++ b/gui/resultstree.cpp @@ -816,7 +816,7 @@ void ResultsTree::startApplication(const QStandardItem *target, int application) } #endif // Q_OS_WIN - const QString cmdLine = QString("%1 %2").arg(program, params); + const QString cmdLine = QString("%1 %2").arg(program).arg(params); // this is reported as deprecated in Qt 5.15.2 but no longer in Qt 6 #if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)) diff --git a/gui/resultsview.cpp b/gui/resultsview.cpp index e595e9eecf1..402cab520fe 100644 --- a/gui/resultsview.cpp +++ b/gui/resultsview.cpp @@ -463,7 +463,7 @@ void ResultsView::updateDetails(const QModelIndex &index) const QString file0 = data["file0"].toString(); if (!file0.isEmpty() && Path::isHeader2(data["file"].toString().toStdString())) - formattedMsg += QString("\n\n%1: %2").arg(tr("First included by"), QDir::toNativeSeparators(file0)); + formattedMsg += QString("\n\n%1: %2").arg(tr("First included by")).arg(QDir::toNativeSeparators(file0)); if (data["cwe"].toInt() > 0) formattedMsg.prepend("CWE: " + QString::number(data["cwe"].toInt()) + "\n"); diff --git a/gui/statsdialog.cpp b/gui/statsdialog.cpp index e61664f3d3d..8790a179d8e 100644 --- a/gui/statsdialog.cpp +++ b/gui/statsdialog.cpp @@ -182,9 +182,9 @@ void StatsDialog::pdfExport() "

%9 : %10

\n" "

%11 : %12

\n" "

%13 : %14

\n") - .arg(tr("Statistics"), - QDate::currentDate().toString("dd.MM.yyyy"), - tr("Errors")) + .arg(tr("Statistics")) + .arg(QDate::currentDate().toString("dd.MM.yyyy")) + .arg(tr("Errors")) .arg(mStatistics->getCount(CPPCHECK,ShowTypes::ShowErrors)) .arg(tr("Warnings")) .arg(mStatistics->getCount(CPPCHECK,ShowTypes::ShowWarnings)) @@ -246,17 +246,17 @@ void StatsDialog::copyToClipboard() "\t%8:\t%9\n" "\t%10:\t%11\n" ) - .arg(projSettings, - project, - mUI->mProject->text(), - paths, - mUI->mPaths->text(), - incPaths, - mUI->mIncludePaths->text(), - defines) - .arg(mUI->mDefines->text(), - undefines, - mUI->mUndefines->text()); + .arg(projSettings) + .arg(project) + .arg(mUI->mProject->text()) + .arg(paths) + .arg(mUI->mPaths->text()) + .arg(incPaths) + .arg(mUI->mIncludePaths->text()) + .arg(defines) + .arg(mUI->mDefines->text()) + .arg(undefines) + .arg(mUI->mUndefines->text()); const QString previous = QString( "%1\n" @@ -264,13 +264,13 @@ void StatsDialog::copyToClipboard() "\t%4:\t%5\n" "\t%6:\t%7\n" ) - .arg(prevScan, - selPath, - mUI->mPath->text(), - numFiles, - mUI->mNumberOfFilesScanned->text(), - duration, - mUI->mScanDuration->text()); + .arg(prevScan) + .arg(selPath) + .arg(mUI->mPath->text()) + .arg(numFiles) + .arg(mUI->mNumberOfFilesScanned->text()) + .arg(duration) + .arg(mUI->mScanDuration->text()); const QString statistics = QString( "%1\n" @@ -281,8 +281,8 @@ void StatsDialog::copyToClipboard() "\t%10:\t%11\n" "\t%12:\t%13\n" ) - .arg(stats, - errors) + .arg(stats) + .arg(errors) .arg(mStatistics->getCount(CPPCHECK,ShowTypes::ShowErrors)) .arg(warnings) .arg(mStatistics->getCount(CPPCHECK,ShowTypes::ShowWarnings)) @@ -308,17 +308,17 @@ void StatsDialog::copyToClipboard() " %10:%11\n" "\n" ) - .arg(projSettings, - project, - mUI->mProject->text(), - paths, - mUI->mPaths->text(), - incPaths, - mUI->mIncludePaths->text(), - defines) - .arg(mUI->mDefines->text(), - undefines, - mUI->mUndefines->text()); + .arg(projSettings) + .arg(project) + .arg(mUI->mProject->text()) + .arg(paths) + .arg(mUI->mPaths->text()) + .arg(incPaths) + .arg(mUI->mIncludePaths->text()) + .arg(defines) + .arg(mUI->mDefines->text()) + .arg(undefines) + .arg(mUI->mUndefines->text()); const QString htmlPrevious = QString( "

%1

\n" @@ -328,13 +328,13 @@ void StatsDialog::copyToClipboard() " %6:%7\n" "\n" ) - .arg(prevScan, - selPath, - mUI->mPath->text(), - numFiles, - mUI->mNumberOfFilesScanned->text(), - duration, - mUI->mScanDuration->text()); + .arg(prevScan) + .arg(selPath) + .arg(mUI->mPath->text()) + .arg(numFiles) + .arg(mUI->mNumberOfFilesScanned->text()) + .arg(duration) + .arg(mUI->mScanDuration->text()); const QString htmlStatistics = QString( "

%1

\n" @@ -346,8 +346,8 @@ void StatsDialog::copyToClipboard() " %12:%13\n" "\n" ) - .arg(stats, - errors) + .arg(stats) + .arg(errors) .arg(mStatistics->getCount(CPPCHECK,ShowTypes::ShowErrors)) .arg(warnings) .arg(mStatistics->getCount(CPPCHECK,ShowTypes::ShowWarnings))