1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-20 18:56:34 +01:00

Clazy qstring-arg: Combine multiple arg into one

Signed-off-by: Juraj Oravec <jurajoravec@mailo.com>
This commit is contained in:
Juraj Oravec 2023-01-29 17:58:53 +01:00
parent 285346208e
commit 42934d991d
Signed by: SGOrava
GPG Key ID: 13660A3F1D9F093B
4 changed files with 16 additions and 14 deletions

View File

@ -118,15 +118,17 @@ QStringList AcceptLanguage::expand(const QLocale::Language &language)
for (int j = 0; j < countries.size(); ++j) { for (int j = 0; j < countries.size(); ++j) {
QString languageString; QString languageString;
if (countries.count() == 1) { if (countries.count() == 1) {
languageString = QString(QLatin1String("%1 [%2]")) languageString = QString(QLatin1String("%1 [%2]")).arg(
.arg(QLocale::languageToString(language)) QLocale::languageToString(language),
.arg(QLocale(language).name().split(QLatin1Char('_')).at(0)); QLocale(language).name().split(QLatin1Char('_')).at(0)
);
} }
else { else {
languageString = QString(QLatin1String("%1/%2 [%3]")) languageString = QString(QLatin1String("%1/%2 [%3]")).arg (
.arg(QLocale::languageToString(language)) QLocale::languageToString(language),
.arg(QLocale::countryToString(countries.at(j))) QLocale::countryToString(countries.at(j)),
.arg(QLocale(language, countries.at(j)).name().split(QLatin1Char('_')).join(QLatin1Char('-')).toLower()); QLocale(language, countries.at(j)).name().split(QLatin1Char('_')).join(QLatin1Char('-')).toLower()
);
} }
if (!allLanguages.contains(languageString)) { if (!allLanguages.contains(languageString)) {

View File

@ -131,7 +131,7 @@ void SessionManager::renameSession(QString sessionFilePath, SessionManager::Sess
if (!ok) if (!ok)
return; return;
const QString newSessionPath = QString("%1/%2.dat").arg(DataPaths::path(DataPaths::Sessions)).arg(newName); const QString newSessionPath = QString("%1/%2.dat").arg(DataPaths::path(DataPaths::Sessions), newName);
if (QFile::exists(newSessionPath)) { if (QFile::exists(newSessionPath)) {
QMessageBox::information(mApp->activeWindow(), tr("Error!"), tr("The session file \"%1\" exists. Please enter another name.").arg(newName)); QMessageBox::information(mApp->activeWindow(), tr("Error!"), tr("The session file \"%1\" exists. Please enter another name.").arg(newName));
renameSession(sessionFilePath, flags); renameSession(sessionFilePath, flags);
@ -165,7 +165,7 @@ void SessionManager::saveSession()
if (!ok) if (!ok)
return; return;
const QString filePath = QString("%1/%2.dat").arg(DataPaths::path(DataPaths::Sessions)).arg(sessionName); const QString filePath = QString("%1/%2.dat").arg(DataPaths::path(DataPaths::Sessions), sessionName);
if (QFile::exists(filePath)) { if (QFile::exists(filePath)) {
QMessageBox::information(mApp->activeWindow(), tr("Error!"), tr("The session file \"%1\" exists. Please enter another name.").arg(sessionName)); QMessageBox::information(mApp->activeWindow(), tr("Error!"), tr("The session file \"%1\" exists. Please enter another name.").arg(sessionName));
saveSession(); saveSession();
@ -213,7 +213,7 @@ void SessionManager::newSession()
if (!ok) if (!ok)
return; return;
const QString filePath = QStringLiteral("%1/%2.dat").arg(DataPaths::path(DataPaths::Sessions)).arg(sessionName); const QString filePath = QStringLiteral("%1/%2.dat").arg(DataPaths::path(DataPaths::Sessions), sessionName);
if (QFile::exists(filePath)) { if (QFile::exists(filePath)) {
QMessageBox::information(mApp->activeWindow(), tr("Error!"), tr("The session file \"%1\" exists. Please enter another name.").arg(sessionName)); QMessageBox::information(mApp->activeWindow(), tr("Error!"), tr("The session file \"%1\" exists. Please enter another name.").arg(sessionName));
newSession(); newSession();

View File

@ -169,7 +169,7 @@ void FCM_Dialog::currentItemChanged(QTreeWidgetItem* current, QTreeWidgetItem* p
ui->size->setText(QString::number(flashCookie.size) + tr(" Byte")); ui->size->setText(QString::number(flashCookie.size) + tr(" Byte"));
ui->textEdit->setPlainText(flashCookie.contents); ui->textEdit->setPlainText(flashCookie.contents);
ui->server->setText(flashCookie.origin); ui->server->setText(flashCookie.origin);
ui->path->setText(QString("<a href=\"%1\">%2</a>").arg(QUrl::fromLocalFile(flashCookie.path).toString()).arg(QDir::toNativeSeparators(flashCookie.path))); ui->path->setText(QString("<a href=\"%1\">%2</a>").arg(QUrl::fromLocalFile(flashCookie.path).toString(), QDir::toNativeSeparators(flashCookie.path)));
ui->lastModified->setText(flashCookie.lastModification.toString()); ui->lastModified->setText(flashCookie.lastModification.toString());
ui->removeOne->setText(tr("Remove flash cookie")); ui->removeOne->setText(tr("Remove flash cookie"));

View File

@ -175,7 +175,7 @@ QString TLDExtractor::registrableDomainHelper(const QString &domainPart, const Q
return {}; return {};
} }
else { else {
return QString("%1.%2").arg(domainPart).arg(tldPart); return QString("%1.%2").arg(domainPart, tldPart);
} }
} }
@ -260,7 +260,7 @@ void TLDExtractor::loadData()
QMessageBox::information(0, tr("File not found!"), QMessageBox::information(0, tr("File not found!"),
tr("File \'effective_tld_names.dat\' was not found!\n" tr("File \'effective_tld_names.dat\' was not found!\n"
"You can download it from \'<a href=\"%1\"><b>here</b></a>\' to one of the following paths:\n%2") "You can download it from \'<a href=\"%1\"><b>here</b></a>\' to one of the following paths:\n%2")
.arg(tldDataFileDownloadLink).arg(m_dataSearchPaths.join("\n"))); .arg(tldDataFileDownloadLink, m_dataSearchPaths.join("\n")));
return; return;
} }
@ -363,7 +363,7 @@ bool TLDExtractor::test()
QMessageBox::information(0, tr("File not found!"), QMessageBox::information(0, tr("File not found!"),
tr("File \'test_psl.txt\' was not found!\n" tr("File \'test_psl.txt\' was not found!\n"
"You can download it from \'<a href=\"%1\"><b>here</b></a>\' to one of the following paths:\n%2") "You can download it from \'<a href=\"%1\"><b>here</b></a>\' to one of the following paths:\n%2")
.arg(testFileDownloadLink).arg(m_dataSearchPaths.join("\n"))); .arg(testFileDownloadLink, m_dataSearchPaths.join("\n")));
return false; return false;
} }