X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fcommon%2Fsignalproxy.cpp;h=19b9af83e2f36c485947527fb86c609349b530b6;hb=6acb434eb00e38f345d9d201151d295f27e786c9;hp=3ac73bc0bc10aaf9808374c1a114a1686d4e7b0f;hpb=ab8127d2193d7d9de9e41b9f454911fdd07e49df;p=quassel.git diff --git a/src/common/signalproxy.cpp b/src/common/signalproxy.cpp index 3ac73bc0..19b9af83 100644 --- a/src/common/signalproxy.cpp +++ b/src/common/signalproxy.cpp @@ -96,11 +96,7 @@ void SignalProxy::SignalRelay::attachSignal(QObject *sender, int signalId, const } else { fn = SIGNAL(fakeMethodSignature()); -#if QT_VERSION >= 0x050000 fn = fn.replace("fakeMethodSignature()", sender->metaObject()->method(signalId).methodSignature()); -#else - fn = fn.replace("fakeMethodSignature()", sender->metaObject()->method(signalId).signature()); -#endif } _slots[slotId] = Signal(sender, signalId, fn); @@ -145,11 +141,7 @@ int SignalProxy::SignalRelay::qt_metacall(QMetaObject::Call _c, int _id, void ** const QList &argTypes = eMeta->argTypes(signal.signalId); for (int i = 0; i < argTypes.size(); i++) { if (argTypes[i] == 0) { -#if QT_VERSION >= 0x050000 qWarning() << "SignalRelay::qt_metacall(): received invalid data for argument number" << i << "of signal" << QString("%1::%2").arg(caller->metaObject()->className()).arg(caller->metaObject()->method(signal.signalId).methodSignature().constData()); -#else - qWarning() << "SignalRelay::qt_metacall(): received invalid data for argument number" << i << "of signal" << QString("%1::%2").arg(caller->metaObject()->className()).arg(caller->metaObject()->method(signal.signalId).signature()); -#endif qWarning() << " - make sure all your data types are known by the Qt MetaSystem"; return _id; } @@ -475,8 +467,11 @@ void SignalProxy::synchronize(SyncableObject *obj) void SignalProxy::detachObject(QObject *obj) { - detachSignals(obj); - detachSlots(obj); + // Don't try to connect SignalProxy from itself on shutdown + if (obj != this) { + detachSignals(obj); + detachSlots(obj); + } } @@ -666,11 +661,7 @@ bool SignalProxy::invokeSlot(QObject *receiver, int methodId, const QVariantList // check for argument compatibility and build params array for (int i = 0; i < numArgs; i++) { if (!params[i].isValid()) { -#if QT_VERSION >= 0x050000 qWarning() << "SignalProxy::invokeSlot(): received invalid data for argument number" << i << "of method" << QString("%1::%2()").arg(receiver->metaObject()->className()).arg(receiver->metaObject()->method(methodId).methodSignature().constData()); -#else - qWarning() << "SignalProxy::invokeSlot(): received invalid data for argument number" << i << "of method" << QString("%1::%2()").arg(receiver->metaObject()->className()).arg(receiver->metaObject()->method(methodId).signature()); -#endif qWarning() << " - make sure all your data types are known by the Qt MetaSystem"; return false; } @@ -893,11 +884,7 @@ SignalProxy::ExtendedMetaObject::ExtendedMetaObject(const QMetaObject *meta, boo if (_meta->method(i).methodType() != QMetaMethod::Slot) continue; -#if QT_VERSION >= 0x050000 if (_meta->method(i).methodSignature().contains('*')) -#else - if (QByteArray(_meta->method(i).signature()).contains('*')) -#endif continue; // skip methods with ptr params QByteArray method = methodName(_meta->method(i)); @@ -926,11 +913,7 @@ SignalProxy::ExtendedMetaObject::ExtendedMetaObject(const QMetaObject *meta, boo } if (checkConflicts) { qWarning() << "class" << meta->className() << "contains overloaded methods which is currently not supported!"; -#if QT_VERSION >= 0x050000 qWarning() << " - " << _meta->method(i).methodSignature() << "conflicts with" << _meta->method(_methodIds[method]).methodSignature(); -#else - qWarning() << " - " << _meta->method(i).signature() << "conflicts with" << _meta->method(_methodIds[method]).signature(); -#endif } continue; } @@ -970,11 +953,7 @@ const QHash &SignalProxy::ExtendedMetaObject::receiveMap() if (QMetaType::Void == (QMetaType::Type)returnType(i)) continue; -#if QT_VERSION >= 0x050000 signature = requestSlot.methodSignature(); -#else - signature = QByteArray(requestSlot.signature()); -#endif if (!signature.startsWith("request")) continue; @@ -1008,22 +987,14 @@ const QHash &SignalProxy::ExtendedMetaObject::receiveMap() QByteArray SignalProxy::ExtendedMetaObject::methodName(const QMetaMethod &method) { -#if QT_VERSION >= 0x050000 QByteArray sig(method.methodSignature()); -#else - QByteArray sig(method.signature()); -#endif return sig.left(sig.indexOf("(")); } QString SignalProxy::ExtendedMetaObject::methodBaseName(const QMetaMethod &method) { -#if QT_VERSION >= 0x050000 QString methodname = QString(method.methodSignature()).section("(", 0, 0); -#else - QString methodname = QString(method.signature()).section("(", 0, 0); -#endif // determine where we have to chop: int upperCharPos; @@ -1061,11 +1032,7 @@ SignalProxy::ExtendedMetaObject::MethodDescriptor::MethodDescriptor(const QMetaM _argTypes = argTypes; // determine minArgCount -#if QT_VERSION >= 0x050000 QString signature(method.methodSignature()); -#else - QString signature(method.signature()); -#endif _minArgCount = method.parameterTypes().count() - signature.count("="); _receiverMode = (_methodName.startsWith("request"))