Use QString's multi-arg overload to save memory allocations. [-Wclazy-qstring-arg]

This commit is contained in:
wmayer
2019-02-11 16:12:50 +01:00
parent 92614e5688
commit 110f6f74a4
3 changed files with 8 additions and 10 deletions

View File

@@ -802,8 +802,8 @@ void TaskAttacher::updateListOfModes()
if (mmode != mmDeactivated) {
tooltip += QString::fromLatin1("\n\n%1\n%2")
.arg(tr("Reference combinations:"))
.arg(AttacherGui::getRefListForMode(pcAttach->attacher(),mmode).join(QString::fromLatin1("\n")));
.arg(tr("Reference combinations:"),
AttacherGui::getRefListForMode(pcAttach->attacher(),mmode).join(QString::fromLatin1("\n")));
}
item->setToolTip(tooltip);

View File

@@ -1219,10 +1219,10 @@ bool MDIViewPage::compareSelections(std::vector<Gui::SelectionObject> treeSel, Q
void MDIViewPage::showStatusMsg(const char* s1, const char* s2, const char* s3) const
{
QString msg = QString::fromLatin1("%1 %2.%3.%4 ")
.arg(tr("Selected:"))
.arg(QString::fromUtf8(s1))
.arg(QString::fromUtf8(s2))
.arg(QString::fromUtf8(s3));
.arg(tr("Selected:"),
QString::fromUtf8(s1),
QString::fromUtf8(s2),
QString::fromUtf8(s3));
if (Gui::getMainWindow()) {
Gui::getMainWindow()->showMessage(msg,3000);
}