aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergio Martins <[email protected]>2015-10-14 21:08:25 +0100
committerSergio Martins <[email protected]>2015-10-14 21:08:25 +0100
commit08faef003c66a8d791fd048993affc2b15c718e2 (patch)
tree310b5e5a9ad34b4acc8a3d09dd6a23acaa97c3fb
parent1ef24fc2387e937e72dcf3e3c995245ca7e4aeb8 (diff)
Use multi-arg overload of QString::arg() for less allocations
-rw-r--r--src/grantlee_plugin/icon.cpp3
-rw-r--r--src/grantleetemplatemanager.cpp4
2 files changed, 2 insertions, 5 deletions
diff --git a/src/grantlee_plugin/icon.cpp b/src/grantlee_plugin/icon.cpp
index b4293f9..ba5bbf8 100644
--- a/src/grantlee_plugin/icon.cpp
+++ b/src/grantlee_plugin/icon.cpp
@@ -138,7 +138,6 @@ void IconNode::render(Grantlee::OutputStream *stream, Grantlee::Context *c) cons
.arg(mSizeOrGroup < KIconLoader::LastGroup ?
IconSize(static_cast<KIconLoader::Group>(mSizeOrGroup))
: mSizeOrGroup)
- .arg(altText.isEmpty() ? iconName : altText)
- .arg(altText); // title is intentionally blank if no alt is provided
+ .arg(altText.isEmpty() ? iconName : altText, altText); // title is intentionally blank if no alt is provided
(*stream) << Grantlee::SafeString(html, Grantlee::SafeString::IsSafe);
}
diff --git a/src/grantleetemplatemanager.cpp b/src/grantleetemplatemanager.cpp
index fcc6ad0..cd60ca1 100644
--- a/src/grantleetemplatemanager.cpp
+++ b/src/grantleetemplatemanager.cpp
@@ -96,9 +96,7 @@ QString GrantleeTemplateManager::errorTemplate(const QString &reason,
QStringLiteral("<h1>{{ error }}</h1>\n"
"<b>%1:</b> {{ templateName }}<br>\n"
"<b>%2:</b> {{ errorMessage }}")
- .arg(i18n("Template"))
- .arg(i18n("Error message")),
- QStringLiteral("TemplateError"));
+ .arg(i18n("Template"), i18n("Error message")), QStringLiteral("TemplateError"));
Grantlee::Context ctx = createContext();
ctx.insert(QStringLiteral("error"), reason);