mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-07-31 11:20:22 +02:00
* Added assert to catch dupe source.
This commit is contained in:
@@ -75,6 +75,13 @@ ControlConnection::setup()
|
||||
{
|
||||
qDebug() << Q_FUNC_INFO << id() << name();
|
||||
|
||||
if ( !m_source.isNull() )
|
||||
{
|
||||
qDebug() << "This source seems to be online already.";
|
||||
Q_ASSERT( false );
|
||||
return;
|
||||
}
|
||||
|
||||
QString friendlyName;
|
||||
if ( Servent::isIPWhitelisted( m_sock->peerAddress() ) )
|
||||
{
|
||||
|
@@ -30,7 +30,7 @@
|
||||
using namespace Tomahawk;
|
||||
|
||||
|
||||
Source::Source( int id, const QString &username )
|
||||
Source::Source( int id, const QString& username )
|
||||
: QObject()
|
||||
, m_isLocal( false )
|
||||
, m_online( false )
|
||||
@@ -38,7 +38,7 @@ Source::Source( int id, const QString &username )
|
||||
, m_id( id )
|
||||
, m_cc( 0 )
|
||||
{
|
||||
qDebug() << Q_FUNC_INFO;
|
||||
qDebug() << Q_FUNC_INFO << id << username;
|
||||
|
||||
if ( id == 0 )
|
||||
{
|
||||
@@ -146,6 +146,7 @@ Source::setOnline()
|
||||
{
|
||||
if ( m_online )
|
||||
return;
|
||||
m_online = true;
|
||||
|
||||
// ensure username is in the database
|
||||
DatabaseCommand_addSource* cmd = new DatabaseCommand_addSource( m_username, m_friendlyname );
|
||||
@@ -153,7 +154,6 @@ Source::setOnline()
|
||||
SLOT( dbLoaded( unsigned int, const QString& ) ) );
|
||||
Database::instance()->enqueue( QSharedPointer<DatabaseCommand>(cmd) );
|
||||
|
||||
m_online = true;
|
||||
emit online();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user