diff --git a/src/libtomahawk/network/servent.cpp b/src/libtomahawk/network/servent.cpp index 9fefce30e..8c3761bfa 100644 --- a/src/libtomahawk/network/servent.cpp +++ b/src/libtomahawk/network/servent.cpp @@ -341,7 +341,7 @@ Servent::readyRead() foreach( ControlConnection* con, m_controlconnections ) { - qDebug() << "conid:" << con->id(); +// qDebug() << "conid:" << con->id(); if ( con->id() == controlid ) { @@ -660,10 +660,12 @@ Servent::claimOffer( ControlConnection* cc, const QString &nodeid, const QString } } + bool Servent::checkACL( const Connection* conn, const QString &nodeid, bool showDialog ) const { qDebug() << "Checking ACLs"; + ACLSystem* aclSystem = ACLSystem::instance(); ACLSystem::ACL peerStatus = aclSystem->isAuthorizedUser( nodeid ); if( peerStatus == ACLSystem::Deny ) @@ -716,6 +718,7 @@ Servent::checkACL( const Connection* conn, const QString &nodeid, bool showDialo return true; } + QSharedPointer Servent::remoteIODeviceFactory( const result_ptr& result ) { @@ -769,7 +772,7 @@ void Servent::printCurrentTransfers() { int k = 1; - qDebug() << "~~~ Active file transfer connections:" << m_scsessions.length(); +// qDebug() << "~~~ Active file transfer connections:" << m_scsessions.length(); foreach( StreamConnection* i, m_scsessions ) { qDebug() << k << ") " << i->id(); @@ -806,10 +809,10 @@ bool Servent::connectedToSession( const QString& session ) { qDebug() << Q_FUNC_INFO; - qDebug() << "Checking against " << session; + qDebug() << "Checking against" << session; foreach( ControlConnection* cc, m_controlconnections ) { - qDebug() << "Checking session " << cc->id(); + qDebug() << "Checking session" << cc->id(); if( cc->id() == session ) return true; } @@ -857,7 +860,7 @@ Servent::getIODeviceForUrl( const Tomahawk::result_ptr& result ) const QString proto = rx.cap( 1 ); //const QString urlpart = rx.cap( 2 ); - qDebug() << "Getting IODevice for URL:" << proto << m_iofactories.contains( proto ); +// qDebug() << "Getting IODevice for URL:" << proto << m_iofactories.contains( proto ); if ( !m_iofactories.contains( proto ) ) return sp; return m_iofactories.value( proto )( result ); diff --git a/src/libtomahawk/pipeline.cpp b/src/libtomahawk/pipeline.cpp index 278c1c6e1..bddad5ae9 100644 --- a/src/libtomahawk/pipeline.cpp +++ b/src/libtomahawk/pipeline.cpp @@ -320,7 +320,7 @@ Pipeline::shunt( const query_ptr& q ) if ( thisResolver < m_resolvers.count() ) { - qDebug() << "Shunting in" << lasttimeout << "ms, q:" << q->toString(); +// qDebug() << "Shunting in" << lasttimeout << "ms, q:" << q->toString(); m_qidsTimeout.insert( q->id(), true ); new FuncTimeout( lasttimeout, boost::bind( &Pipeline::timeoutShunt, this, q ), this ); @@ -361,9 +361,8 @@ Pipeline::setQIDState( const Tomahawk::query_ptr& query, int state ) { // qDebug() << Q_FUNC_INFO << "removing" << query->id() << state; m_qidsState.remove( query->id() ); + qDebug() << "Queries running:" << m_qidsState.count(); } - - qDebug() << "Queries running:" << m_qidsState.count(); } @@ -381,7 +380,6 @@ Pipeline::incQIDState( const Tomahawk::query_ptr& query ) // qDebug() << Q_FUNC_INFO << "inserting to qidsstate:" << query->id() << state; m_qidsState.insert( query->id(), state ); - qDebug() << "Queries running:" << m_qidsState.count(); return state; } @@ -404,8 +402,8 @@ Pipeline::decQIDState( const Tomahawk::query_ptr& query ) { // qDebug() << Q_FUNC_INFO << "removing" << query->id() << state; m_qidsState.remove( query->id() ); + qDebug() << "Queries running:" << m_qidsState.count(); } - qDebug() << "Queries running:" << m_qidsState.count(); return state; } diff --git a/src/libtomahawk/playlist/dynamic/DynamicPlaylist.cpp b/src/libtomahawk/playlist/dynamic/DynamicPlaylist.cpp index a4ff2fa0a..a6d779376 100644 --- a/src/libtomahawk/playlist/dynamic/DynamicPlaylist.cpp +++ b/src/libtomahawk/playlist/dynamic/DynamicPlaylist.cpp @@ -451,7 +451,7 @@ QList< dyncontrol_ptr > DynamicPlaylist::variantsToControl( const QList< QVarian QList realControls; foreach( QVariantMap controlV, controlsV ) { 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() ); realControls << control; } diff --git a/src/resolvers/qtscriptresolver.cpp b/src/resolvers/qtscriptresolver.cpp index 53debfafc..d920ce908 100644 --- a/src/resolvers/qtscriptresolver.cpp +++ b/src/resolvers/qtscriptresolver.cpp @@ -69,12 +69,12 @@ QtScriptResolver::resolve( const Tomahawk::query_ptr& query ) { if ( QThread::currentThread() != thread() ) { - qDebug() << "Reinvoking in correct thread:" << Q_FUNC_INFO; +// qDebug() << "Reinvoking in correct thread:" << Q_FUNC_INFO; QMetaObject::invokeMethod( this, "resolve", Qt::QueuedConnection, Q_ARG(Tomahawk::query_ptr, query) ); return; } - qDebug() << Q_FUNC_INFO << query->toString(); +// qDebug() << Q_FUNC_INFO << query->toString(); QString eval = QString( "resolve( '%1', '%2', '%3', '%4' );" ) .arg( query->id().replace( "'", "\\'" ) ) .arg( query->artist().replace( "'", "\\'" ) ) @@ -92,7 +92,6 @@ QtScriptResolver::resolve( const Tomahawk::query_ptr& query ) foreach( const QVariant& rv, reslist ) { QVariantMap m = rv.toMap(); - qDebug() << "RES" << m; Tomahawk::result_ptr rp( new Tomahawk::Result() ); Tomahawk::artist_ptr ap = Tomahawk::Artist::get( 0, m.value( "artist" ).toString() ); diff --git a/src/resolvers/scriptresolver.cpp b/src/resolvers/scriptresolver.cpp index 0c57ff2cf..7a5d23fa7 100644 --- a/src/resolvers/scriptresolver.cpp +++ b/src/resolvers/scriptresolver.cpp @@ -24,7 +24,6 @@ #include "album.h" #include "pipeline.h" #include "sourcelist.h" -#include "functimeout.h" #include "utils/tomahawkutils.h" @@ -65,14 +64,15 @@ ScriptResolver::readStderr() void ScriptResolver::readStdout() { - qDebug() << Q_FUNC_INFO << m_proc.bytesAvailable(); +// qDebug() << Q_FUNC_INFO << m_proc.bytesAvailable(); + if( m_msgsize == 0 ) { if( m_proc.bytesAvailable() < 4 ) return; quint32 len_nbo; m_proc.read( (char*) &len_nbo, 4 ); m_msgsize = qFromBigEndian( len_nbo ); - qDebug() << Q_FUNC_INFO << "msgsize" << m_msgsize; +// qDebug() << Q_FUNC_INFO << "msgsize" << m_msgsize; } if( m_msgsize > 0 ) @@ -108,6 +108,7 @@ void ScriptResolver::handleMsg( const QByteArray& msg ) { qDebug() << Q_FUNC_INFO << msg.size() << QString::fromAscii( msg ); + bool ok; QVariant v = m_parser.parse( msg, &ok ); if( !ok || v.type() != QVariant::Map ) @@ -122,7 +123,9 @@ ScriptResolver::handleMsg( const QByteArray& msg ) { doSetup( m ); return; - } else if( msgtype == "confwidget" ) { + } + else if( msgtype == "confwidget" ) + { setupConfWidget( m ); return; } @@ -130,21 +133,13 @@ ScriptResolver::handleMsg( const QByteArray& msg ) if( msgtype == "results" ) { const QString qid = m.value( "qid" ).toString(); - if ( !m_queryState.contains( qid ) ) - { - //FIXME: We should always accept results, even if they arrive too late. Needs some work in Pipeline. - qDebug() << "Ignoring results for" << qid << "- arrived after timeout."; - return; - } - m_queryState.remove( qid ); - QList< Tomahawk::result_ptr > results; const QVariantList reslist = m.value( "results" ).toList(); foreach( const QVariant& rv, reslist ) { QVariantMap m = rv.toMap(); - qDebug() << "RES" << m; + qDebug() << "Found result:" << m; Tomahawk::result_ptr rp( new Tomahawk::Result() ); Tomahawk::artist_ptr ap = Tomahawk::Artist::get( 0, m.value( "artist" ).toString() ); @@ -220,9 +215,6 @@ ScriptResolver::resolve( const Tomahawk::query_ptr& query ) const QByteArray msg = m_serializer.serialize( QVariant( m ) ); qDebug() << "ASKING SCRIPT RESOLVER TO RESOLVE:" << msg; sendMsg( msg ); - - m_queryState.insert( query->id(), 1 ); - new Tomahawk::FuncTimeout( m_timeout, boost::bind( &ScriptResolver::onTimeout, this, query ), this ); } @@ -291,17 +283,3 @@ ScriptResolver::stop() qDebug() << "KILLING PROCESS!"; m_proc.kill(); } - - -void -ScriptResolver::onTimeout( const Tomahawk::query_ptr& query ) -{ - // check if this query has already been processed - if ( !m_queryState.contains( query->id() ) ) - return; - - // if not, it's time to emit an empty result list - m_queryState.remove( query->id() ); - QList< Tomahawk::result_ptr > results; - Tomahawk::Pipeline::instance()->reportResults( query->id(), results ); -} diff --git a/src/resolvers/scriptresolver.h b/src/resolvers/scriptresolver.h index 34e29fdd2..3b0da9923 100644 --- a/src/resolvers/scriptresolver.h +++ b/src/resolvers/scriptresolver.h @@ -58,8 +58,6 @@ private slots: void readStdout(); void cmdExited( int code, QProcess::ExitStatus status ); - void onTimeout( const Tomahawk::query_ptr& query ); - private: void handleMsg( const QByteArray& msg ); void sendMsg( const QByteArray& msg ); @@ -76,8 +74,6 @@ private: bool m_ready, m_stopped; - QHash< QString /* QID */, unsigned int /* state */ > m_queryState; - QJson::Parser m_parser; QJson::Serializer m_serializer; }; diff --git a/src/sip/jabber/avatarmanager.cpp b/src/sip/jabber/avatarmanager.cpp index acb926b42..204ba8c6f 100644 --- a/src/sip/jabber/avatarmanager.cpp +++ b/src/sip/jabber/avatarmanager.cpp @@ -38,7 +38,7 @@ void AvatarManager::onNewConnection() void AvatarManager::fetchVCard(const QString &jid) { - qDebug() << Q_FUNC_INFO; +// qDebug() << Q_FUNC_INFO; Jreen::IQ iq(Jreen::IQ::Get, jid ); iq.addExtension(new Jreen::VCard()); @@ -50,15 +50,15 @@ void AvatarManager::onNewPresence(const Jreen::Presence& presence) Jreen::VCardUpdate::Ptr update = presence.findExtension(); if(update) { - qDebug() << "vcard: found update for " << presence.from().full(); +// qDebug() << "vcard: found update for" << presence.from().full(); if(!isCached(update->photoHash())) { - qDebug() << presence.from().full() << "vcard: photo not cached, starting request..." << update->photoHash(); +// qDebug() << presence.from().full() << "vcard: photo not cached, starting request..." << update->photoHash(); fetchVCard( presence.from().bare() ); } else { - qDebug() << presence.from().full() << "vcard: photo already cached no request necessary " << update->photoHash(); +// qDebug() << presence.from().full() << "vcard: photo already cached no request necessary " << update->photoHash(); m_JidsAvatarHashes.insert( update->photoHash(), presence.from().bare() ); Q_ASSERT(!this->avatar(presence.from().bare()).isNull()); @@ -67,7 +67,7 @@ void AvatarManager::onNewPresence(const Jreen::Presence& presence) } else { - qDebug() << Q_FUNC_INFO << presence.from().full() << "got no statusupdateextension"; +// qDebug() << Q_FUNC_INFO << presence.from().full() << "got no statusupdateextension"; //TODO: do we want this? might fetch avatars for broken clients fetchVCard( presence.from().bare() ); diff --git a/src/sip/jabber/jabber.cpp b/src/sip/jabber/jabber.cpp index 06c9a5431..a244b5f86 100644 --- a/src/sip/jabber/jabber.cpp +++ b/src/sip/jabber/jabber.cpp @@ -621,8 +621,7 @@ void JabberPlugin::onPresenceReceived( const Jreen::RosterItem::Ptr &item, const Jreen::JID jid = presence.from(); 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() ) return; @@ -656,7 +655,7 @@ void JabberPlugin::onPresenceReceived( const Jreen::RosterItem::Ptr &item, const } else if( !caps ) { - qDebug() << Q_FUNC_INFO << "Running tomahawk: no" << "no caps"; +// qDebug() << Q_FUNC_INFO << "Running tomahawk: no" << "no caps"; } } @@ -665,7 +664,7 @@ void JabberPlugin::onSubscriptionReceived(const Jreen::RosterItem::Ptr& item, co if ( m_state != Connected ) return; - qDebug() << Q_FUNC_INFO << "presence type:" << presence.subtype(); +// qDebug() << Q_FUNC_INFO << "presence type:" << presence.subtype(); if(item) qDebug() << Q_FUNC_INFO << presence.from().full() << "subs" << item->subscription() << "ask" << item->ask(); else @@ -772,7 +771,7 @@ void JabberPlugin::onNewIq(const Jreen::IQ& iq, int context) } else { - qDebug() << Q_FUNC_INFO << jid.full() << "Running tomahawk/feature enabled: no"; +// qDebug() << Q_FUNC_INFO << jid.full() << "Running tomahawk/feature enabled: no"; //LEGACY: accept resources starting with tomahawk too if( jid.resource().startsWith("tomahawk") ) diff --git a/src/sourcetree/items/collectionitem.cpp b/src/sourcetree/items/collectionitem.cpp index 002a56966..97d7a7f42 100644 --- a/src/sourcetree/items/collectionitem.cpp +++ b/src/sourcetree/items/collectionitem.cpp @@ -146,7 +146,7 @@ CollectionItem::playlistsAddedInternal( SourceTreeItem* parent, const QList< dyn foreach( const dynplaylist_ptr& p, playlists ) { DynamicPlaylistItem* plItem = new DynamicPlaylistItem( model(), parent, p, parent->children().count() - addOffset ); - qDebug() << "Dynamic Playlist added:" << p->title() << p->creator() << p->info(); +// qDebug() << "Dynamic Playlist added:" << p->title() << p->creator() << p->info(); p->loadRevision(); items << plItem; } @@ -200,7 +200,7 @@ CollectionItem::onPlaylistsAdded( const QList< playlist_ptr >& playlists ) foreach( const playlist_ptr& p, playlists ) { PlaylistItem* plItem = new PlaylistItem( model(), m_playlists, p, m_playlists->children().count() - addOffset ); - qDebug() << "Playlist added:" << p->title() << p->creator() << p->info(); +// qDebug() << "Playlist added:" << p->title() << p->creator() << p->info(); p->loadRevision(); items << plItem; } diff --git a/src/sourcetree/items/playlistitems.cpp b/src/sourcetree/items/playlistitems.cpp index 91459bcc9..eeeaa1111 100644 --- a/src/sourcetree/items/playlistitems.cpp +++ b/src/sourcetree/items/playlistitems.cpp @@ -251,9 +251,11 @@ DynamicPlaylistItem::checkReparentHackNeeded( const DynamicPlaylistRevision& rev // HACK HACK HACK workaround for an ugly hack where we have to be compatible with older tomahawks (pre-0.1.0) that created dynplaylists as OnDemand then changed them to Static if they were static. // we need to reparent this playlist to the correct category :-/. CategoryItem* cat = qobject_cast< CategoryItem* >( parent() ); - qDebug() << "with category" << cat; - if( cat ) qDebug() << "and cat type:" << cat->categoryType(); - if( cat ) { + +// qDebug() << "with category" << cat; +// if( cat ) qDebug() << "and cat type:" << cat->categoryType(); + if( cat ) + { CategoryItem* from = cat; CategoryItem* to = 0; if( cat->categoryType() == SourcesModel::PlaylistsCategory && revision.mode == OnDemand ) { // WRONG @@ -270,7 +272,7 @@ DynamicPlaylistItem::checkReparentHackNeeded( const DynamicPlaylistRevision& rev } else if( cat->categoryType() == SourcesModel::StationsCategory && revision.mode == Static ) { // WRONG CollectionItem* col = qobject_cast< CollectionItem* >( cat->parent() ); to = col->playlistsCategory(); - qDebug() << "TRYING TO HACK TO:" << to; +// qDebug() << "TRYING TO HACK TO:" << to; if( !to ) { // you have got to be fucking kidding me int fme = col->children().count(); col->beginRowsAdded( fme, fme ); @@ -281,7 +283,7 @@ DynamicPlaylistItem::checkReparentHackNeeded( const DynamicPlaylistRevision& rev } } if( to ) { - qDebug() << "HACKING! moving dynamic playlist from" << from->text() << "to:" << to->text(); +// qDebug() << "HACKING! moving dynamic playlist from" << from->text() << "to:" << to->text(); // remove and add int idx = from->children().indexOf( this ); from->beginRowsRemoved( idx, idx );