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

@@ -96,22 +96,22 @@ bool Assistant::startAssistant()
// get the name of the executable and the doc path
QString exe = QString::fromUtf8(App::GetApplication().getExecutableName());
QString doc = QString::fromUtf8(App::Application::getHelpDir().c_str());
QString qhc = doc + exe.toLower() + QLatin1String(".qhc");
QString doc = QString::fromUtf8(App::Application::getHelpDir().c_str());
QString qhc = doc + exe.toLower() + QLatin1String(".qhc");
QFileInfo fi(qhc);
if (!fi.isReadable()) {
QMessageBox::critical(0, tr("%1 Help").arg(exe),
tr("%1 help files not found (%2). You might need to install the %1 documentation package.").arg(exe).arg(qhc));
tr("%1 help files not found (%2). You might need to install the %1 documentation package.").arg(exe, qhc));
return false;
}
static bool first = true;
if (first) {
Base::Console().Log("Help file at %s\n", (const char*)qhc.toUtf8());
first = false;
static bool first = true;
if (first) {
Base::Console().Log("Help file at %s\n", (const char*)qhc.toUtf8());
first = false;
}
QStringList args;
args << QLatin1String("-collectionFile") << qhc