Fix typos in QObject::(dis)connect warnings
For some strange reason "Object::method ..." was printed, without the leading Q. Change-Id: I10b99e8aa8730e4020d15b3e04a01004bade76c3 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
This commit is contained in:
parent
d936fe0858
commit
be6b29f001
@ -1947,10 +1947,10 @@ static bool check_signal_macro(const QObject *sender, const char *signal,
|
||||
int sigcode = extract_code(signal);
|
||||
if (sigcode != QSIGNAL_CODE) {
|
||||
if (sigcode == QSLOT_CODE)
|
||||
qWarning("Object::%s: Attempt to %s non-signal %s::%s",
|
||||
qWarning("QObject::%s: Attempt to %s non-signal %s::%s",
|
||||
func, op, sender->metaObject()->className(), signal+1);
|
||||
else
|
||||
qWarning("Object::%s: Use the SIGNAL macro to %s %s::%s",
|
||||
qWarning("QObject::%s: Use the SIGNAL macro to %s %s::%s",
|
||||
func, op, sender->metaObject()->className(), signal);
|
||||
return false;
|
||||
}
|
||||
@ -1961,7 +1961,7 @@ static bool check_method_code(int code, const QObject *object,
|
||||
const char *method, const char *func)
|
||||
{
|
||||
if (code != QSLOT_CODE && code != QSIGNAL_CODE) {
|
||||
qWarning("Object::%s: Use the SLOT or SIGNAL macro to "
|
||||
qWarning("QObject::%s: Use the SLOT or SIGNAL macro to "
|
||||
"%s %s::%s", func, func, object->metaObject()->className(), method);
|
||||
return false;
|
||||
}
|
||||
@ -1978,11 +1978,11 @@ static void err_method_notfound(const QObject *object,
|
||||
}
|
||||
const char *loc = extract_location(method);
|
||||
if (strchr(method,')') == 0) // common typing mistake
|
||||
qWarning("Object::%s: Parentheses expected, %s %s::%s%s%s",
|
||||
qWarning("QObject::%s: Parentheses expected, %s %s::%s%s%s",
|
||||
func, type, object->metaObject()->className(), method+1,
|
||||
loc ? " in ": "", loc ? loc : "");
|
||||
else
|
||||
qWarning("Object::%s: No such %s %s::%s%s%s",
|
||||
qWarning("QObject::%s: No such %s %s::%s%s%s",
|
||||
func, type, object->metaObject()->className(), method+1,
|
||||
loc ? " in ": "", loc ? loc : "");
|
||||
|
||||
@ -1996,9 +1996,9 @@ static void err_info_about_objects(const char * func,
|
||||
QString a = sender ? sender->objectName() : QString();
|
||||
QString b = receiver ? receiver->objectName() : QString();
|
||||
if (!a.isEmpty())
|
||||
qWarning("Object::%s: (sender name: '%s')", func, a.toLocal8Bit().data());
|
||||
qWarning("QObject::%s: (sender name: '%s')", func, a.toLocal8Bit().data());
|
||||
if (!b.isEmpty())
|
||||
qWarning("Object::%s: (receiver name: '%s')", func, b.toLocal8Bit().data());
|
||||
qWarning("QObject::%s: (receiver name: '%s')", func, b.toLocal8Bit().data());
|
||||
}
|
||||
|
||||
/*!
|
||||
@ -2578,7 +2578,7 @@ bool QObject::disconnect(const QObject *sender, const char *signal,
|
||||
const QObject *receiver, const char *method)
|
||||
{
|
||||
if (sender == 0 || (receiver == 0 && method != 0)) {
|
||||
qWarning("Object::disconnect: Unexpected null parameter");
|
||||
qWarning("QObject::disconnect: Unexpected null parameter");
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -2703,12 +2703,12 @@ bool QObject::disconnect(const QObject *sender, const QMetaMethod &signal,
|
||||
const QObject *receiver, const QMetaMethod &method)
|
||||
{
|
||||
if (sender == 0 || (receiver == 0 && method.mobj != 0)) {
|
||||
qWarning("Object::disconnect: Unexpected null parameter");
|
||||
qWarning("QObject::disconnect: Unexpected null parameter");
|
||||
return false;
|
||||
}
|
||||
if (signal.mobj) {
|
||||
if(signal.methodType() != QMetaMethod::Signal) {
|
||||
qWarning("Object::%s: Attempt to %s non-signal %s::%s",
|
||||
qWarning("QObject::%s: Attempt to %s non-signal %s::%s",
|
||||
"disconnect","unbind",
|
||||
sender->metaObject()->className(), signal.signature());
|
||||
return false;
|
||||
@ -4160,7 +4160,7 @@ bool QObject::disconnect(const QMetaObject::Connection &connection)
|
||||
bool QObject::disconnectImpl(const QObject *sender, void **signal, const QObject *receiver, void **slot, const QMetaObject *senderMetaObject)
|
||||
{
|
||||
if (sender == 0 || (receiver == 0 && slot != 0)) {
|
||||
qWarning("Object::disconnect: Unexpected null parameter");
|
||||
qWarning("QObject::disconnect: Unexpected null parameter");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -3999,7 +3999,7 @@ void tst_QObject::disconnectNotSignalMetaMethod()
|
||||
QMetaMethod slot = s.metaObject()->method(
|
||||
s.metaObject()->indexOfMethod("aPublicSlot()"));
|
||||
|
||||
QTest::ignoreMessage(QtWarningMsg,"Object::disconnect: Attempt to unbind non-signal SenderObject::aPublicSlot()");
|
||||
QTest::ignoreMessage(QtWarningMsg,"QObject::disconnect: Attempt to unbind non-signal SenderObject::aPublicSlot()");
|
||||
QVERIFY(!QObject::disconnect(&s, slot, &r, QMetaMethod()));
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user