Avoid temporary QString allocations

This fixes clazy warning: Use multi-arg instead [-Wclazy-qstring-arg]
This commit is contained in:
Chocobo1 2018-03-06 23:49:12 +08:00
parent c60b7b213e
commit 0457fd260e
No known key found for this signature in database
GPG key ID: 210D9C873253A68C
29 changed files with 137 additions and 123 deletions

View file

@ -60,8 +60,8 @@ const QString EXT_LEGACY {QStringLiteral(".rssrules")};
AutomatedRssDownloader::AutomatedRssDownloader(QWidget *parent)
: QDialog(parent)
, m_formatFilterJSON(QString("%1 (*%2)").arg(tr("Rules")).arg(EXT_JSON))
, m_formatFilterLegacy(QString("%1 (*%2)").arg(tr("Rules (legacy)")).arg(EXT_LEGACY))
, m_formatFilterJSON(QString("%1 (*%2)").arg(tr("Rules"), EXT_JSON))
, m_formatFilterLegacy(QString("%1 (*%2)").arg(tr("Rules (legacy)"), EXT_LEGACY))
, m_ui(new Ui::AutomatedRssDownloader)
, m_currentRuleItem(nullptr)
{
@ -405,7 +405,7 @@ void AutomatedRssDownloader::on_exportBtn_clicked()
QString selectedFilter {m_formatFilterJSON};
QString path = QFileDialog::getSaveFileName(
this, tr("Export RSS rules"), QDir::homePath()
, QString("%1;;%2").arg(m_formatFilterJSON).arg(m_formatFilterLegacy), &selectedFilter);
, QString("%1;;%2").arg(m_formatFilterJSON, m_formatFilterLegacy), &selectedFilter);
if (path.isEmpty()) return;
const RSS::AutoDownloader::RulesFileFormat format {
@ -437,7 +437,7 @@ void AutomatedRssDownloader::on_importBtn_clicked()
QString selectedFilter {m_formatFilterJSON};
QString path = QFileDialog::getOpenFileName(
this, tr("Import RSS rules"), QDir::homePath()
, QString("%1;;%2").arg(m_formatFilterJSON).arg(m_formatFilterLegacy), &selectedFilter);
, QString("%1;;%2").arg(m_formatFilterJSON, m_formatFilterLegacy), &selectedFilter);
if (path.isEmpty() || !QFile::exists(path))
return;
@ -657,7 +657,7 @@ void AutomatedRssDownloader::updateFieldsToolTips(bool regex)
tip += tr("An expression with an empty %1 clause (e.g. %2)",
"We talk about regex/wildcards in the RSS filters section here."
" So a valid sentence would be: An expression with an empty | clause (e.g. expr|)"
).arg("<tt>|</tt>").arg("<tt>expr|</tt>");
).arg("<tt>|</tt>", "<tt>expr|</tt>");
m_ui->lineContains->setToolTip(tip + tr(" will match all articles.") + "</p>");
m_ui->lineNotContains->setToolTip(tip + tr(" will exclude all articles.") + "</p>");
}