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

@@ -241,15 +241,15 @@ int main( int argc, char ** argv )
msg = QObject::tr("While initializing %1 the following exception occurred: '%2'\n\n"
"Python is searching for its files in the following directories:\n%3\n\n"
"Python version information:\n%4\n")
.arg(appName).arg(QString::fromUtf8(e.what()))
.arg(appName, QString::fromUtf8(e.what()),
#if PY_MAJOR_VERSION >= 3
#if PY_MINOR_VERSION >= 5
.arg(QString::fromUtf8(Py_EncodeLocale(Py_GetPath(),NULL))).arg(QString::fromLatin1(Py_GetVersion()));
QString::fromUtf8(Py_EncodeLocale(Py_GetPath(),NULL)), QString::fromLatin1(Py_GetVersion()));
#else
.arg(QString::fromUtf8(_Py_wchar2char(Py_GetPath(),NULL))).arg(QString::fromLatin1(Py_GetVersion()));
QString::fromUtf8(_Py_wchar2char(Py_GetPath(),NULL)), QString::fromLatin1(Py_GetVersion()));
#endif
#else
.arg(QString::fromUtf8(Py_GetPath())).arg(QString::fromLatin1(Py_GetVersion()));
QString::fromUtf8(Py_GetPath()), QString::fromLatin1(Py_GetVersion()));
#endif
const char* pythonhome = getenv("PYTHONHOME");
if (pythonhome) {