diff options
| author | Jeremy Lainé <jeremy.laine@m4x.org> | 2010-09-30 16:22:17 +0000 |
|---|---|---|
| committer | Jeremy Lainé <jeremy.laine@m4x.org> | 2010-09-30 16:22:17 +0000 |
| commit | 313e8f139f8200639048ca0dc8c3aa7e202bf9aa (patch) | |
| tree | a00ef632c4677f23708b573de5ff0baf7925d9b6 /src/QXmppCallManager.cpp | |
| parent | 1ddc6a696ef58e85569f762f2be21d54afcd48a0 (diff) | |
| download | qxmpp-313e8f139f8200639048ca0dc8c3aa7e202bf9aa.tar.gz | |
* improve cleanup of destroyed calls
* make it possible to move QXmppCall objects to threads
Diffstat (limited to 'src/QXmppCallManager.cpp')
| -rw-r--r-- | src/QXmppCallManager.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/QXmppCallManager.cpp b/src/QXmppCallManager.cpp index 17f4ad1c..e858f84e 100644 --- a/src/QXmppCallManager.cpp +++ b/src/QXmppCallManager.cpp @@ -32,6 +32,8 @@ #include "QXmppStun.h" #include "QXmppUtils.h" +static int typeId = qRegisterMetaType<QXmppCall::State>(); + const int RTP_COMPONENT = 1; const int RTCP_COMPONENT = 2; @@ -467,8 +469,11 @@ QXmppCall *QXmppCallManager::call(const QString &jid) { QXmppCall *call = new QXmppCall(jid, QXmppCall::OutgoingDirection, this); call->m_sid = generateStanzaHash(); + + // register call m_calls << call; - connect(call, SIGNAL(destroyed(QObject*)), this, SLOT(callDestroyed(QObject*))); + connect(call, SIGNAL(destroyed(QObject*)), + this, SLOT(callDestroyed(QObject*))); connect(call, SIGNAL(stateChanged(QXmppCall::State)), this, SLOT(callStateChanged(QXmppCall::State))); connect(call, SIGNAL(localCandidatesChanged()), @@ -715,7 +720,9 @@ void QXmppCallManager::jingleIqReceived(const QXmppJingleIq &iq) } // register call - m_calls.append(call); + m_calls << call; + connect(call, SIGNAL(destroyed(QObject*)), + this, SLOT(callDestroyed(QObject*))); connect(call, SIGNAL(stateChanged(QXmppCall::State)), this, SLOT(callStateChanged(QXmppCall::State))); connect(call, SIGNAL(localCandidatesChanged()), |
