X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcommon%2Fsignalproxy.cpp;h=22e71f135323e12e4e8d92d0d5e2a022f708d32f;hp=411c8dae3a2f6db7ead13637a99f2e2a11245299;hb=0d1184b010f26a1620366fa705b18f6376b52698;hpb=8ec76e512d20ce5d1dc76de556bb98a06b75d695 diff --git a/src/common/signalproxy.cpp b/src/common/signalproxy.cpp index 411c8dae..22e71f13 100644 --- a/src/common/signalproxy.cpp +++ b/src/common/signalproxy.cpp @@ -312,9 +312,9 @@ void SignalProxy::removePeer(QIODevice* iodev) { void SignalProxy::removePeerBySender() { // OK we're brutal here... but since it's a private slot we know what we've got connected to it... + // this Slot is not triggered by destroyed, so the object is still alive and can be used! QIODevice *ioDev = (QIODevice *)(sender()); removePeer(ioDev); - qDebug() << "Client disconnected."; } void SignalProxy::objectRenamed(const QString &newname, const QString &oldname) { @@ -951,12 +951,19 @@ QString SignalProxy::methodBaseName(const QMetaMethod &method) { QString methodname = QString(method.signature()).section("(", 0, 0); // determine where we have to chop: + int upperCharPos; if(method.methodType() == QMetaMethod::Slot) { // we take evertyhing from the first uppercase char if it's slot - methodname = methodname.mid(methodname.indexOf(QRegExp("[A-Z]"))); + upperCharPos = methodname.indexOf(QRegExp("[A-Z]")); + if(upperCharPos == -1) + return QString(); + methodname = methodname.mid(upperCharPos); } else { // and if it's a signal we discard everything from the last uppercase char - methodname = methodname.left(methodname.lastIndexOf(QRegExp("[A-Z]"))); + upperCharPos = methodname.lastIndexOf(QRegExp("[A-Z]")); + if(upperCharPos == -1) + return QString(); + methodname = methodname.left(upperCharPos); } methodname[0] = methodname[0].toUpper();