1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-20 12:52:30 +02:00

* Always set current name as friendlyname.

This commit is contained in:
Christian Muehlhaeuser
2011-11-21 06:45:32 +01:00
parent de48898d34
commit 3a500a6303
6 changed files with 17 additions and 19 deletions

View File

@@ -41,7 +41,7 @@ ControlConnection::ControlConnection( Servent* parent, const QHostAddress &ha )
{
qDebug() << "CTOR controlconnection";
setId("ControlConnection()");
// auto delete when connection closes:
connect( this, SIGNAL( finished() ), SLOT( deleteLater() ) );
@@ -60,13 +60,13 @@ ControlConnection::ControlConnection( Servent* parent, const QString &ha )
{
qDebug() << "CTOR controlconnection";
setId("ControlConnection()");
// auto delete when connection closes:
connect( this, SIGNAL( finished() ), SLOT( deleteLater() ) );
this->setMsgProcessorModeIn( MsgProcessor::UNCOMPRESS_ALL | MsgProcessor::PARSE_JSON );
this->setMsgProcessorModeOut( MsgProcessor::COMPRESS_IF_LARGE );
if ( !ha.isEmpty() )
{
QHostAddress qha( ha );
@@ -134,6 +134,8 @@ ControlConnection::setup()
else
friendlyName = name();
tDebug() << "Detected name:" << name() << friendlyName << m_sock->peerAddress();
// setup source and remote collection for this peer
m_source = SourceList::instance()->get( id(), friendlyName );
m_source->setControlConnection( this );

View File

@@ -818,11 +818,11 @@ Servent::isIPWhitelisted( QHostAddress ip )
static QList<range> whitelist;
if( whitelist.isEmpty() )
{
whitelist << range( QHostAddress( "10.0.0.0" ), 8 )
<< range( QHostAddress( "172.16.0.0" ), 12 )
<< range( QHostAddress( "192.168.0.0" ), 16 )
<< range( QHostAddress( "169.254.0.0" ), 16 )
<< range( QHostAddress( "127.0.0.0" ), 24 );
whitelist << range( QHostAddress( "10.0.0.0" ), 8 )
<< range( QHostAddress( "172.16.0.0" ), 12 )
<< range( QHostAddress( "192.168.0.0" ), 16 )
<< range( QHostAddress( "169.254.0.0" ), 16 )
<< range( QHostAddress( "127.0.0.0" ), 24 );
// tDebug( LOGVERBOSE ) << "Loaded whitelist IP range:" << whitelist;
}

View File

@@ -478,14 +478,7 @@ SipHandler::onPeerOnline( const QString& jid )
ControlConnection* conn = new ControlConnection( Servent::instance(), QString() );
const QString& nodeid = Database::instance()->dbid();
//TODO: this is a terrible assumption, help me clean this up, mighty muesli!
if ( jid.contains( "@conference.") )
conn->setName( jid );
else
conn->setName( jid.left( jid.indexOf( "/" ) ) );
tDebug() << "Set name on connection:" << conn->name();
conn->setName( jid.left( jid.indexOf( "/" ) ) );
conn->setId( nodeid );
Servent::instance()->registerOffer( key, conn );

View File

@@ -200,7 +200,7 @@ Source::setOnline()
emit online();
// ensure username is in the database
DatabaseCommand_addSource* cmd = new DatabaseCommand_addSource( m_username, m_friendlyname );
DatabaseCommand_addSource* cmd = new DatabaseCommand_addSource( m_username, friendlyName() );
connect( cmd, SIGNAL( done( unsigned int, QString ) ),
SLOT( dbLoaded( unsigned int, const QString& ) ) );
Database::instance()->enqueue( QSharedPointer<DatabaseCommand>(cmd) );

View File

@@ -96,6 +96,7 @@ SourceList::setSources( const QList<Tomahawk::source_ptr>& sources )
tLog() << Q_FUNC_INFO << "- Total sources now:" << m_sources.size();
}
emit ready();
}
@@ -200,7 +201,10 @@ SourceList::get( const QString& username, const QString& friendlyName )
add( source );
}
else
{
source = m_sources.value( username );
source->setFriendlyName( friendlyName );
}
return source;
}

View File

@@ -94,7 +94,6 @@ JabberPlugin::JabberPlugin( const QString& pluginId )
connect( m_ui->jabberUsername, SIGNAL( textChanged( QString ) ), SLOT( onCheckJidExists( QString ) ) );
#endif
// setup JID object
Jreen::JID jid = Jreen::JID( accountName() );