diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 1f3990aee..6349911ad 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -72,7 +72,7 @@ SET( tomahawkSourcesGui ${tomahawkSourcesGui} accounts/lastfm/LastFmAccount.cpp accounts/lastfm/LastFmConfig.cpp - accounts/lastfm/LastFmPlugin.cpp + accounts/lastfm/LastFmInfoPlugin.cpp accounts/spotify/SpotifyAccount.cpp accounts/spotify/SpotifyAccountConfig.cpp diff --git a/src/accounts/lastfm/LastFmAccount.cpp b/src/accounts/lastfm/LastFmAccount.cpp index c781cd45c..938f66503 100644 --- a/src/accounts/lastfm/LastFmAccount.cpp +++ b/src/accounts/lastfm/LastFmAccount.cpp @@ -20,7 +20,7 @@ #include "LastFmConfig.h" #include "infosystem/InfoSystem.h" -#include "LastFmPlugin.h" +#include "LastFmInfoPlugin.h" #include "utils/TomahawkUtils.h" #include "resolvers/QtScriptResolver.h" #include "AtticaManager.h" @@ -167,7 +167,7 @@ InfoPluginPtr LastFmAccount::infoPlugin() { if ( m_infoPlugin.isNull() ) - m_infoPlugin = QWeakPointer< LastFmPlugin >( new LastFmPlugin( this ) ); + m_infoPlugin = QWeakPointer< LastFmInfoPlugin >( new LastFmInfoPlugin( this ) ); return InfoPluginPtr( m_infoPlugin.data() ); } diff --git a/src/accounts/lastfm/LastFmAccount.h b/src/accounts/lastfm/LastFmAccount.h index e7fc5adf6..90ca37737 100644 --- a/src/accounts/lastfm/LastFmAccount.h +++ b/src/accounts/lastfm/LastFmAccount.h @@ -30,7 +30,7 @@ namespace Tomahawk { class ExternalResolverGui; namespace InfoSystem { - class LastFmPlugin; + class LastFmInfoPlugin; } namespace Accounts { @@ -103,7 +103,7 @@ private: void hookupResolver(); QWeakPointer m_resolver; - QWeakPointer m_infoPlugin; + QWeakPointer m_infoPlugin; QWeakPointer m_configWidget; QPixmap m_icon; }; diff --git a/src/accounts/lastfm/LastFmPlugin.cpp b/src/accounts/lastfm/LastFmInfoPlugin.cpp similarity index 93% rename from src/accounts/lastfm/LastFmPlugin.cpp rename to src/accounts/lastfm/LastFmInfoPlugin.cpp index 67d909ae3..5803ba6ee 100644 --- a/src/accounts/lastfm/LastFmPlugin.cpp +++ b/src/accounts/lastfm/LastFmInfoPlugin.cpp @@ -17,7 +17,7 @@ * along with Tomahawk. If not, see . */ -#include "LastFmPlugin.h" +#include "LastFmInfoPlugin.h" #include #include @@ -40,7 +40,7 @@ using namespace Tomahawk::Accounts; using namespace Tomahawk::InfoSystem; -LastFmPlugin::LastFmPlugin( LastFmAccount* account ) +LastFmInfoPlugin::LastFmInfoPlugin( LastFmAccount* account ) : InfoPlugin() , m_account( account ) , m_scrobbler( 0 ) @@ -51,7 +51,7 @@ LastFmPlugin::LastFmPlugin( LastFmAccount* account ) void -LastFmPlugin::init() +LastFmInfoPlugin::init() { if ( Tomahawk::InfoSystem::InfoSystem::instance()->workerThread() && thread() != Tomahawk::InfoSystem::InfoSystem::instance()->workerThread().data() ) { @@ -84,7 +84,7 @@ LastFmPlugin::init() } -LastFmPlugin::~LastFmPlugin() +LastFmInfoPlugin::~LastFmInfoPlugin() { qDebug() << Q_FUNC_INFO; delete m_scrobbler; @@ -93,7 +93,7 @@ LastFmPlugin::~LastFmPlugin() void -LastFmPlugin::dataError( Tomahawk::InfoSystem::InfoRequestData requestData ) +LastFmInfoPlugin::dataError( Tomahawk::InfoSystem::InfoRequestData requestData ) { emit info( requestData, QVariant() ); return; @@ -101,7 +101,7 @@ LastFmPlugin::dataError( Tomahawk::InfoSystem::InfoRequestData requestData ) void -LastFmPlugin::getInfo( Tomahawk::InfoSystem::InfoRequestData requestData ) +LastFmInfoPlugin::getInfo( Tomahawk::InfoSystem::InfoRequestData requestData ) { switch ( requestData.type ) { @@ -135,7 +135,7 @@ LastFmPlugin::getInfo( Tomahawk::InfoSystem::InfoRequestData requestData ) void -LastFmPlugin::pushInfo( Tomahawk::InfoSystem::InfoPushData pushData ) +LastFmInfoPlugin::pushInfo( Tomahawk::InfoSystem::InfoPushData pushData ) { switch ( pushData.type ) { @@ -159,11 +159,11 @@ LastFmPlugin::pushInfo( Tomahawk::InfoSystem::InfoPushData pushData ) void -LastFmPlugin::nowPlaying( const QVariant &input ) +LastFmInfoPlugin::nowPlaying( const QVariant &input ) { if ( !input.canConvert< Tomahawk::InfoSystem::InfoStringHash >() || !m_scrobbler ) { - tLog() << "LastFmPlugin::nowPlaying no m_scrobbler, or cannot convert input!"; + tLog() << "LastFmInfoPlugin::nowPlaying no m_scrobbler, or cannot convert input!"; if ( !m_scrobbler ) tLog() << "No scrobbler!"; return; @@ -188,7 +188,7 @@ LastFmPlugin::nowPlaying( const QVariant &input ) void -LastFmPlugin::scrobble() +LastFmInfoPlugin::scrobble() { if ( !m_scrobbler || m_track.isNull() ) return; @@ -200,13 +200,13 @@ LastFmPlugin::scrobble() void -LastFmPlugin::sendLoveSong( const InfoType type, QVariant input ) +LastFmInfoPlugin::sendLoveSong( const InfoType type, QVariant input ) { qDebug() << Q_FUNC_INFO; if ( !input.toMap().contains( "trackinfo" ) || !input.toMap()[ "trackinfo" ].canConvert< Tomahawk::InfoSystem::InfoStringHash >() ) { - tLog() << "LastFmPlugin::nowPlaying cannot convert input!"; + tLog() << "LastFmInfoPlugin::nowPlaying cannot convert input!"; return; } @@ -236,7 +236,7 @@ LastFmPlugin::sendLoveSong( const InfoType type, QVariant input ) void -LastFmPlugin::fetchSimilarArtists( Tomahawk::InfoSystem::InfoRequestData requestData ) +LastFmInfoPlugin::fetchSimilarArtists( Tomahawk::InfoSystem::InfoRequestData requestData ) { if ( !requestData.input.canConvert< Tomahawk::InfoSystem::InfoStringHash >() ) { @@ -258,7 +258,7 @@ LastFmPlugin::fetchSimilarArtists( Tomahawk::InfoSystem::InfoRequestData request void -LastFmPlugin::fetchTopTracks( Tomahawk::InfoSystem::InfoRequestData requestData ) +LastFmInfoPlugin::fetchTopTracks( Tomahawk::InfoSystem::InfoRequestData requestData ) { if ( !requestData.input.canConvert< Tomahawk::InfoSystem::InfoStringHash >() ) { @@ -279,7 +279,7 @@ LastFmPlugin::fetchTopTracks( Tomahawk::InfoSystem::InfoRequestData requestData } void -LastFmPlugin::fetchChart( Tomahawk::InfoSystem::InfoRequestData requestData ) +LastFmInfoPlugin::fetchChart( Tomahawk::InfoSystem::InfoRequestData requestData ) { if ( !requestData.input.canConvert< Tomahawk::InfoSystem::InfoStringHash >() ) { @@ -300,7 +300,7 @@ LastFmPlugin::fetchChart( Tomahawk::InfoSystem::InfoRequestData requestData ) } void -LastFmPlugin::fetchChartCapabilities( Tomahawk::InfoSystem::InfoRequestData requestData ) +LastFmInfoPlugin::fetchChartCapabilities( Tomahawk::InfoSystem::InfoRequestData requestData ) { if ( !requestData.input.canConvert< Tomahawk::InfoSystem::InfoStringHash >() ) { @@ -314,7 +314,7 @@ LastFmPlugin::fetchChartCapabilities( Tomahawk::InfoSystem::InfoRequestData requ } void -LastFmPlugin::fetchCoverArt( Tomahawk::InfoSystem::InfoRequestData requestData ) +LastFmInfoPlugin::fetchCoverArt( Tomahawk::InfoSystem::InfoRequestData requestData ) { if ( !requestData.input.canConvert< Tomahawk::InfoSystem::InfoStringHash >() ) { @@ -337,7 +337,7 @@ LastFmPlugin::fetchCoverArt( Tomahawk::InfoSystem::InfoRequestData requestData ) void -LastFmPlugin::fetchArtistImages( Tomahawk::InfoSystem::InfoRequestData requestData ) +LastFmInfoPlugin::fetchArtistImages( Tomahawk::InfoSystem::InfoRequestData requestData ) { if ( !requestData.input.canConvert< Tomahawk::InfoSystem::InfoStringHash >() ) { @@ -359,7 +359,7 @@ LastFmPlugin::fetchArtistImages( Tomahawk::InfoSystem::InfoRequestData requestDa void -LastFmPlugin::notInCacheSlot( QHash criteria, Tomahawk::InfoSystem::InfoRequestData requestData ) +LastFmInfoPlugin::notInCacheSlot( QHash criteria, Tomahawk::InfoSystem::InfoRequestData requestData ) { if ( !TomahawkUtils::nam() ) { @@ -504,7 +504,7 @@ LastFmPlugin::notInCacheSlot( QHash criteria, Tomahawk::InfoSy void -LastFmPlugin::similarArtistsReturned() +LastFmInfoPlugin::similarArtistsReturned() { QNetworkReply* reply = qobject_cast( sender() ); @@ -542,7 +542,7 @@ LastFmPlugin::similarArtistsReturned() void -LastFmPlugin::chartReturned() +LastFmInfoPlugin::chartReturned() { QNetworkReply* reply = qobject_cast( sender() ); @@ -587,7 +587,7 @@ LastFmPlugin::chartReturned() void -LastFmPlugin::topTracksReturned() +LastFmInfoPlugin::topTracksReturned() { QNetworkReply* reply = qobject_cast( sender() ); @@ -609,7 +609,7 @@ LastFmPlugin::topTracksReturned() void -LastFmPlugin::coverArtReturned() +LastFmInfoPlugin::coverArtReturned() { QNetworkReply* reply = qobject_cast( sender() ); QUrl redir = reply->attribute( QNetworkRequest::RedirectionTargetAttribute ).toUrl(); @@ -662,7 +662,7 @@ LastFmPlugin::coverArtReturned() void -LastFmPlugin::artistImagesReturned() +LastFmInfoPlugin::artistImagesReturned() { QNetworkReply* reply = qobject_cast( sender() ); QUrl redir = reply->attribute( QNetworkRequest::RedirectionTargetAttribute ).toUrl(); @@ -713,7 +713,7 @@ LastFmPlugin::artistImagesReturned() void -LastFmPlugin::settingsChanged() +LastFmInfoPlugin::settingsChanged() { if ( m_account.isNull() ) return; @@ -750,7 +750,7 @@ LastFmPlugin::settingsChanged() void -LastFmPlugin::onAuthenticated() +LastFmInfoPlugin::onAuthenticated() { QNetworkReply* authJob = dynamic_cast( sender() ); if ( !authJob || m_account.isNull() ) @@ -789,14 +789,14 @@ LastFmPlugin::onAuthenticated() void -LastFmPlugin::createScrobbler() +LastFmInfoPlugin::createScrobbler() { if ( m_account.isNull() || lastfm::ws::Username.isEmpty() ) return; if ( m_account.data()->sessionKey().isEmpty() ) // no session key, so get one { - qDebug() << "LastFmPlugin::createScrobbler Session key is empty"; + qDebug() << "LastFmInfoPlugin::createScrobbler Session key is empty"; QString authToken = TomahawkUtils::md5( ( lastfm::ws::Username.toLower() + TomahawkUtils::md5( m_pw.toUtf8() ) ).toUtf8() ); QMap query; @@ -809,7 +809,7 @@ LastFmPlugin::createScrobbler() } else { - qDebug() << "LastFmPlugin::createScrobbler Already have session key"; + qDebug() << "LastFmInfoPlugin::createScrobbler Already have session key"; lastfm::ws::SessionKey = m_account.data()->sessionKey(); m_scrobbler = new lastfm::Audioscrobbler( "thk" ); @@ -818,7 +818,7 @@ LastFmPlugin::createScrobbler() QList -LastFmPlugin::parseTrackList( QNetworkReply* reply ) +LastFmInfoPlugin::parseTrackList( QNetworkReply* reply ) { QList tracks; try diff --git a/src/accounts/lastfm/LastFmPlugin.h b/src/accounts/lastfm/LastFmInfoPlugin.h similarity index 95% rename from src/accounts/lastfm/LastFmPlugin.h rename to src/accounts/lastfm/LastFmInfoPlugin.h index 3f1a22fb1..6f3d219c7 100644 --- a/src/accounts/lastfm/LastFmPlugin.h +++ b/src/accounts/lastfm/LastFmInfoPlugin.h @@ -42,13 +42,13 @@ namespace Accounts namespace InfoSystem { -class LastFmPlugin : public InfoPlugin +class LastFmInfoPlugin : public InfoPlugin { Q_OBJECT public: - LastFmPlugin( Accounts::LastFmAccount* account ); - virtual ~LastFmPlugin(); + LastFmInfoPlugin( Accounts::LastFmAccount* account ); + virtual ~LastFmInfoPlugin(); public slots: void init();