1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-21 05:11:44 +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

@@ -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

@@ -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->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() );