1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-05 21:57:41 +02:00

* Cleaned up debug output, lots.

This commit is contained in:
Christian Muehlhaeuser
2011-04-04 07:59:32 +02:00
parent f78df2c087
commit 3ba36fc38e
10 changed files with 36 additions and 47 deletions

View File

@@ -6,6 +6,8 @@ Version 0.0.3:
speeds up importing sources a lot. speeds up importing sources a lot.
* Faster painting of playlists with lots of unresolved tracks. * Faster painting of playlists with lots of unresolved tracks.
* The tomahawk:// protocol handler works on Windows now. * The tomahawk:// protocol handler works on Windows now.
* Fixed launching Tomahawk from Installer with administrative permissions.
* Prefer local results when results' score is equal.
Version 0.0.2: Version 0.0.2:
* Don't reconnect to Jabber if the settings dialog is closed successfully * Don't reconnect to Jabber if the settings dialog is closed successfully

View File

@@ -52,9 +52,9 @@ DatabaseCommand_LoadDynamicPlaylist::exec( DatabaseImpl* dbi )
QList< QVariantMap > controls; QList< QVariantMap > controls;
QString playlist_guid; QString playlist_guid;
qDebug() << "Loading controls..." << revisionGuid(); qDebug() << "Loading controls..." << revisionGuid();
qDebug() << "SELECT playlist_revision.playlist, controls, plmode, pltype " // qDebug() << "SELECT playlist_revision.playlist, controls, plmode, pltype "
"FROM dynamic_playlist_revision, playlist_revision " // "FROM dynamic_playlist_revision, playlist_revision "
"WHERE dynamic_playlist_revision.guid = "<< revisionGuid() << " AND playlist_revision.guid = dynamic_playlist_revision.guid"; // "WHERE dynamic_playlist_revision.guid = "<< revisionGuid() << " AND playlist_revision.guid = dynamic_playlist_revision.guid";
if( controlsQuery.first() ) if( controlsQuery.first() )
{ {
playlist_guid = controlsQuery.value( 0 ).toString(); playlist_guid = controlsQuery.value( 0 ).toString();

View File

@@ -45,7 +45,7 @@ DatabaseCommand_LoadPlaylistEntries::generateEntries( DatabaseImpl* dbi )
query_entries.bindValue( ":guid", m_revguid ); query_entries.bindValue( ":guid", m_revguid );
query_entries.exec(); query_entries.exec();
qDebug() << "trying to load entries:" << m_revguid; // qDebug() << "trying to load entries:" << m_revguid;
QString prevrev; QString prevrev;
QJson::Parser parser; bool ok; QJson::Parser parser; bool ok;
@@ -55,7 +55,6 @@ DatabaseCommand_LoadPlaylistEntries::generateEntries( DatabaseImpl* dbi )
QVariant v = parser.parse( query_entries.value(0).toByteArray(), &ok ); QVariant v = parser.parse( query_entries.value(0).toByteArray(), &ok );
Q_ASSERT( ok && v.type() == QVariant::List ); //TODO Q_ASSERT( ok && v.type() == QVariant::List ); //TODO
m_guids = v.toStringList(); m_guids = v.toStringList();
// qDebug() << "Entries:" << guids;
QString inclause = QString("('%1')").arg(m_guids.join("', '")); QString inclause = QString("('%1')").arg(m_guids.join("', '"));
@@ -115,5 +114,5 @@ DatabaseCommand_LoadPlaylistEntries::generateEntries( DatabaseImpl* dbi )
m_islatest = query_entries_old.value( 1 ).toBool(); m_islatest = query_entries_old.value( 1 ).toBool();
} }
qDebug() << Q_FUNC_INFO << "entrymap:" << m_entrymap; // qDebug() << Q_FUNC_INFO << "entrymap:" << m_entrymap;
} }

View File

@@ -62,16 +62,12 @@ Connection::Connection( Servent* parent )
Connection::~Connection() Connection::~Connection()
{ {
qDebug() << "DTOR connection (super)" << id() << thread(); qDebug() << "DTOR connection (super)" << id() << thread() << m_sock.isNull();
if( !m_sock.isNull() ) if( !m_sock.isNull() )
{ {
qDebug() << "deleteLatering sock" << m_sock; // qDebug() << "deleteLatering sock" << m_sock;
m_sock->deleteLater(); m_sock->deleteLater();
} }
else
{
qDebug() << "no valid sock to delete";
}
delete m_statstimer; delete m_statstimer;
} }
@@ -118,7 +114,7 @@ Connection::setFirstMessage( msg_ptr m )
void void
Connection::shutdown( bool waitUntilSentAll ) Connection::shutdown( bool waitUntilSentAll )
{ {
qDebug() << Q_FUNC_INFO << waitUntilSentAll; qDebug() << Q_FUNC_INFO << waitUntilSentAll << id();
if ( m_do_shutdown ) if ( m_do_shutdown )
{ {
//qDebug() << id() << " already shutting down"; //qDebug() << id() << " already shutting down";
@@ -128,7 +124,7 @@ Connection::shutdown( bool waitUntilSentAll )
m_do_shutdown = true; m_do_shutdown = true;
if ( !waitUntilSentAll ) if ( !waitUntilSentAll )
{ {
qDebug() << "Shutting down immediately " << id(); // qDebug() << "Shutting down immediately " << id();
actualShutdown(); actualShutdown();
} }
else else
@@ -146,10 +142,9 @@ Connection::shutdown( bool waitUntilSentAll )
void void
Connection::actualShutdown() Connection::actualShutdown()
{ {
qDebug() << Q_FUNC_INFO; qDebug() << Q_FUNC_INFO << m_actually_shutting_down << id();
if( m_actually_shutting_down ) if( m_actually_shutting_down )
{ {
qDebug() << "(already actually shutting down)";
return; return;
} }
m_actually_shutting_down = true; m_actually_shutting_down = true;
@@ -159,7 +154,7 @@ Connection::actualShutdown()
m_sock->disconnectFromHost(); m_sock->disconnectFromHost();
} }
qDebug() << "EMITTING finished()"; // qDebug() << "EMITTING finished()";
emit finished(); emit finished();
} }

View File

@@ -75,7 +75,7 @@ DBSyncConnection::~DBSyncConnection()
void void
DBSyncConnection::idleTimeout() DBSyncConnection::idleTimeout()
{ {
qDebug() << Q_FUNC_INFO << "*************"; qDebug() << Q_FUNC_INFO;
shutdown( true ); shutdown( true );
} }
@@ -87,11 +87,6 @@ DBSyncConnection::changeState( State newstate )
m_state = newstate; m_state = newstate;
qDebug() << "DBSYNC State changed from" << s << "to" << newstate; qDebug() << "DBSYNC State changed from" << s << "to" << newstate;
emit stateChanged( newstate, s, "" ); emit stateChanged( newstate, s, "" );
if ( newstate == SYNCED )
{
qDebug() << "Synced :)";
}
} }
@@ -197,7 +192,7 @@ DBSyncConnection::handleMsg( msg_ptr msg )
msg->is( Msg::DBOP ) && msg->is( Msg::DBOP ) &&
msg->payload() == "ok" ) msg->payload() == "ok" )
{ {
qDebug() << "No ops to apply, we are synced."; // qDebug() << "No ops to apply, we are synced.";
changeState( SYNCED ); changeState( SYNCED );
// calc the collection stats, to updates the "X tracks" in the sidebar etc // calc the collection stats, to updates the "X tracks" in the sidebar etc
// this is done automatically if you run a dbcmd to add files. // this is done automatically if you run a dbcmd to add files.

View File

@@ -102,7 +102,7 @@ Pipeline::resolve( const QList<query_ptr>& qlist, bool prioritized )
int i = 0; int i = 0;
foreach( const query_ptr& q, qlist ) foreach( const query_ptr& q, qlist )
{ {
qDebug() << Q_FUNC_INFO << (qlonglong)q.data() << q->toString(); // qDebug() << Q_FUNC_INFO << (qlonglong)q.data() << q->toString();
if ( !m_qids.contains( q->id() ) ) if ( !m_qids.contains( q->id() ) )
{ {
m_qids.insert( q->id(), q ); m_qids.insert( q->id(), q );
@@ -189,7 +189,7 @@ Pipeline::reportResults( QID qid, const QList< result_ptr >& results )
if ( decQIDState( q ) == 0 ) if ( decQIDState( q ) == 0 )
{ {
// All resolvers have reported back their results for this query now // All resolvers have reported back their results for this query now
qDebug() << "Finished resolving:" << q->toString(); qDebug() << "Finished resolving:" << q->toString() << q->numResults();
if ( !q->solved() ) if ( !q->solved() )
q->onResolvingFinished(); q->onResolvingFinished();
@@ -216,7 +216,7 @@ Pipeline::shuntNext()
return; return;
} }
qDebug() << Q_FUNC_INFO << m_qidsState.count(); // qDebug() << Q_FUNC_INFO << m_qidsState.count();
// Check if we are ready to dispatch more queries // Check if we are ready to dispatch more queries
if ( m_qidsState.count() >= CONCURRENT_QUERIES ) if ( m_qidsState.count() >= CONCURRENT_QUERIES )
return; return;
@@ -246,8 +246,8 @@ Pipeline::shunt( const query_ptr& q )
if ( q->solved() ) if ( q->solved() )
{ {
qDebug() << "Query solved, pipeline aborted:" << q->toString() // qDebug() << "Query solved, pipeline aborted:" << q->toString()
<< "numresults:" << q->results().length(); // << "numresults:" << q->results().length();
QList< result_ptr > rl; QList< result_ptr > rl;
reportResults( q->id(), rl ); reportResults( q->id(), rl );
@@ -275,7 +275,7 @@ Pipeline::shunt( const query_ptr& q )
lasttimeout = r->timeout(); lasttimeout = r->timeout();
// resolvers aren't allowed to block in this call: // resolvers aren't allowed to block in this call:
qDebug() << "Dispatching to resolver" << r->name(); qDebug() << "Dispatching to resolver" << r->name() << q->toString();
thisResolver = i; thisResolver = i;
r->resolve( q ); r->resolve( q );
@@ -291,7 +291,7 @@ Pipeline::shunt( const query_ptr& q )
if ( thisResolver < m_resolvers.count() ) if ( thisResolver < m_resolvers.count() )
{ {
incQIDState( q ); incQIDState( q );
qDebug() << "Shunting in" << lasttimeout << "ms, q:" << q->toString(); // qDebug() << "Shunting in" << lasttimeout << "ms, q:" << q->toString();
new FuncTimeout( lasttimeout, boost::bind( &Pipeline::shunt, this, q ) ); new FuncTimeout( lasttimeout, boost::bind( &Pipeline::shunt, this, q ) );
} }
} }
@@ -329,7 +329,7 @@ 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 );
return state; return state;
@@ -344,12 +344,12 @@ 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() );
} }

View File

@@ -112,7 +112,7 @@ Playlist::Playlist( const source_ptr& src,
, m_lastmodified( lastmod ) , m_lastmodified( lastmod )
, m_shared( shared ) , m_shared( shared )
{ {
qDebug() << Q_FUNC_INFO << "1"; // qDebug() << Q_FUNC_INFO << "1";
init(); init();
} }

View File

@@ -253,8 +253,8 @@ DynamicPlaylist::reportCreated( const Tomahawk::dynplaylist_ptr& self )
Q_ASSERT( !author().isNull() ); Q_ASSERT( !author().isNull() );
Q_ASSERT( !author()->collection().isNull() ); Q_ASSERT( !author()->collection().isNull() );
// will emit Collection::playlistCreated(...) // will emit Collection::playlistCreated(...)
qDebug() << "Creating dynplaylist belonging to:" << author().data() << author().isNull(); // qDebug() << "Creating dynplaylist belonging to:" << author().data() << author().isNull();
qDebug() << "REPORTING DYNAMIC PLAYLIST CREATED:" << this << author()->friendlyName(); // qDebug() << "REPORTING DYNAMIC PLAYLIST CREATED:" << this << author()->friendlyName();
author()->collection()->addDynamicPlaylist( self ); author()->collection()->addDynamicPlaylist( self );
} }
@@ -431,7 +431,7 @@ QList< dyncontrol_ptr > DynamicPlaylist::variantsToControl( const QList< QVarian
QList<dyncontrol_ptr> realControls; QList<dyncontrol_ptr> realControls;
foreach( QVariantMap controlV, controlsV ) { foreach( QVariantMap controlV, controlsV ) {
dyncontrol_ptr control = GeneratorFactory::createControl( controlV.value( "type" ).toString(), controlV.value( "selectedType" ).toString() ); dyncontrol_ptr control = GeneratorFactory::createControl( controlV.value( "type" ).toString(), controlV.value( "selectedType" ).toString() );
qDebug() << "CReating control with data:" << controlV; qDebug() << "Creating control with data:" << controlV;
QJson::QObjectHelper::qvariant2qobject( controlV, control.data() ); QJson::QObjectHelper::qvariant2qobject( controlV, control.data() );
realControls << control; realControls << control;
} }

View File

@@ -83,7 +83,7 @@ AnimatedSplitter::hide( int index, bool animate )
emit hidden( w ); emit hidden( w );
w->setMinimumHeight( minHeight ); w->setMinimumHeight( minHeight );
qDebug() << "animating to:" << w->height() << "from" << minHeight; // qDebug() << "animating to:" << w->height() << "from" << minHeight;
m_animateForward = false; m_animateForward = false;
if ( animate ) if ( animate )

View File

@@ -56,7 +56,7 @@ Jabber_p::Jabber_p( const QString& jid, const QString& password, const QString&
if( m_jid.resource().find( "tomahawk" ) == std::string::npos ) if( m_jid.resource().find( "tomahawk" ) == std::string::npos )
{ {
qDebug() << "!!! Setting your resource to 'tomahawk' prior to logging in to jabber"; // qDebug() << "!!! Setting your resource to 'tomahawk' prior to logging in to jabber";
m_jid.setResource( QString( "tomahawk%1" ).arg( qrand() ).toStdString() ); m_jid.setResource( QString( "tomahawk%1" ).arg( qrand() ).toStdString() );
} }
@@ -210,8 +210,8 @@ Jabber_p::sendMsg( const QString& to, const QString& msg )
{ {
if ( QThread::currentThread() != thread() ) if ( QThread::currentThread() != thread() )
{ {
qDebug() << Q_FUNC_INFO << "invoking in correct thread, not" // qDebug() << Q_FUNC_INFO << "invoking in correct thread, not"
<< QThread::currentThread(); // << QThread::currentThread();
QMetaObject::invokeMethod( this, "sendMsg", QMetaObject::invokeMethod( this, "sendMsg",
Qt::QueuedConnection, Qt::QueuedConnection,
@@ -277,7 +277,7 @@ Jabber_p::addContact( const QString& jid, const QString& msg )
void void
Jabber_p::onConnect() Jabber_p::onConnect()
{ {
qDebug() << "Connected to the XMPP server"; qDebug() << "Connected to the XMPP server" << m_jid.full().c_str();
// 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
if ( m_client->resource() != m_jid.resource() ) if ( m_client->resource() != m_jid.resource() )
@@ -287,7 +287,6 @@ Jabber_p::onConnect()
emit jidChanged( jidstr ); emit jidChanged( jidstr );
} }
qDebug() << "Connected as:" << m_jid.full().c_str();
emit connected(); emit connected();
} }
@@ -516,7 +515,7 @@ Jabber_p::handleRoster( const Roster& roster )
for ( ; it != roster.end(); ++it ) for ( ; it != roster.end(); ++it )
{ {
if ( (*it).second->subscription() != S10nBoth ) continue; if ( (*it).second->subscription() != S10nBoth ) continue;
qDebug() << (*it).second->jid().c_str() << (*it).second->name().c_str(); // qDebug() << (*it).second->jid().c_str() << (*it).second->name().c_str();
//printf("JID: %s\n", (*it).second->jid().c_str()); //printf("JID: %s\n", (*it).second->jid().c_str());
} }
@@ -539,8 +538,6 @@ Jabber_p::handlePresence( const gloox::Presence& presence )
JID jid = presence.from(); JID jid = presence.from();
QString fulljid( jid.full().c_str() ); QString fulljid( jid.full().c_str() );
qDebug() << "* handleRosterPresence" << fulljid << presence.subtype();
if( jid == m_jid ) if( jid == m_jid )
return; return;
@@ -562,6 +559,7 @@ Jabber_p::handlePresence( const gloox::Presence& presence )
return; return;
} }
qDebug() << "* handleRosterPresence" << fulljid << presence.subtype();
//qDebug() << "handling presence for resource of" << res; //qDebug() << "handling presence for resource of" << res;
//qDebug() << Q_FUNC_INFO << "jid:" << QString::fromStdString(item.jid()) //qDebug() << Q_FUNC_INFO << "jid:" << QString::fromStdString(item.jid())