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

This commit is contained in:
Mateusz Skowroński
2019-01-30 19:43:13 +01:00
committed by wmayer
parent 216106e407
commit 317bcd59c9
36 changed files with 177 additions and 192 deletions

View File

@@ -267,7 +267,7 @@ void TreeWidget::onCreateGroup()
App::Document* doc = docitem->document()->getDocument();
QString cmd = QString::fromLatin1("App.getDocument(\"%1\").addObject"
"(\"App::DocumentObjectGroup\",\"%2\")")
.arg(QString::fromLatin1(doc->getName())).arg(name);
.arg(QString::fromLatin1(doc->getName()), name);
Gui::Document* gui = Gui::Application::Instance->getDocument(doc);
gui->openCommand("Create group");
Gui::Command::runCommand(Gui::Command::App, cmd.toUtf8());
@@ -280,9 +280,9 @@ void TreeWidget::onCreateGroup()
App::Document* doc = obj->getDocument();
QString cmd = QString::fromLatin1("App.getDocument(\"%1\").getObject(\"%2\")"
".newObject(\"App::DocumentObjectGroup\",\"%3\")")
.arg(QString::fromLatin1(doc->getName()))
.arg(QString::fromLatin1(obj->getNameInDocument()))
.arg(name);
.arg(QString::fromLatin1(doc->getName()),
QString::fromLatin1(obj->getNameInDocument()),
name);
Gui::Document* gui = Gui::Application::Instance->getDocument(doc);
gui->openCommand("Create group");
Gui::Command::runCommand(Gui::Command::App, cmd.toUtf8());
@@ -1941,8 +1941,8 @@ void DocumentObjectItem::displayStatusInfo()
if ( Obj->mustExecute() == 1 )
info += QString::fromLatin1(" (but must be executed)");
QString status = TreeWidget::tr("%1, Internal name: %2")
.arg(info)
.arg(QString::fromLatin1(Obj->getNameInDocument()));
.arg(info,
QString::fromLatin1(Obj->getNameInDocument()));
getMainWindow()->showMessage(status);
if (Obj->isError()) {