1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-01 03:40:16 +02:00

* Made ZeroConfAccount less bug prone.

This commit is contained in:
Lucas Lira Gomes
2012-05-29 19:39:21 -03:00
parent 5f385753c3
commit 2a5d061dee
2 changed files with 7 additions and 6 deletions

View File

@@ -86,7 +86,7 @@ void
ZeroconfAccount::authenticate()
{
if ( !isAuthenticated() )
static_cast< ZeroconfPlugin* >( m_sipPlugin.data() )->connectPlugin();
sipPlugin()->connectPlugin();
}
@@ -94,7 +94,7 @@ void
ZeroconfAccount::deauthenticate()
{
if ( isAuthenticated() )
static_cast< ZeroconfPlugin* >( m_sipPlugin.data() )->disconnectPlugin();
sipPlugin()->disconnectPlugin();
}
@@ -112,7 +112,7 @@ ZeroconfAccount::connectionState() const
return Disconnected;
// TODO can we get called before sipPlugin()?
return static_cast< ZeroconfPlugin* >( m_sipPlugin.data() )->connectionState();
return m_sipPlugin.data()->connectionState();
}
@@ -120,7 +120,7 @@ SipPlugin*
ZeroconfAccount::sipPlugin()
{
if ( m_sipPlugin.isNull() )
m_sipPlugin = QWeakPointer< SipPlugin >( new ZeroconfPlugin( this ) );
m_sipPlugin = QWeakPointer< ZeroconfPlugin >( new ZeroconfPlugin( this ) );
return m_sipPlugin.data();
}

View File

@@ -19,6 +19,7 @@
#ifndef ZEROCONF_ACCOUNTS_H
#define ZEROCONF_ACCOUNTS_H
#include "Zeroconf.h"
#include "accounts/Account.h"
#include "../AccountDllMacro.h"
@@ -71,7 +72,7 @@ public:
QWidget* aclWidget() { return 0; }
private:
QWeakPointer< SipPlugin > m_sipPlugin;
QWeakPointer< ZeroconfPlugin > m_sipPlugin;
};
}