mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-06 06:07:37 +02:00
* Removed debug output and cleaned up sources a bit.
This commit is contained in:
@@ -61,7 +61,7 @@ source_ptr& Collection::source() const
|
|||||||
void
|
void
|
||||||
Collection::addPlaylist( const Tomahawk::playlist_ptr& p )
|
Collection::addPlaylist( const Tomahawk::playlist_ptr& p )
|
||||||
{
|
{
|
||||||
qDebug() << Q_FUNC_INFO;
|
// qDebug() << Q_FUNC_INFO;
|
||||||
|
|
||||||
if ( m_playlists.contains( p->guid() ) )
|
if ( m_playlists.contains( p->guid() ) )
|
||||||
return;
|
return;
|
||||||
@@ -81,39 +81,42 @@ Collection::addPlaylist( const Tomahawk::playlist_ptr& p )
|
|||||||
void
|
void
|
||||||
Collection::addAutoPlaylist( const Tomahawk::dynplaylist_ptr& p )
|
Collection::addAutoPlaylist( const Tomahawk::dynplaylist_ptr& p )
|
||||||
{
|
{
|
||||||
qDebug() << Q_FUNC_INFO;
|
// qDebug() << Q_FUNC_INFO;
|
||||||
|
|
||||||
QList<dynplaylist_ptr> toadd;
|
QList<dynplaylist_ptr> toadd;
|
||||||
toadd << p;
|
toadd << p;
|
||||||
qDebug() << "Inserted dynamic playlist with guid:" << p->guid();
|
qDebug() << "Inserted dynamic playlist with guid:" << p->guid();
|
||||||
m_autoplaylists.insert( p->guid(), p );
|
m_autoplaylists.insert( p->guid(), p );
|
||||||
|
|
||||||
qDebug() << Q_FUNC_INFO << "Collection name" << name()
|
qDebug() << Q_FUNC_INFO << "Collection name" << name()
|
||||||
<< "from source id" << source()->id()
|
<< "from source id" << source()->id()
|
||||||
<< "numplaylists:" << m_playlists.count();
|
<< "numplaylists:" << m_playlists.count();
|
||||||
emit autoPlaylistsAdded( toadd );
|
emit autoPlaylistsAdded( toadd );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
Collection::addStation( const dynplaylist_ptr& s )
|
Collection::addStation( const dynplaylist_ptr& s )
|
||||||
{
|
{
|
||||||
qDebug() << Q_FUNC_INFO;
|
// qDebug() << Q_FUNC_INFO;
|
||||||
|
|
||||||
QList<dynplaylist_ptr> toadd;
|
QList<dynplaylist_ptr> toadd;
|
||||||
toadd << s;
|
toadd << s;
|
||||||
qDebug() << "Inserted station with guid:" << s->guid();
|
qDebug() << "Inserted station with guid:" << s->guid();
|
||||||
m_stations.insert( s->guid(), s );
|
m_stations.insert( s->guid(), s );
|
||||||
|
|
||||||
qDebug() << Q_FUNC_INFO << "Collection name" << name()
|
qDebug() << Q_FUNC_INFO << "Collection name" << name()
|
||||||
<< "from source id" << source()->id()
|
<< "from source id" << source()->id()
|
||||||
<< "numplaylists:" << m_playlists.count();
|
<< "numplaylists:" << m_playlists.count();
|
||||||
emit stationsAdded( toadd );
|
emit stationsAdded( toadd );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
Collection::deletePlaylist( const Tomahawk::playlist_ptr& p )
|
Collection::deletePlaylist( const Tomahawk::playlist_ptr& p )
|
||||||
{
|
{
|
||||||
qDebug() << Q_FUNC_INFO;
|
// qDebug() << Q_FUNC_INFO;
|
||||||
|
|
||||||
QList<playlist_ptr> todelete;
|
QList<playlist_ptr> todelete;
|
||||||
todelete << p;
|
todelete << p;
|
||||||
m_playlists.remove( p->guid() );
|
m_playlists.remove( p->guid() );
|
||||||
@@ -128,7 +131,8 @@ Collection::deletePlaylist( const Tomahawk::playlist_ptr& p )
|
|||||||
void
|
void
|
||||||
Collection::deleteAutoPlaylist( const Tomahawk::dynplaylist_ptr& p )
|
Collection::deleteAutoPlaylist( const Tomahawk::dynplaylist_ptr& p )
|
||||||
{
|
{
|
||||||
qDebug() << Q_FUNC_INFO;
|
// qDebug() << Q_FUNC_INFO;
|
||||||
|
|
||||||
QList<dynplaylist_ptr> todelete;
|
QList<dynplaylist_ptr> todelete;
|
||||||
todelete << p;
|
todelete << p;
|
||||||
m_autoplaylists.remove( p->guid() );
|
m_autoplaylists.remove( p->guid() );
|
||||||
@@ -139,17 +143,19 @@ Collection::deleteAutoPlaylist( const Tomahawk::dynplaylist_ptr& p )
|
|||||||
emit autoPlaylistsDeleted( todelete );
|
emit autoPlaylistsDeleted( todelete );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
Collection::deleteStation( const dynplaylist_ptr& s )
|
Collection::deleteStation( const dynplaylist_ptr& s )
|
||||||
{
|
{
|
||||||
qDebug() << Q_FUNC_INFO;
|
// qDebug() << Q_FUNC_INFO;
|
||||||
|
|
||||||
QList<dynplaylist_ptr> todelete;
|
QList<dynplaylist_ptr> todelete;
|
||||||
todelete << s;
|
todelete << s;
|
||||||
m_stations.remove( s->guid() );
|
m_stations.remove( s->guid() );
|
||||||
|
|
||||||
qDebug() << Q_FUNC_INFO << "Collection name" << name()
|
qDebug() << Q_FUNC_INFO << "Collection name" << name()
|
||||||
<< "from source id" << source()->id()
|
<< "from source id" << source()->id()
|
||||||
<< "numplaylists:" << m_playlists.count();
|
<< "numplaylists:" << m_playlists.count();
|
||||||
emit stationsDeleted( todelete );
|
emit stationsDeleted( todelete );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -167,6 +173,7 @@ Collection::autoPlaylist( const QString& guid )
|
|||||||
return m_autoplaylists.value( guid, dynplaylist_ptr() );
|
return m_autoplaylists.value( guid, dynplaylist_ptr() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
dynplaylist_ptr
|
dynplaylist_ptr
|
||||||
Collection::station( const QString& guid )
|
Collection::station( const QString& guid )
|
||||||
{
|
{
|
||||||
@@ -179,8 +186,9 @@ void
|
|||||||
Collection::setPlaylists( const QList<Tomahawk::playlist_ptr>& plists )
|
Collection::setPlaylists( const QList<Tomahawk::playlist_ptr>& plists )
|
||||||
{
|
{
|
||||||
qDebug() << Q_FUNC_INFO << plists.count();
|
qDebug() << Q_FUNC_INFO << plists.count();
|
||||||
foreach ( const playlist_ptr& p, plists ) {
|
foreach ( const playlist_ptr& p, plists )
|
||||||
qDebug() << "Batch inserting playlist:" << p->guid();
|
{
|
||||||
|
// qDebug() << "Batch inserting playlist:" << p->guid();
|
||||||
m_playlists.insert( p->guid(), p );
|
m_playlists.insert( p->guid(), p );
|
||||||
}
|
}
|
||||||
emit playlistsAdded( plists );
|
emit playlistsAdded( plists );
|
||||||
@@ -192,25 +200,29 @@ Collection::setAutoPlaylists( const QList< Tomahawk::dynplaylist_ptr >& plists )
|
|||||||
{
|
{
|
||||||
qDebug() << Q_FUNC_INFO << plists.count();
|
qDebug() << Q_FUNC_INFO << plists.count();
|
||||||
|
|
||||||
foreach ( const dynplaylist_ptr& p, plists ) {
|
foreach ( const dynplaylist_ptr& p, plists )
|
||||||
qDebug() << "Batch inserting dynamic playlist:" << p->guid();
|
{
|
||||||
|
// qDebug() << "Batch inserting dynamic playlist:" << p->guid();
|
||||||
m_autoplaylists.insert( p->guid(), p );
|
m_autoplaylists.insert( p->guid(), p );
|
||||||
}
|
}
|
||||||
emit autoPlaylistsAdded( plists );
|
emit autoPlaylistsAdded( plists );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
Collection::setStations( const QList< dynplaylist_ptr >& stations )
|
Collection::setStations( const QList< dynplaylist_ptr >& stations )
|
||||||
{
|
{
|
||||||
qDebug() << Q_FUNC_INFO << stations.count();
|
qDebug() << Q_FUNC_INFO << stations.count();
|
||||||
|
|
||||||
foreach ( const dynplaylist_ptr& s, stations ) {
|
foreach ( const dynplaylist_ptr& s, stations )
|
||||||
qDebug() << "Batch inserting station:" << s->guid();
|
{
|
||||||
|
// qDebug() << "Batch inserting station:" << s->guid();
|
||||||
m_stations.insert( s->guid(), s );
|
m_stations.insert( s->guid(), s );
|
||||||
}
|
}
|
||||||
emit autoPlaylistsAdded( stations );
|
emit autoPlaylistsAdded( stations );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
Collection::setTracks( const QList<Tomahawk::query_ptr>& tracks )
|
Collection::setTracks( const QList<Tomahawk::query_ptr>& tracks )
|
||||||
{
|
{
|
||||||
@@ -227,7 +239,6 @@ Collection::delTracks( const QStringList& files )
|
|||||||
qDebug() << Q_FUNC_INFO << files.count() << name();
|
qDebug() << Q_FUNC_INFO << files.count() << name();
|
||||||
|
|
||||||
QList<Tomahawk::query_ptr> tracks;
|
QList<Tomahawk::query_ptr> tracks;
|
||||||
|
|
||||||
int i = 0;
|
int i = 0;
|
||||||
foreach ( const query_ptr& query, m_tracks )
|
foreach ( const query_ptr& query, m_tracks )
|
||||||
{
|
{
|
||||||
@@ -237,7 +248,7 @@ Collection::delTracks( const QStringList& files )
|
|||||||
{
|
{
|
||||||
if ( file == result->url() )
|
if ( file == result->url() )
|
||||||
{
|
{
|
||||||
qDebug() << Q_FUNC_INFO << "Found deleted result:" << file;
|
// qDebug() << Q_FUNC_INFO << "Found deleted result:" << file;
|
||||||
tracks << query;
|
tracks << query;
|
||||||
m_tracks.removeAt( i );
|
m_tracks.removeAt( i );
|
||||||
}
|
}
|
||||||
@@ -250,14 +261,15 @@ Collection::delTracks( const QStringList& files )
|
|||||||
emit tracksRemoved( tracks );
|
emit tracksRemoved( tracks );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
Collection::moveAutoToStation( const QString& guid )
|
Collection::moveAutoToStation( const QString& guid )
|
||||||
{
|
{
|
||||||
|
|
||||||
if( m_autoplaylists.contains( guid ) )
|
if( m_autoplaylists.contains( guid ) )
|
||||||
m_stations.insert( guid, m_autoplaylists.take( guid ) );
|
m_stations.insert( guid, m_autoplaylists.take( guid ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
Collection::moveStationToAuto( const QString& guid )
|
Collection::moveStationToAuto( const QString& guid )
|
||||||
{
|
{
|
||||||
|
@@ -122,11 +122,9 @@ ControlConnection::registerSource()
|
|||||||
Q_UNUSED( source )
|
Q_UNUSED( source )
|
||||||
Q_ASSERT( source == m_source.data() );
|
Q_ASSERT( source == m_source.data() );
|
||||||
|
|
||||||
qDebug() << Q_FUNC_INFO << "Setting avatar ... " << name() << !SipHandler::instance()->avatar( name() ).isNull();
|
// qDebug() << Q_FUNC_INFO << "Setting avatar ... " << name() << !SipHandler::instance()->avatar( name() ).isNull();
|
||||||
source->setAvatar( SipHandler::instance()->avatar( name() ) );
|
source->setAvatar( SipHandler::instance()->avatar( name() ) );
|
||||||
|
|
||||||
// .. but we'll use the shared pointer we've already made:
|
|
||||||
|
|
||||||
m_registered = true;
|
m_registered = true;
|
||||||
m_servent->registerControlConnection( this );
|
m_servent->registerControlConnection( this );
|
||||||
setupDbSyncConnection();
|
setupDbSyncConnection();
|
||||||
|
@@ -124,7 +124,7 @@ Pipeline::resolve( const QList<query_ptr>& qlist, bool prioritized )
|
|||||||
|
|
||||||
if ( m_queries_pending.contains( q ) )
|
if ( m_queries_pending.contains( q ) )
|
||||||
{
|
{
|
||||||
qDebug() << "Already queued for resolving:" << q->toString();
|
// qDebug() << "Already queued for resolving:" << q->toString();
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -192,15 +192,13 @@ Pipeline::reportResults( QID qid, const QList< result_ptr >& results )
|
|||||||
|
|
||||||
if ( q->solved() )
|
if ( q->solved() )
|
||||||
{
|
{
|
||||||
qDebug() << "FINISHED RESOLVING EARLY" << q->toString();
|
// qDebug() << "FINISHED RESOLVING EARLY" << q->toString();
|
||||||
q->onResolvingFinished();
|
q->onResolvingFinished();
|
||||||
|
|
||||||
setQIDState( q, 0 );
|
setQIDState( q, 0 );
|
||||||
if ( m_qidsTimeout.contains( q->id() ) )
|
if ( m_qidsTimeout.contains( q->id() ) )
|
||||||
m_qidsTimeout.remove( q->id() );
|
m_qidsTimeout.remove( q->id() );
|
||||||
|
|
||||||
qDebug() << "Queries running:" << m_qidsState.count();
|
|
||||||
|
|
||||||
shuntNext();
|
shuntNext();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -214,7 +212,6 @@ Pipeline::reportResults( QID qid, const QList< result_ptr >& results )
|
|||||||
if ( m_qidsTimeout.contains( q->id() ) )
|
if ( m_qidsTimeout.contains( q->id() ) )
|
||||||
m_qidsTimeout.remove( q->id() );
|
m_qidsTimeout.remove( q->id() );
|
||||||
|
|
||||||
qDebug() << "Queries running:" << m_qidsState.count();
|
|
||||||
shuntNext();
|
shuntNext();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -271,8 +268,8 @@ Pipeline::timeoutShunt( const query_ptr& q )
|
|||||||
m_qidsTimeout.remove( q->id() );
|
m_qidsTimeout.remove( q->id() );
|
||||||
shunt( q );
|
shunt( q );
|
||||||
}
|
}
|
||||||
else
|
/* else
|
||||||
qDebug() << Q_FUNC_INFO << q->toString() << "Ignoring timeout";
|
qDebug() << Q_FUNC_INFO << q->toString() << "Ignoring timeout";*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -282,7 +279,7 @@ Pipeline::shunt( const query_ptr& q )
|
|||||||
if ( !m_running )
|
if ( !m_running )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
qDebug() << Q_FUNC_INFO << q->solved() << q->toString() << q->id();
|
// qDebug() << Q_FUNC_INFO << q->solved() << q->toString() << q->id();
|
||||||
unsigned int lastweight = 0;
|
unsigned int lastweight = 0;
|
||||||
unsigned int lasttimeout = 0;
|
unsigned int lasttimeout = 0;
|
||||||
int thisResolver = 0;
|
int thisResolver = 0;
|
||||||
@@ -308,7 +305,7 @@ Pipeline::shunt( const query_ptr& q )
|
|||||||
if ( r->timeout() < lasttimeout )
|
if ( r->timeout() < lasttimeout )
|
||||||
lasttimeout = r->timeout();
|
lasttimeout = r->timeout();
|
||||||
|
|
||||||
qDebug() << "Dispatching to resolver" << r->name() << q->toString();
|
qDebug() << "Dispatching to resolver" << r->name() << q->toString() << q->solved() << q->id();
|
||||||
thisResolver = i;
|
thisResolver = i;
|
||||||
r->resolve( q );
|
r->resolve( q );
|
||||||
}
|
}
|
||||||
@@ -334,7 +331,6 @@ Pipeline::shunt( const query_ptr& q )
|
|||||||
// reached end of pipeline
|
// reached end of pipeline
|
||||||
qDebug() << "Reached end of pipeline for:" << q->toString();
|
qDebug() << "Reached end of pipeline for:" << q->toString();
|
||||||
setQIDState( q, 0 );
|
setQIDState( q, 0 );
|
||||||
qDebug() << "Queries running:" << m_qidsState.count();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
shuntNext();
|
shuntNext();
|
||||||
@@ -358,14 +354,16 @@ Pipeline::setQIDState( const Tomahawk::query_ptr& query, int state )
|
|||||||
|
|
||||||
if ( state > 0 )
|
if ( state > 0 )
|
||||||
{
|
{
|
||||||
qDebug() << Q_FUNC_INFO << "inserting to qidsstate:" << query->id() << state;
|
// qDebug() << Q_FUNC_INFO << "inserting to qidsstate:" << query->id() << state;
|
||||||
m_qidsState.insert( query->id(), state );
|
m_qidsState.insert( query->id(), state );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
qDebug() << Q_FUNC_INFO << "removing" << query->id() << state;
|
// qDebug() << Q_FUNC_INFO << "removing" << query->id() << state;
|
||||||
m_qidsState.remove( query->id() );
|
m_qidsState.remove( query->id() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
qDebug() << "Queries running:" << m_qidsState.count();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -380,9 +378,10 @@ Pipeline::incQIDState( const Tomahawk::query_ptr& query )
|
|||||||
state = m_qidsState.value( query->id() ) + 1;
|
state = m_qidsState.value( query->id() ) + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
qDebug() << Q_FUNC_INFO << "inserting to qidsstate:" << query->id() << state;
|
// qDebug() << Q_FUNC_INFO << "inserting to qidsstate:" << query->id() << state;
|
||||||
m_qidsState.insert( query->id(), state );
|
m_qidsState.insert( query->id(), state );
|
||||||
|
|
||||||
|
qDebug() << "Queries running:" << m_qidsState.count();
|
||||||
return state;
|
return state;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -398,14 +397,15 @@ Pipeline::decQIDState( const Tomahawk::query_ptr& query )
|
|||||||
int state = m_qidsState.value( query->id() ) - 1;
|
int state = m_qidsState.value( query->id() ) - 1;
|
||||||
if ( state )
|
if ( state )
|
||||||
{
|
{
|
||||||
qDebug() << Q_FUNC_INFO << "replacing" << query->id() << state;
|
// qDebug() << Q_FUNC_INFO << "replacing" << query->id() << state;
|
||||||
m_qidsState.insert( query->id(), state );
|
m_qidsState.insert( query->id(), state );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
qDebug() << Q_FUNC_INFO << "removing" << query->id() << state;
|
// qDebug() << Q_FUNC_INFO << "removing" << query->id() << state;
|
||||||
m_qidsState.remove( query->id() );
|
m_qidsState.remove( query->id() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
qDebug() << "Queries running:" << m_qidsState.count();
|
||||||
return state;
|
return state;
|
||||||
}
|
}
|
||||||
|
@@ -69,16 +69,16 @@ SipHandler::~SipHandler()
|
|||||||
const QPixmap
|
const QPixmap
|
||||||
SipHandler::avatar( const QString& name ) const
|
SipHandler::avatar( const QString& name ) const
|
||||||
{
|
{
|
||||||
qDebug() << Q_FUNC_INFO << "Getting avatar" << name << m_usernameAvatars.keys();
|
qDebug() << Q_FUNC_INFO << "Getting avatar" << name; // << m_usernameAvatars.keys();
|
||||||
if( m_usernameAvatars.contains( name ) )
|
if( m_usernameAvatars.contains( name ) )
|
||||||
{
|
{
|
||||||
qDebug() << Q_FUNC_INFO << "Getting avatar and avatar != null ";
|
// qDebug() << Q_FUNC_INFO << "Getting avatar and avatar != null ";
|
||||||
Q_ASSERT(!m_usernameAvatars.value( name ).isNull());
|
Q_ASSERT(!m_usernameAvatars.value( name ).isNull());
|
||||||
return m_usernameAvatars.value( name );
|
return m_usernameAvatars.value( name );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
qDebug() << Q_FUNC_INFO << "Getting avatar and avatar == null, GAAAAAH ";
|
qDebug() << Q_FUNC_INFO << "Getting avatar and avatar == null :-(";
|
||||||
return QPixmap();
|
return QPixmap();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -601,10 +601,10 @@ SipHandler::onStateChanged( SipPlugin::ConnectionState state )
|
|||||||
void
|
void
|
||||||
SipHandler::onAvatarReceived( const QString& from, const QPixmap& avatar )
|
SipHandler::onAvatarReceived( const QString& from, const QPixmap& avatar )
|
||||||
{
|
{
|
||||||
qDebug() << Q_FUNC_INFO << " setting avatar on source for " << from;
|
// qDebug() << Q_FUNC_INFO << "setting avatar on source for" << from;
|
||||||
if ( avatar.isNull() )
|
if ( avatar.isNull() )
|
||||||
{
|
{
|
||||||
qDebug() << Q_FUNC_INFO << " got null pixmap, not adding anything";
|
// qDebug() << Q_FUNC_INFO << "got null pixmap, not adding anything";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -616,22 +616,22 @@ SipHandler::onAvatarReceived( const QString& from, const QPixmap& avatar )
|
|||||||
ControlConnection *conn = Servent::instance()->lookupControlConnection( from );
|
ControlConnection *conn = Servent::instance()->lookupControlConnection( from );
|
||||||
if( conn )
|
if( conn )
|
||||||
{
|
{
|
||||||
qDebug() << Q_FUNC_INFO << from << "got control connection";
|
// qDebug() << Q_FUNC_INFO << from << "got control connection";
|
||||||
Tomahawk::source_ptr source = conn->source();
|
Tomahawk::source_ptr source = conn->source();
|
||||||
if( source )
|
if( source )
|
||||||
{
|
{
|
||||||
|
|
||||||
qDebug() << Q_FUNC_INFO << from << "got source, setting avatar";
|
// qDebug() << Q_FUNC_INFO << from << "got source, setting avatar";
|
||||||
source->setAvatar( avatar );
|
source->setAvatar( avatar );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
qDebug() << Q_FUNC_INFO << from << "no source found, not setting avatar";
|
// qDebug() << Q_FUNC_INFO << from << "no source found, not setting avatar";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
qDebug() << Q_FUNC_INFO << from << "no control connection setup yet";
|
// qDebug() << Q_FUNC_INFO << from << "no control connection setup yet";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -639,7 +639,7 @@ SipHandler::onAvatarReceived( const QString& from, const QPixmap& avatar )
|
|||||||
void
|
void
|
||||||
SipHandler::onAvatarReceived( const QPixmap& avatar )
|
SipHandler::onAvatarReceived( const QPixmap& avatar )
|
||||||
{
|
{
|
||||||
qDebug() << Q_FUNC_INFO << "Set own avatar on MyCollection";
|
// qDebug() << Q_FUNC_INFO << "Set own avatar on MyCollection";
|
||||||
SourceList::instance()->getLocal()->setAvatar( avatar );
|
SourceList::instance()->getLocal()->setAvatar( avatar );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -84,7 +84,7 @@ SipInfo::clear()
|
|||||||
bool
|
bool
|
||||||
SipInfo::isValid() const
|
SipInfo::isValid() const
|
||||||
{
|
{
|
||||||
qDebug() << Q_FUNC_INFO << d->visible << d->host.hostName() << d->port << d->uniqname << d->key;
|
// qDebug() << Q_FUNC_INFO << d->visible << d->host.hostName() << d->port << d->uniqname << d->key;
|
||||||
if( !d->visible.isNull() )
|
if( !d->visible.isNull() )
|
||||||
{
|
{
|
||||||
if(
|
if(
|
||||||
|
@@ -42,7 +42,7 @@ WelcomePlaylistModel::WelcomePlaylistModel( QObject* parent )
|
|||||||
void
|
void
|
||||||
WelcomePlaylistModel::loadFromSettings()
|
WelcomePlaylistModel::loadFromSettings()
|
||||||
{
|
{
|
||||||
qDebug() << Q_FUNC_INFO;
|
// qDebug() << Q_FUNC_INFO;
|
||||||
if( !m_waitingForSome )
|
if( !m_waitingForSome )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -54,7 +54,7 @@ WelcomePlaylistModel::loadFromSettings()
|
|||||||
|
|
||||||
for( int i = playlist_guids.size() - 1; i >= 0; i-- )
|
for( int i = playlist_guids.size() - 1; i >= 0; i-- )
|
||||||
{
|
{
|
||||||
qDebug() << "loading playlist" << playlist_guids[i];
|
// qDebug() << "loading playlist" << playlist_guids[i];
|
||||||
|
|
||||||
playlist_ptr pl = m_cached.value( playlist_guids[i], playlist_ptr() );
|
playlist_ptr pl = m_cached.value( playlist_guids[i], playlist_ptr() );
|
||||||
if( pl.isNull() )
|
if( pl.isNull() )
|
||||||
|
@@ -81,14 +81,14 @@ void AvatarManager::onNewIq(const Jreen::IQ& iq, int context)
|
|||||||
{
|
{
|
||||||
iq.accept();
|
iq.accept();
|
||||||
|
|
||||||
qDebug() << Q_FUNC_INFO << "Got vcard from " << iq.from().full();
|
// qDebug() << Q_FUNC_INFO << "Got vcard from " << iq.from().full();
|
||||||
|
|
||||||
QString id = iq.from().full();
|
QString id = iq.from().full();
|
||||||
QString avatarHash;
|
QString avatarHash;
|
||||||
|
|
||||||
const Jreen::VCard::Photo &photo = vcard->photo();
|
const Jreen::VCard::Photo &photo = vcard->photo();
|
||||||
if (!photo.data().isEmpty()) {
|
if (!photo.data().isEmpty()) {
|
||||||
qDebug() << "vcard: got photo data" << id;
|
// qDebug() << "vcard: got photo data" << id;
|
||||||
|
|
||||||
avatarHash = QCryptographicHash::hash(photo.data(), QCryptographicHash::Sha1).toHex();
|
avatarHash = QCryptographicHash::hash(photo.data(), QCryptographicHash::Sha1).toHex();
|
||||||
|
|
||||||
@@ -110,13 +110,13 @@ void AvatarManager::onNewIq(const Jreen::IQ& iq, int context)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
qDebug() << "vcard: got no photo data" << id;
|
// qDebug() << "vcard: got no photo data" << id;
|
||||||
}
|
}
|
||||||
|
|
||||||
// got own presence
|
// got own presence
|
||||||
if ( m_client->jid().bare() == id )
|
if ( m_client->jid().bare() == id )
|
||||||
{
|
{
|
||||||
qDebug() << Q_FUNC_INFO << "got own vcard";
|
// qDebug() << Q_FUNC_INFO << "got own vcard";
|
||||||
|
|
||||||
Jreen::Presence presence = m_client->presence();
|
Jreen::Presence presence = m_client->presence();
|
||||||
Jreen::VCardUpdate::Ptr update = presence.findExtension<Jreen::VCardUpdate>();
|
Jreen::VCardUpdate::Ptr update = presence.findExtension<Jreen::VCardUpdate>();
|
||||||
@@ -167,5 +167,5 @@ bool AvatarManager::isCached(const QString &avatarHash) const
|
|||||||
|
|
||||||
void AvatarManager::onNewAvatar(const QString& jid)
|
void AvatarManager::onNewAvatar(const QString& jid)
|
||||||
{
|
{
|
||||||
qDebug() << Q_FUNC_INFO << "Found new Avatar..." << jid;
|
// qDebug() << Q_FUNC_INFO << "Found new Avatar..." << jid;
|
||||||
}
|
}
|
||||||
|
@@ -219,10 +219,7 @@ JabberPlugin::connectPlugin( bool startup )
|
|||||||
return true; //FIXME: should i return false here?!
|
return true; //FIXME: should i return false here?!
|
||||||
}
|
}
|
||||||
|
|
||||||
qDebug() << "Connecting to the XMPP server...";
|
qDebug() << "Connecting to the XMPP server..." << m_client->jid().full();
|
||||||
|
|
||||||
qDebug() << m_client->jid().full();
|
|
||||||
qDebug() << m_client->server() << m_client->port();
|
|
||||||
|
|
||||||
//FIXME: we're badly workarounding some missing reconnection api here, to be fixed soon
|
//FIXME: we're badly workarounding some missing reconnection api here, to be fixed soon
|
||||||
QTimer::singleShot( 1000, m_client, SLOT( connectToServer() ) );
|
QTimer::singleShot( 1000, m_client, SLOT( connectToServer() ) );
|
||||||
@@ -263,7 +260,7 @@ JabberPlugin::disconnectPlugin()
|
|||||||
void
|
void
|
||||||
JabberPlugin::onConnect()
|
JabberPlugin::onConnect()
|
||||||
{
|
{
|
||||||
qDebug() << Q_FUNC_INFO;
|
// qDebug() << Q_FUNC_INFO;
|
||||||
|
|
||||||
// update jid resource, servers like gtalk use resource binding and may
|
// update jid resource, servers like gtalk use resource binding and may
|
||||||
// have changed our requested /resource
|
// have changed our requested /resource
|
||||||
@@ -273,7 +270,7 @@ JabberPlugin::onConnect()
|
|||||||
emit jidChanged( m_client->jid().full() );
|
emit jidChanged( m_client->jid().full() );
|
||||||
}
|
}
|
||||||
|
|
||||||
qDebug() << "Connected as:" << m_client->jid().full();
|
qDebug() << "Connected to jabber as:" << m_client->jid().full();
|
||||||
|
|
||||||
// set presence to least valid value
|
// set presence to least valid value
|
||||||
m_client->setPresence(Jreen::Presence::XA, "Got Tomahawk? http://gettomahawk.com", -127);
|
m_client->setPresence(Jreen::Presence::XA, "Got Tomahawk? http://gettomahawk.com", -127);
|
||||||
@@ -439,7 +436,6 @@ JabberPlugin::sendMsg(const QString& to, const QString& msg)
|
|||||||
sipMessage = new TomahawkSipMessage();
|
sipMessage = new TomahawkSipMessage();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
qDebug() << "Send sip messsage to " << to;
|
qDebug() << "Send sip messsage to " << to;
|
||||||
Jreen::IQ iq( Jreen::IQ::Set, to );
|
Jreen::IQ iq( Jreen::IQ::Set, to );
|
||||||
iq.addExtension( sipMessage );
|
iq.addExtension( sipMessage );
|
||||||
@@ -581,7 +577,7 @@ void JabberPlugin::onNewMessage(const Jreen::Message& message)
|
|||||||
if ( m_state != Connected )
|
if ( m_state != Connected )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
qDebug() << Q_FUNC_INFO << "message type" << message.subtype();
|
// qDebug() << Q_FUNC_INFO << "message type" << message.subtype();
|
||||||
|
|
||||||
QString from = message.from().full();
|
QString from = message.from().full();
|
||||||
QString msg = message.body();
|
QString msg = message.body();
|
||||||
@@ -626,7 +622,7 @@ void JabberPlugin::onPresenceReceived( const Jreen::RosterItem::Ptr &item, const
|
|||||||
QString fulljid( jid.full() );
|
QString fulljid( jid.full() );
|
||||||
|
|
||||||
|
|
||||||
qDebug() << Q_FUNC_INFO << "* New presence: " << fulljid << presence.subtype();
|
qDebug() << Q_FUNC_INFO << "* New presence:" << fulljid << presence.subtype();
|
||||||
|
|
||||||
if( jid == m_client->jid() )
|
if( jid == m_client->jid() )
|
||||||
return;
|
return;
|
||||||
@@ -648,8 +644,7 @@ void JabberPlugin::onPresenceReceived( const Jreen::RosterItem::Ptr &item, const
|
|||||||
*/
|
*/
|
||||||
if( caps )
|
if( caps )
|
||||||
{
|
{
|
||||||
qDebug() << Q_FUNC_INFO << fulljid << "Running tomahawk: maybe" << "caps " << caps->node()
|
qDebug() << Q_FUNC_INFO << fulljid << "Running tomahawk: maybe" << "caps " << caps->node() << "requesting disco..";
|
||||||
<< "requesting disco..";
|
|
||||||
|
|
||||||
// request disco features
|
// request disco features
|
||||||
QString node = caps->node() + '#' + caps->ver();
|
QString node = caps->node() + '#' + caps->ver();
|
||||||
@@ -670,7 +665,7 @@ void JabberPlugin::onSubscriptionReceived(const Jreen::RosterItem::Ptr& item, co
|
|||||||
if ( m_state != Connected )
|
if ( m_state != Connected )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
qDebug() << Q_FUNC_INFO << "presence type: " << presence.subtype();
|
qDebug() << Q_FUNC_INFO << "presence type:" << presence.subtype();
|
||||||
if(item)
|
if(item)
|
||||||
qDebug() << Q_FUNC_INFO << presence.from().full() << "subs" << item->subscription() << "ask" << item->ask();
|
qDebug() << Q_FUNC_INFO << presence.from().full() << "subs" << item->subscription() << "ask" << item->ask();
|
||||||
else
|
else
|
||||||
@@ -700,8 +695,6 @@ void JabberPlugin::onSubscriptionReceived(const Jreen::RosterItem::Ptr& item, co
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
qDebug() << Q_FUNC_INFO << presence.from().bare() << "open subscription request box";
|
|
||||||
|
|
||||||
// preparing the confirm box for the user
|
// preparing the confirm box for the user
|
||||||
QMessageBox *confirmBox = new QMessageBox(
|
QMessageBox *confirmBox = new QMessageBox(
|
||||||
QMessageBox::Question,
|
QMessageBox::Question,
|
||||||
@@ -734,8 +727,6 @@ JabberPlugin::onSubscriptionRequestConfirmed( int result )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
qDebug() << Q_FUNC_INFO << "box confirmed for" << jid.bare();
|
|
||||||
|
|
||||||
// we got an answer, deleting the box
|
// we got an answer, deleting the box
|
||||||
m_subscriptionConfirmBoxes.remove( jid );
|
m_subscriptionConfirmBoxes.remove( jid );
|
||||||
sender()->deleteLater();
|
sender()->deleteLater();
|
||||||
@@ -762,7 +753,7 @@ void JabberPlugin::onNewIq(const Jreen::IQ& iq, int context)
|
|||||||
|
|
||||||
if( context == RequestDisco )
|
if( context == RequestDisco )
|
||||||
{
|
{
|
||||||
qDebug() << Q_FUNC_INFO << "Received disco IQ...";
|
// qDebug() << Q_FUNC_INFO << "Received disco IQ...";
|
||||||
Jreen::Disco::Info *discoInfo = iq.findExtension<Jreen::Disco::Info>().data();
|
Jreen::Disco::Info *discoInfo = iq.findExtension<Jreen::Disco::Info>().data();
|
||||||
if(!discoInfo)
|
if(!discoInfo)
|
||||||
return;
|
return;
|
||||||
@@ -809,7 +800,7 @@ void JabberPlugin::onNewIq(const Jreen::IQ& iq, int context)
|
|||||||
{
|
{
|
||||||
qDebug() << "Sent IQ(Set), what should be happening here?";
|
qDebug() << "Sent IQ(Set), what should be happening here?";
|
||||||
}
|
}
|
||||||
else if(context == SipMessageSent )
|
else if( context == SipMessageSent )
|
||||||
{
|
{
|
||||||
qDebug() << "Sent SipMessage... what now?!";
|
qDebug() << "Sent SipMessage... what now?!";
|
||||||
}
|
}
|
||||||
@@ -819,18 +810,13 @@ void JabberPlugin::onNewIq(const Jreen::IQ& iq, int context)
|
|||||||
}*/
|
}*/
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
||||||
TomahawkSipMessage *sipMessage = iq.findExtension<TomahawkSipMessage>().data();
|
TomahawkSipMessage *sipMessage = iq.findExtension<TomahawkSipMessage>().data();
|
||||||
if(sipMessage)
|
if(sipMessage)
|
||||||
{
|
{
|
||||||
iq.accept();
|
iq.accept();
|
||||||
|
|
||||||
qDebug() << Q_FUNC_INFO << "Got SipMessage ...";
|
qDebug() << Q_FUNC_INFO << "Got SipMessage ..."
|
||||||
qDebug() << Q_FUNC_INFO << "ip" << sipMessage->ip();
|
<< "ip" << sipMessage->ip() << "port" << sipMessage->port() << "uniqname" << sipMessage->uniqname() << "key" << sipMessage->key() << "visible" << sipMessage->visible();
|
||||||
qDebug() << Q_FUNC_INFO << "port" << sipMessage->port();
|
|
||||||
qDebug() << Q_FUNC_INFO << "uniqname" << sipMessage->uniqname();
|
|
||||||
qDebug() << Q_FUNC_INFO << "key" << sipMessage->key();
|
|
||||||
qDebug() << Q_FUNC_INFO << "visible" << sipMessage->visible();
|
|
||||||
|
|
||||||
SipInfo info;
|
SipInfo info;
|
||||||
info.setVisible( sipMessage->visible() );
|
info.setVisible( sipMessage->visible() );
|
||||||
@@ -920,7 +906,7 @@ void JabberPlugin::handlePeerStatus(const Jreen::JID& jid, Jreen::Presence::Type
|
|||||||
|
|
||||||
void JabberPlugin::onNewAvatar(const QString& jid)
|
void JabberPlugin::onNewAvatar(const QString& jid)
|
||||||
{
|
{
|
||||||
qDebug() << Q_FUNC_INFO << jid;
|
// qDebug() << Q_FUNC_INFO << jid;
|
||||||
if ( m_state != Connected )
|
if ( m_state != Connected )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
#include "tomahawksipmessagefactory.h"
|
#include "tomahawksipmessagefactory.h"
|
||||||
//#include "util.h"
|
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
#include <QXmlStreamWriter>
|
#include <QXmlStreamWriter>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
@@ -43,7 +43,7 @@ void TomahawkSipMessageFactory::handleStartElement(const QStringRef &name, const
|
|||||||
} else if (m_depth == 2) {
|
} else if (m_depth == 2) {
|
||||||
if (name == QLatin1String("transport"))
|
if (name == QLatin1String("transport"))
|
||||||
{
|
{
|
||||||
qDebug() << "Found Transport";
|
// qDebug() << "Found Transport";
|
||||||
m_state = AtTransport;
|
m_state = AtTransport;
|
||||||
|
|
||||||
m_uniqname = attributes.value(QLatin1String("uniqname")).toString();
|
m_uniqname = attributes.value(QLatin1String("uniqname")).toString();
|
||||||
@@ -53,7 +53,7 @@ void TomahawkSipMessageFactory::handleStartElement(const QStringRef &name, const
|
|||||||
if (name == QLatin1String("candidate"))
|
if (name == QLatin1String("candidate"))
|
||||||
{
|
{
|
||||||
m_state = AtCandidate;
|
m_state = AtCandidate;
|
||||||
qDebug() << "Found candidate";
|
// qDebug() << "Found candidate";
|
||||||
m_ip = attributes.value(QLatin1String("ip")).toString();
|
m_ip = attributes.value(QLatin1String("ip")).toString();
|
||||||
m_port = attributes.value(QLatin1String("port")).toString().toInt();
|
m_port = attributes.value(QLatin1String("port")).toString().toInt();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user