diff options
author | Alexander Volkov <a.volkov@rusbitech.ru> | 2017-01-06 22:02:50 +0300 |
---|---|---|
committer | Alexander Volkov <a.volkov@rusbitech.ru> | 2017-01-12 17:54:28 +0000 |
commit | dcec1420ea9d7e90bbd7f37be15d8e61eaf35d23 (patch) | |
tree | 950020aadfc183963a5668263ef302d8d6b0e6de /src/corelib/kernel/qcoreapplication.cpp | |
parent | 8f469e4a19feb77758fb5d3c7120ba93cf32cd7d (diff) |
Use QString::asprintf(), QStringBuilder, and the multi-arg overload of QString::arg()
... instead of sequential .arg(const QString &) callings.
It saves memory allocations and prevents unexpected results
if replacing strings contain place markers.
Found with clazy's qstring-arg check.
Change-Id: I3912275a6e11c6fb7559ff5623f2e8cde9b7f07a
Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/kernel/qcoreapplication.cpp')
-rw-r--r-- | src/corelib/kernel/qcoreapplication.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp index f025678b5d..152177a926 100644 --- a/src/corelib/kernel/qcoreapplication.cpp +++ b/src/corelib/kernel/qcoreapplication.cpp @@ -569,12 +569,10 @@ void QCoreApplicationPrivate::checkReceiverThread(QObject *receiver) QThread *thr = receiver->thread(); Q_ASSERT_X(currentThread == thr || !thr, "QCoreApplication::sendEvent", - QString::fromLatin1("Cannot send events to objects owned by a different thread. " - "Current thread %1. Receiver '%2' (of type '%3') was created in thread %4") - .arg(QString::number((quintptr) currentThread, 16)) - .arg(receiver->objectName()) - .arg(QLatin1String(receiver->metaObject()->className())) - .arg(QString::number((quintptr) thr, 16)) + QString::asprintf("Cannot send events to objects owned by a different thread. " + "Current thread 0x%p. Receiver '%ls' (of type '%s') was created in thread 0x%p", + currentThread, qUtf16Printable(receiver->objectName()), + receiver->metaObject()->className(), thr) .toLocal8Bit().data()); Q_UNUSED(currentThread); Q_UNUSED(thr); |