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

@@ -103,9 +103,9 @@ void ViewProviderGroupExtension::extensionDropObject(App::DocumentObject* obj) {
QString cmd;
cmd = QString::fromLatin1("App.getDocument(\"%1\").getObject(\"%2\").addObject("
"App.getDocument(\"%1\").getObject(\"%3\"))")
.arg(QString::fromLatin1(doc->getName()))
.arg(QString::fromLatin1(grp->getNameInDocument()))
.arg(QString::fromLatin1(obj->getNameInDocument()));
.arg(QString::fromLatin1(doc->getName()),
QString::fromLatin1(grp->getNameInDocument()),
QString::fromLatin1(obj->getNameInDocument()));
Gui::Command::doCommand(Gui::Command::App, cmd.toUtf8());
}
@@ -119,16 +119,16 @@ void ViewProviderGroupExtension::extensionReplaceObject(App::DocumentObject* old
QString cmd;
cmd = QString::fromLatin1("App.getDocument(\"%1\").getObject(\"%2\").removeObject("
"App.getDocument(\"%1\").getObject(\"%3\"))")
.arg(QString::fromLatin1(doc->getName()))
.arg(QString::fromLatin1(grp->getNameInDocument()))
.arg(QString::fromLatin1(oldValue->getNameInDocument()));
.arg(QString::fromLatin1(doc->getName()),
QString::fromLatin1(grp->getNameInDocument()),
QString::fromLatin1(oldValue->getNameInDocument()));
Gui::Command::doCommand(Gui::Command::App, cmd.toUtf8());
cmd = QString::fromLatin1("App.getDocument(\"%1\").getObject(\"%2\").addObject("
"App.getDocument(\"%1\").getObject(\"%3\"))")
.arg(QString::fromLatin1(doc->getName()))
.arg(QString::fromLatin1(grp->getNameInDocument()))
.arg(QString::fromLatin1(newValue->getNameInDocument()));
.arg(QString::fromLatin1(doc->getName()),
QString::fromLatin1(grp->getNameInDocument()),
QString::fromLatin1(newValue->getNameInDocument()));
Gui::Command::doCommand(Gui::Command::App, cmd.toUtf8());
}