diff --git a/src/audiocontrols.cpp b/src/audiocontrols.cpp index 0050f8ac5..0139b3145 100644 --- a/src/audiocontrols.cpp +++ b/src/audiocontrols.cpp @@ -207,14 +207,14 @@ AudioControls::onPlaybackStarted( const Tomahawk::result_ptr& result ) ui->seekSlider->setVisible( true ); - Tomahawk::InfoSystem::InfoCriteriaHash trackInfo; + Tomahawk::InfoSystem::InfoStringHash trackInfo; trackInfo["artist"] = result->artist()->name(); trackInfo["album"] = result->album()->name(); Tomahawk::InfoSystem::InfoRequestData requestData; requestData.caller = s_acInfoIdentifier; requestData.type = Tomahawk::InfoSystem::InfoAlbumCoverArt; - requestData.input = QVariant::fromValue< Tomahawk::InfoSystem::InfoCriteriaHash >( trackInfo ); + requestData.input = QVariant::fromValue< Tomahawk::InfoSystem::InfoStringHash >( trackInfo ); requestData.customData = QVariantMap(); Tomahawk::InfoSystem::InfoSystem::instance()->getInfo( requestData ); @@ -567,7 +567,7 @@ AudioControls::droppedTracks( QList< query_ptr > tracks ) void AudioControls::onLoveButtonClicked( bool checked ) { - Tomahawk::InfoSystem::InfoCriteriaHash trackInfo; + Tomahawk::InfoSystem::InfoStringHash trackInfo; trackInfo["title"] = m_currentTrack->track(); trackInfo["artist"] = m_currentTrack->artist()->name(); trackInfo["album"] = m_currentTrack->album()->name(); @@ -576,7 +576,7 @@ AudioControls::onLoveButtonClicked( bool checked ) { Tomahawk::InfoSystem::InfoSystem::instance()->pushInfo( s_acInfoIdentifier, Tomahawk::InfoSystem::InfoLove, - QVariant::fromValue< Tomahawk::InfoSystem::InfoCriteriaHash >( trackInfo ) ); + QVariant::fromValue< Tomahawk::InfoSystem::InfoStringHash >( trackInfo ) ); DatabaseCommand_SocialAction* cmd = new DatabaseCommand_SocialAction( m_currentTrack, QString( "Love" ), QString( "true") ); Database::instance()->enqueue( QSharedPointer(cmd) ); @@ -586,7 +586,7 @@ AudioControls::onLoveButtonClicked( bool checked ) { Tomahawk::InfoSystem::InfoSystem::instance()->pushInfo( s_acInfoIdentifier, Tomahawk::InfoSystem::InfoUnLove, - QVariant::fromValue< Tomahawk::InfoSystem::InfoCriteriaHash >( trackInfo ) ); + QVariant::fromValue< Tomahawk::InfoSystem::InfoStringHash >( trackInfo ) ); DatabaseCommand_SocialAction* cmd = new DatabaseCommand_SocialAction( m_currentTrack, QString( "Love" ), QString( "false" ) ); Database::instance()->enqueue( QSharedPointer(cmd) ); diff --git a/src/libtomahawk/audio/audioengine.cpp b/src/libtomahawk/audio/audioengine.cpp index ae9102548..2398749f2 100644 --- a/src/libtomahawk/audio/audioengine.cpp +++ b/src/libtomahawk/audio/audioengine.cpp @@ -130,14 +130,14 @@ AudioEngine::play() { m_mediaObject->play(); emit resumed(); - Tomahawk::InfoSystem::InfoCriteriaHash trackInfo; + Tomahawk::InfoSystem::InfoStringHash trackInfo; trackInfo["title"] = m_currentTrack->track(); trackInfo["artist"] = m_currentTrack->artist()->name(); trackInfo["album"] = m_currentTrack->album()->name(); Tomahawk::InfoSystem::InfoSystem::instance()->pushInfo( s_aeInfoIdentifier, Tomahawk::InfoSystem::InfoNowResumed, - QVariant::fromValue< Tomahawk::InfoSystem::InfoCriteriaHash >( trackInfo ) ); + QVariant::fromValue< Tomahawk::InfoSystem::InfoStringHash >( trackInfo ) ); } else next(); @@ -336,14 +336,14 @@ AudioEngine::sendNowPlayingNotification() m_infoSystemConnected = true; } - Tomahawk::InfoSystem::InfoCriteriaHash trackInfo; + Tomahawk::InfoSystem::InfoStringHash trackInfo; trackInfo["artist"] = m_currentTrack->album()->artist()->name(); trackInfo["album"] = m_currentTrack->album()->name(); Tomahawk::InfoSystem::InfoRequestData requestData; requestData.caller = s_aeInfoIdentifier; requestData.type = Tomahawk::InfoSystem::InfoAlbumCoverArt; - requestData.input = QVariant::fromValue< Tomahawk::InfoSystem::InfoCriteriaHash >( trackInfo ); + requestData.input = QVariant::fromValue< Tomahawk::InfoSystem::InfoStringHash >( trackInfo ); requestData.customData = QVariantMap(); Tomahawk::InfoSystem::InfoSystem::instance()->getInfo( requestData ); @@ -471,7 +471,7 @@ AudioEngine::loadTrack( const Tomahawk::result_ptr& result ) DatabaseCommand_LogPlayback* cmd = new DatabaseCommand_LogPlayback( m_currentTrack, DatabaseCommand_LogPlayback::Started ); Database::instance()->enqueue( QSharedPointer(cmd) ); - Tomahawk::InfoSystem::InfoCriteriaHash trackInfo; + Tomahawk::InfoSystem::InfoStringHash trackInfo; trackInfo["title"] = m_currentTrack->track(); trackInfo["artist"] = m_currentTrack->artist()->name(); trackInfo["album"] = m_currentTrack->album()->name(); @@ -482,7 +482,7 @@ AudioEngine::loadTrack( const Tomahawk::result_ptr& result ) Tomahawk::InfoSystem::InfoSystem::instance()->pushInfo( s_aeInfoIdentifier, Tomahawk::InfoSystem::InfoNowPlaying, - QVariant::fromValue< Tomahawk::InfoSystem::InfoCriteriaHash >( trackInfo ) ); + QVariant::fromValue< Tomahawk::InfoSystem::InfoStringHash >( trackInfo ) ); } } diff --git a/src/libtomahawk/context/pages/RelatedArtistsContext.cpp b/src/libtomahawk/context/pages/RelatedArtistsContext.cpp index bb2d72ae1..c4620d697 100644 --- a/src/libtomahawk/context/pages/RelatedArtistsContext.cpp +++ b/src/libtomahawk/context/pages/RelatedArtistsContext.cpp @@ -65,13 +65,13 @@ RelatedArtistsContext::setQuery( const Tomahawk::query_ptr& query ) m_query = query; - Tomahawk::InfoSystem::InfoCriteriaHash artistInfo; + Tomahawk::InfoSystem::InfoStringHash artistInfo; artistInfo["artist"] = query->artist(); Tomahawk::InfoSystem::InfoRequestData requestData; requestData.caller = m_infoId; requestData.customData = QVariantMap(); - requestData.input = QVariant::fromValue< Tomahawk::InfoSystem::InfoCriteriaHash >( artistInfo ); + requestData.input = QVariant::fromValue< Tomahawk::InfoSystem::InfoStringHash >( artistInfo ); requestData.type = Tomahawk::InfoSystem::InfoArtistSimilars; Tomahawk::InfoSystem::InfoSystem::instance()->getInfo( requestData ); @@ -84,8 +84,8 @@ RelatedArtistsContext::infoSystemInfo( Tomahawk::InfoSystem::InfoRequestData req if ( requestData.caller != m_infoId ) return; - InfoSystem::InfoCriteriaHash trackInfo; - trackInfo = requestData.input.value< InfoSystem::InfoCriteriaHash >(); + InfoSystem::InfoStringHash trackInfo; + trackInfo = requestData.input.value< InfoSystem::InfoStringHash >(); if ( output.canConvert< QVariantMap >() ) { diff --git a/src/libtomahawk/context/pages/TopTracksContext.cpp b/src/libtomahawk/context/pages/TopTracksContext.cpp index f5d0638e9..8f25e646c 100644 --- a/src/libtomahawk/context/pages/TopTracksContext.cpp +++ b/src/libtomahawk/context/pages/TopTracksContext.cpp @@ -65,13 +65,13 @@ TopTracksContext::setQuery( const Tomahawk::query_ptr& query ) m_query = query; - Tomahawk::InfoSystem::InfoCriteriaHash artistInfo; + Tomahawk::InfoSystem::InfoStringHash artistInfo; artistInfo["artist"] = query->artist(); Tomahawk::InfoSystem::InfoRequestData requestData; requestData.caller = m_infoId; requestData.customData = QVariantMap(); - requestData.input = QVariant::fromValue< Tomahawk::InfoSystem::InfoCriteriaHash >( artistInfo ); + requestData.input = QVariant::fromValue< Tomahawk::InfoSystem::InfoStringHash >( artistInfo ); requestData.type = Tomahawk::InfoSystem::InfoArtistSongs; Tomahawk::InfoSystem::InfoSystem::instance()->getInfo( requestData ); @@ -84,8 +84,8 @@ TopTracksContext::infoSystemInfo( Tomahawk::InfoSystem::InfoRequestData requestD if ( requestData.caller != m_infoId ) return; - InfoSystem::InfoCriteriaHash trackInfo; - trackInfo = requestData.input.value< InfoSystem::InfoCriteriaHash >(); + InfoSystem::InfoStringHash trackInfo; + trackInfo = requestData.input.value< InfoSystem::InfoStringHash >(); if ( output.canConvert< QVariantMap >() ) { diff --git a/src/libtomahawk/dropjob.cpp b/src/libtomahawk/dropjob.cpp index 04620e41d..48f9d212b 100644 --- a/src/libtomahawk/dropjob.cpp +++ b/src/libtomahawk/dropjob.cpp @@ -574,9 +574,9 @@ DropJob::infoSystemInfo( Tomahawk::InfoSystem::InfoRequestData requestData, QVar { if ( requestData.caller == "changeme" ) { - Tomahawk::InfoSystem::InfoCriteriaHash artistInfo; + Tomahawk::InfoSystem::InfoStringHash artistInfo; - artistInfo = requestData.input.value< Tomahawk::InfoSystem::InfoCriteriaHash >(); + artistInfo = requestData.input.value< Tomahawk::InfoSystem::InfoStringHash >(); QString artist = artistInfo["artist"]; @@ -643,14 +643,14 @@ DropJob::getTopTen( const QString &artist ) SIGNAL( info( Tomahawk::InfoSystem::InfoRequestData, QVariant ) ), SLOT( infoSystemInfo( Tomahawk::InfoSystem::InfoRequestData, QVariant ) ) ); - Tomahawk::InfoSystem::InfoCriteriaHash artistInfo; + Tomahawk::InfoSystem::InfoStringHash artistInfo; artistInfo["artist"] = artist; Tomahawk::InfoSystem::InfoRequestData requestData; requestData.caller = "changeme"; requestData.customData = QVariantMap(); - requestData.input = QVariant::fromValue< Tomahawk::InfoSystem::InfoCriteriaHash >( artistInfo ); + requestData.input = QVariant::fromValue< Tomahawk::InfoSystem::InfoStringHash >( artistInfo ); requestData.type = Tomahawk::InfoSystem::InfoArtistSongs; Tomahawk::InfoSystem::InfoSystem::instance()->getInfo( requestData ); diff --git a/src/libtomahawk/infosystem/infoplugins/generic/chartsplugin.cpp b/src/libtomahawk/infosystem/infoplugins/generic/chartsplugin.cpp index 3177a82f4..8c6da8048 100644 --- a/src/libtomahawk/infosystem/infoplugins/generic/chartsplugin.cpp +++ b/src/libtomahawk/infosystem/infoplugins/generic/chartsplugin.cpp @@ -106,7 +106,7 @@ ChartsPlugin::getInfo( uint requestId, Tomahawk::InfoSystem::InfoRequestData req qDebug() << Q_FUNC_INFO << requestData.caller; qDebug() << Q_FUNC_INFO << requestData.customData; - InfoCriteriaHash hash = requestData.input.value< Tomahawk::InfoSystem::InfoCriteriaHash >(); + InfoStringHash hash = requestData.input.value< Tomahawk::InfoSystem::InfoStringHash >(); bool foundSource; switch ( requestData.type ) @@ -161,14 +161,14 @@ void ChartsPlugin::fetchChart( uint requestId, Tomahawk::InfoSystem::InfoRequestData requestData ) { - if ( !requestData.input.canConvert< Tomahawk::InfoSystem::InfoCriteriaHash >() ) + if ( !requestData.input.canConvert< Tomahawk::InfoSystem::InfoStringHash >() ) { dataError( requestId, requestData ); return; } - InfoCriteriaHash hash = requestData.input.value< Tomahawk::InfoSystem::InfoCriteriaHash >(); - Tomahawk::InfoSystem::InfoCriteriaHash criteria; + InfoStringHash hash = requestData.input.value< Tomahawk::InfoSystem::InfoStringHash >(); + Tomahawk::InfoSystem::InfoStringHash criteria; /// Each request needs to contain both a id and source if ( !hash.contains( "chart_id" ) && !hash.contains( "chart_source" ) ) @@ -187,13 +187,13 @@ ChartsPlugin::fetchChart( uint requestId, Tomahawk::InfoSystem::InfoRequestData void ChartsPlugin::fetchChartCapabilities( uint requestId, Tomahawk::InfoSystem::InfoRequestData requestData ) { - if ( !requestData.input.canConvert< Tomahawk::InfoSystem::InfoCriteriaHash >() ) + if ( !requestData.input.canConvert< Tomahawk::InfoSystem::InfoStringHash >() ) { dataError( requestId, requestData ); return; } - Tomahawk::InfoSystem::InfoCriteriaHash criteria; + Tomahawk::InfoSystem::InfoStringHash criteria; emit getCachedInfo( requestId, criteria, 0, requestData ); } @@ -402,8 +402,8 @@ ChartsPlugin::chartReturned() /// SO we have a result, parse it! QVariantList chartResponse = res.value( "list" ).toList(); - QList top_tracks; - QList top_albums; + QList top_tracks; + QList top_albums; /// Deside what type, we need to handle it differently /// @todo: We allready know the type, append it to breadcrumb hash @@ -445,7 +445,7 @@ ChartsPlugin::chartReturned() else { qDebug() << Q_FUNC_INFO << album << artist; - InfoCriteriaHash pair; + InfoStringHash pair; pair["artist"] = artist; pair["album"] = album; top_albums << pair; @@ -464,7 +464,7 @@ ChartsPlugin::chartReturned() else { - InfoCriteriaHash pair; + InfoStringHash pair; pair["artist"] = artist; pair["track"] = title; top_tracks << pair; diff --git a/src/libtomahawk/infosystem/infoplugins/generic/chartsplugin.h b/src/libtomahawk/infosystem/infoplugins/generic/chartsplugin.h index 79e05cb5d..3a75f1f0b 100644 --- a/src/libtomahawk/infosystem/infoplugins/generic/chartsplugin.h +++ b/src/libtomahawk/infosystem/infoplugins/generic/chartsplugin.h @@ -57,7 +57,7 @@ public slots: protected slots: virtual void getInfo( uint requestId, Tomahawk::InfoSystem::InfoRequestData requestData ); - virtual void notInCacheSlot( uint requestId, Tomahawk::InfoSystem::InfoCriteriaHash criteria, Tomahawk::InfoSystem::InfoRequestData requestData ); + virtual void notInCacheSlot( uint requestId, Tomahawk::InfoSystem::InfoStringHash criteria, Tomahawk::InfoSystem::InfoRequestData requestData ); virtual void pushInfo( QString caller, Tomahawk::InfoSystem::InfoType type, QVariant data ); diff --git a/src/libtomahawk/infosystem/infoplugins/generic/echonestplugin.h b/src/libtomahawk/infosystem/infoplugins/generic/echonestplugin.h index 0e70fc35a..e6e0825ab 100644 --- a/src/libtomahawk/infosystem/infoplugins/generic/echonestplugin.h +++ b/src/libtomahawk/infosystem/infoplugins/generic/echonestplugin.h @@ -55,7 +55,7 @@ protected slots: Q_UNUSED( data ); } - virtual void notInCacheSlot( uint requestId, Tomahawk::InfoSystem::InfoCriteriaHash criteria, Tomahawk::InfoSystem::InfoRequestData requestData ) + virtual void notInCacheSlot( uint requestId, Tomahawk::InfoSystem::InfoStringHash criteria, Tomahawk::InfoSystem::InfoRequestData requestData ) { Q_UNUSED( requestId ); Q_UNUSED( criteria ); diff --git a/src/libtomahawk/infosystem/infoplugins/generic/lastfmplugin.cpp b/src/libtomahawk/infosystem/infoplugins/generic/lastfmplugin.cpp index 4371c8b0e..8b5d477bd 100644 --- a/src/libtomahawk/infosystem/infoplugins/generic/lastfmplugin.cpp +++ b/src/libtomahawk/infosystem/infoplugins/generic/lastfmplugin.cpp @@ -192,7 +192,7 @@ LastFmPlugin::pushInfo( const QString caller, const Tomahawk::InfoSystem::InfoTy void LastFmPlugin::nowPlaying( const QVariant &input ) { - if ( !input.canConvert< Tomahawk::InfoSystem::InfoCriteriaHash >() || !m_scrobbler ) + if ( !input.canConvert< Tomahawk::InfoSystem::InfoStringHash >() || !m_scrobbler ) { tLog() << "LastFmPlugin::nowPlaying no m_scrobbler, or cannot convert input!"; if ( !m_scrobbler ) @@ -200,7 +200,7 @@ LastFmPlugin::nowPlaying( const QVariant &input ) return; } - InfoCriteriaHash hash = input.value< Tomahawk::InfoSystem::InfoCriteriaHash >(); + InfoStringHash hash = input.value< Tomahawk::InfoSystem::InfoStringHash >(); if ( !hash.contains( "title" ) || !hash.contains( "artist" ) || !hash.contains( "album" ) || !hash.contains( "duration" ) ) return; @@ -235,13 +235,13 @@ LastFmPlugin::sendLoveSong( const InfoType type, QVariant input ) { qDebug() << Q_FUNC_INFO; - if ( !input.canConvert< Tomahawk::InfoSystem::InfoCriteriaHash >() ) + if ( !input.canConvert< Tomahawk::InfoSystem::InfoStringHash >() ) { tLog() << "LastFmPlugin::nowPlaying cannot convert input!"; return; } - InfoCriteriaHash hash = input.value< Tomahawk::InfoSystem::InfoCriteriaHash >(); + InfoStringHash hash = input.value< Tomahawk::InfoSystem::InfoStringHash >(); if ( !hash.contains( "title" ) || !hash.contains( "artist" ) || !hash.contains( "album" ) ) return; @@ -269,19 +269,19 @@ LastFmPlugin::sendLoveSong( const InfoType type, QVariant input ) void LastFmPlugin::fetchSimilarArtists( uint requestId, Tomahawk::InfoSystem::InfoRequestData requestData ) { - if ( !requestData.input.canConvert< Tomahawk::InfoSystem::InfoCriteriaHash >() ) + if ( !requestData.input.canConvert< Tomahawk::InfoSystem::InfoStringHash >() ) { dataError( requestId, requestData ); return; } - InfoCriteriaHash hash = requestData.input.value< Tomahawk::InfoSystem::InfoCriteriaHash >(); + InfoStringHash hash = requestData.input.value< Tomahawk::InfoSystem::InfoStringHash >(); if ( !hash.contains( "artist" ) ) { dataError( requestId, requestData ); return; } - Tomahawk::InfoSystem::InfoCriteriaHash criteria; + Tomahawk::InfoSystem::InfoStringHash criteria; criteria["artist"] = hash["artist"]; emit getCachedInfo( requestId, criteria, 2419200000, requestData ); @@ -291,19 +291,19 @@ LastFmPlugin::fetchSimilarArtists( uint requestId, Tomahawk::InfoSystem::InfoReq void LastFmPlugin::fetchTopTracks( uint requestId, Tomahawk::InfoSystem::InfoRequestData requestData ) { - if ( !requestData.input.canConvert< Tomahawk::InfoSystem::InfoCriteriaHash >() ) + if ( !requestData.input.canConvert< Tomahawk::InfoSystem::InfoStringHash >() ) { dataError( requestId, requestData ); return; } - InfoCriteriaHash hash = requestData.input.value< Tomahawk::InfoSystem::InfoCriteriaHash >(); + InfoStringHash hash = requestData.input.value< Tomahawk::InfoSystem::InfoStringHash >(); if ( !hash.contains( "artist" ) ) { dataError( requestId, requestData ); return; } - Tomahawk::InfoSystem::InfoCriteriaHash criteria; + Tomahawk::InfoSystem::InfoStringHash criteria; criteria["artist"] = hash["artist"]; emit getCachedInfo( requestId, criteria, 2419200000, requestData ); @@ -312,13 +312,13 @@ LastFmPlugin::fetchTopTracks( uint requestId, Tomahawk::InfoSystem::InfoRequestD void LastFmPlugin::fetchChart( uint requestId, Tomahawk::InfoSystem::InfoRequestData requestData ) { - if ( !requestData.input.canConvert< Tomahawk::InfoSystem::InfoCriteriaHash >() ) + if ( !requestData.input.canConvert< Tomahawk::InfoSystem::InfoStringHash >() ) { dataError( requestId, requestData ); return; } - InfoCriteriaHash hash = requestData.input.value< Tomahawk::InfoSystem::InfoCriteriaHash >(); - Tomahawk::InfoSystem::InfoCriteriaHash criteria; + InfoStringHash hash = requestData.input.value< Tomahawk::InfoSystem::InfoStringHash >(); + Tomahawk::InfoSystem::InfoStringHash criteria; if ( !hash.contains( "chart_id" ) ) { dataError( requestId, requestData ); @@ -333,13 +333,13 @@ LastFmPlugin::fetchChart( uint requestId, Tomahawk::InfoSystem::InfoRequestData void LastFmPlugin::fetchChartCapabilities( uint requestId, Tomahawk::InfoSystem::InfoRequestData requestData ) { - if ( !requestData.input.canConvert< Tomahawk::InfoSystem::InfoCriteriaHash >() ) + if ( !requestData.input.canConvert< Tomahawk::InfoSystem::InfoStringHash >() ) { dataError( requestId, requestData ); return; } - InfoCriteriaHash hash = requestData.input.value< Tomahawk::InfoSystem::InfoCriteriaHash >(); - Tomahawk::InfoSystem::InfoCriteriaHash criteria; + InfoStringHash hash = requestData.input.value< Tomahawk::InfoSystem::InfoStringHash >(); + Tomahawk::InfoSystem::InfoStringHash criteria; emit getCachedInfo( requestId, criteria, 0, requestData ); } @@ -347,19 +347,19 @@ LastFmPlugin::fetchChartCapabilities( uint requestId, Tomahawk::InfoSystem::Info void LastFmPlugin::fetchCoverArt( uint requestId, Tomahawk::InfoSystem::InfoRequestData requestData ) { - if ( !requestData.input.canConvert< Tomahawk::InfoSystem::InfoCriteriaHash >() ) + if ( !requestData.input.canConvert< Tomahawk::InfoSystem::InfoStringHash >() ) { dataError( requestId, requestData ); return; } - InfoCriteriaHash hash = requestData.input.value< Tomahawk::InfoSystem::InfoCriteriaHash >(); + InfoStringHash hash = requestData.input.value< Tomahawk::InfoSystem::InfoStringHash >(); if ( !hash.contains( "artist" ) || !hash.contains( "album" ) ) { dataError( requestId, requestData ); return; } - Tomahawk::InfoSystem::InfoCriteriaHash criteria; + Tomahawk::InfoSystem::InfoStringHash criteria; criteria["artist"] = hash["artist"]; criteria["album"] = hash["album"]; @@ -370,19 +370,19 @@ LastFmPlugin::fetchCoverArt( uint requestId, Tomahawk::InfoSystem::InfoRequestDa void LastFmPlugin::fetchArtistImages( uint requestId, Tomahawk::InfoSystem::InfoRequestData requestData ) { - if ( !requestData.input.canConvert< Tomahawk::InfoSystem::InfoCriteriaHash >() ) + if ( !requestData.input.canConvert< Tomahawk::InfoSystem::InfoStringHash >() ) { dataError( requestId, requestData ); return; } - InfoCriteriaHash hash = requestData.input.value< Tomahawk::InfoSystem::InfoCriteriaHash >(); + InfoStringHash hash = requestData.input.value< Tomahawk::InfoSystem::InfoStringHash >(); if ( !hash.contains( "artist" ) ) { dataError( requestId, requestData ); return; } - Tomahawk::InfoSystem::InfoCriteriaHash criteria; + Tomahawk::InfoSystem::InfoStringHash criteria; criteria["artist"] = hash["artist"]; emit getCachedInfo( requestId, criteria, 2419200000, requestData ); @@ -399,7 +399,7 @@ LastFmPlugin::notInCacheSlot( uint requestId, QHash criteria, return; } - InfoCriteriaHash hash = requestData.input.value< Tomahawk::InfoSystem::InfoCriteriaHash >(); + InfoStringHash hash = requestData.input.value< Tomahawk::InfoSystem::InfoStringHash >(); switch ( requestData.type ) { case InfoChart: @@ -544,8 +544,8 @@ LastFmPlugin::similarArtistsReturned() returnedData ); - Tomahawk::InfoSystem::InfoCriteriaHash origData = requestData.input.value< Tomahawk::InfoSystem::InfoCriteriaHash>(); - Tomahawk::InfoSystem::InfoCriteriaHash criteria; + Tomahawk::InfoSystem::InfoStringHash origData = requestData.input.value< Tomahawk::InfoSystem::InfoStringHash>(); + Tomahawk::InfoSystem::InfoStringHash criteria; criteria["artist"] = origData["artist"]; emit updateCache( criteria, 2419200000, requestData.type, returnedData ); } @@ -565,9 +565,9 @@ LastFmPlugin::chartReturned() if ( url.contains( tracks_rx ) ) { QList tracks = parseTrackList( reply ); - QList top_tracks; + QList top_tracks; foreach( const lastfm::Track &t, tracks ) { - InfoCriteriaHash pair; + InfoStringHash pair; pair[ "artist" ] = t.artist().toString(); pair[ "track" ] = t.title(); top_tracks << pair; @@ -620,8 +620,8 @@ LastFmPlugin::topTracksReturned() returnedData ); - Tomahawk::InfoSystem::InfoCriteriaHash origData = requestData.input.value< Tomahawk::InfoSystem::InfoCriteriaHash>(); - Tomahawk::InfoSystem::InfoCriteriaHash criteria; + Tomahawk::InfoSystem::InfoStringHash origData = requestData.input.value< Tomahawk::InfoSystem::InfoStringHash>(); + Tomahawk::InfoSystem::InfoStringHash criteria; criteria["artist"] = origData["artist"]; emit updateCache( criteria, 0, requestData.type, returnedData ); } @@ -659,8 +659,8 @@ LastFmPlugin::coverArtReturned() returnedData ); - Tomahawk::InfoSystem::InfoCriteriaHash origData = requestData.input.value< Tomahawk::InfoSystem::InfoCriteriaHash>(); - Tomahawk::InfoSystem::InfoCriteriaHash criteria; + Tomahawk::InfoSystem::InfoStringHash origData = requestData.input.value< Tomahawk::InfoSystem::InfoStringHash>(); + Tomahawk::InfoSystem::InfoStringHash criteria; criteria["artist"] = origData["artist"]; criteria["album"] = origData["album"]; emit updateCache( criteria, 2419200000, requestData.type, returnedData ); @@ -712,8 +712,8 @@ LastFmPlugin::artistImagesReturned() emit info( reply->property( "requestId" ).toUInt(), requestData, returnedData ); - Tomahawk::InfoSystem::InfoCriteriaHash origData = requestData.input.value< Tomahawk::InfoSystem::InfoCriteriaHash>(); - Tomahawk::InfoSystem::InfoCriteriaHash criteria; + Tomahawk::InfoSystem::InfoStringHash origData = requestData.input.value< Tomahawk::InfoSystem::InfoStringHash>(); + Tomahawk::InfoSystem::InfoStringHash criteria; criteria["artist"] = origData["artist"]; emit updateCache( criteria, 2419200000, requestData.type, returnedData ); } diff --git a/src/libtomahawk/infosystem/infoplugins/generic/lastfmplugin.h b/src/libtomahawk/infosystem/infoplugins/generic/lastfmplugin.h index 49d352b40..90f117882 100644 --- a/src/libtomahawk/infosystem/infoplugins/generic/lastfmplugin.h +++ b/src/libtomahawk/infosystem/infoplugins/generic/lastfmplugin.h @@ -57,7 +57,7 @@ public slots: protected slots: virtual void getInfo( uint requestId, Tomahawk::InfoSystem::InfoRequestData requestData ); - virtual void notInCacheSlot( uint requestId, Tomahawk::InfoSystem::InfoCriteriaHash criteria, Tomahawk::InfoSystem::InfoRequestData requestData ); + virtual void notInCacheSlot( uint requestId, Tomahawk::InfoSystem::InfoStringHash criteria, Tomahawk::InfoSystem::InfoRequestData requestData ); virtual void pushInfo( QString caller, Tomahawk::InfoSystem::InfoType type, QVariant data ); diff --git a/src/libtomahawk/infosystem/infoplugins/generic/musicbrainzPlugin.cpp b/src/libtomahawk/infosystem/infoplugins/generic/musicbrainzPlugin.cpp index fe0fedff7..388eda463 100644 --- a/src/libtomahawk/infosystem/infoplugins/generic/musicbrainzPlugin.cpp +++ b/src/libtomahawk/infosystem/infoplugins/generic/musicbrainzPlugin.cpp @@ -54,12 +54,12 @@ MusicBrainzPlugin::namChangedSlot( QNetworkAccessManager *nam ) void MusicBrainzPlugin::getInfo( uint requestId, Tomahawk::InfoSystem::InfoRequestData requestData ) { - if ( !requestData.input.canConvert< Tomahawk::InfoSystem::InfoCriteriaHash >() ) + if ( !requestData.input.canConvert< Tomahawk::InfoSystem::InfoStringHash >() ) { emit info( requestId, requestData, QVariant() ); return; } - InfoCriteriaHash hash = requestData.input.value< Tomahawk::InfoSystem::InfoCriteriaHash >(); + InfoStringHash hash = requestData.input.value< Tomahawk::InfoSystem::InfoStringHash >(); if ( !hash.contains( "artist" ) ) { emit info( requestId, requestData, QVariant() ); @@ -202,7 +202,7 @@ MusicBrainzPlugin::tracksSearchSlot() } Tomahawk::InfoSystem::InfoRequestData requestData = oldReply->property( "requestData" ).value< Tomahawk::InfoSystem::InfoRequestData >(); - InfoCriteriaHash hash = requestData.input.value< Tomahawk::InfoSystem::InfoCriteriaHash >(); + InfoStringHash hash = requestData.input.value< Tomahawk::InfoSystem::InfoStringHash >(); QDomElement element; for ( int i = 0; i < domNodeList.count(); i++ ) @@ -258,8 +258,8 @@ MusicBrainzPlugin::albumFoundSlot() returnedData["albums"] = albums; emit info( reply->property( "requestId" ).toUInt(), requestData, returnedData ); - Tomahawk::InfoSystem::InfoCriteriaHash origData = requestData.input.value< Tomahawk::InfoSystem::InfoCriteriaHash>(); - Tomahawk::InfoSystem::InfoCriteriaHash criteria; + Tomahawk::InfoSystem::InfoStringHash origData = requestData.input.value< Tomahawk::InfoSystem::InfoStringHash>(); + Tomahawk::InfoSystem::InfoStringHash criteria; criteria["artist"] = origData["artist"]; emit updateCache( criteria, 0, requestData.type, returnedData ); } @@ -299,8 +299,8 @@ MusicBrainzPlugin::tracksFoundSlot() returnedData["tracks"] = tracks; emit info( reply->property( "requestId" ).toUInt(), requestData, returnedData ); - Tomahawk::InfoSystem::InfoCriteriaHash origData = requestData.input.value< Tomahawk::InfoSystem::InfoCriteriaHash>(); - Tomahawk::InfoSystem::InfoCriteriaHash criteria; + Tomahawk::InfoSystem::InfoStringHash origData = requestData.input.value< Tomahawk::InfoSystem::InfoStringHash>(); + Tomahawk::InfoSystem::InfoStringHash criteria; criteria["artist"] = origData["artist"]; criteria["album"] = origData["album"]; emit updateCache( criteria, 0, requestData.type, returnedData ); diff --git a/src/libtomahawk/infosystem/infoplugins/generic/musicbrainzPlugin.h b/src/libtomahawk/infosystem/infoplugins/generic/musicbrainzPlugin.h index 9586fa1af..8e943bae3 100644 --- a/src/libtomahawk/infosystem/infoplugins/generic/musicbrainzPlugin.h +++ b/src/libtomahawk/infosystem/infoplugins/generic/musicbrainzPlugin.h @@ -51,7 +51,7 @@ protected slots: Q_UNUSED( data ); } -virtual void notInCacheSlot( uint requestId, Tomahawk::InfoSystem::InfoCriteriaHash criteria, Tomahawk::InfoSystem::InfoRequestData requestData ) +virtual void notInCacheSlot( uint requestId, Tomahawk::InfoSystem::InfoStringHash criteria, Tomahawk::InfoSystem::InfoRequestData requestData ) { Q_UNUSED( requestId ); Q_UNUSED( criteria ); diff --git a/src/libtomahawk/infosystem/infoplugins/generic/musixmatchplugin.h b/src/libtomahawk/infosystem/infoplugins/generic/musixmatchplugin.h index a93e25c01..a6ef3fbe3 100644 --- a/src/libtomahawk/infosystem/infoplugins/generic/musixmatchplugin.h +++ b/src/libtomahawk/infosystem/infoplugins/generic/musixmatchplugin.h @@ -54,7 +54,7 @@ protected slots: Q_UNUSED( data ); } -virtual void notInCacheSlot( uint requestId, Tomahawk::InfoSystem::InfoCriteriaHash criteria, Tomahawk::InfoSystem::InfoRequestData requestData ) +virtual void notInCacheSlot( uint requestId, Tomahawk::InfoSystem::InfoStringHash criteria, Tomahawk::InfoSystem::InfoRequestData requestData ) { Q_UNUSED( requestId ); Q_UNUSED( criteria ); diff --git a/src/libtomahawk/infosystem/infoplugins/mac/adiumplugin.cpp b/src/libtomahawk/infosystem/infoplugins/mac/adiumplugin.cpp index 374aaf4c6..20b907bcc 100644 --- a/src/libtomahawk/infosystem/infoplugins/mac/adiumplugin.cpp +++ b/src/libtomahawk/infosystem/infoplugins/mac/adiumplugin.cpp @@ -172,10 +172,10 @@ AdiumPlugin::audioStarted( const QVariant &input ) { qDebug() << Q_FUNC_INFO; - if ( !input.canConvert< Tomahawk::InfoSystem::InfoCriteriaHash >() ) + if ( !input.canConvert< Tomahawk::InfoSystem::InfoStringHash >() ) return; - InfoCriteriaHash hash = input.value< Tomahawk::InfoSystem::InfoCriteriaHash >(); + InfoStringHash hash = input.value< Tomahawk::InfoSystem::InfoStringHash >(); if ( !hash.contains( "title" ) || !hash.contains( "artist" ) ) return; @@ -188,7 +188,7 @@ AdiumPlugin::audioStarted( const QVariant &input ) } QUrl -AdiumPlugin::openLinkFromHash( const Tomahawk::InfoSystem::InfoCriteriaHash& hash ) const +AdiumPlugin::openLinkFromHash( const Tomahawk::InfoSystem::InfoStringHash& hash ) const { QString title, artist, album; diff --git a/src/libtomahawk/infosystem/infoplugins/mac/adiumplugin.h b/src/libtomahawk/infosystem/infoplugins/mac/adiumplugin.h index bdd4b6e42..c602d80fc 100644 --- a/src/libtomahawk/infosystem/infoplugins/mac/adiumplugin.h +++ b/src/libtomahawk/infosystem/infoplugins/mac/adiumplugin.h @@ -52,7 +52,7 @@ protected slots: public slots: void namChangedSlot( QNetworkAccessManager* nam ); - virtual void notInCacheSlot( uint requestId, const Tomahawk::InfoSystem::InfoCriteriaHash criteria, Tomahawk::InfoSystem::InfoRequestData requestData ) + virtual void notInCacheSlot( uint requestId, const Tomahawk::InfoSystem::InfoStringHash criteria, Tomahawk::InfoSystem::InfoRequestData requestData ) { Q_UNUSED( requestId ); Q_UNUSED( criteria ); @@ -72,7 +72,7 @@ private: void audioPaused(); void audioResumed( const QVariant &input ); - QUrl openLinkFromHash( const InfoCriteriaHash& hash ) const; + QUrl openLinkFromHash( const InfoStringHash& hash ) const; bool m_active; QString m_beforeStatus; diff --git a/src/libtomahawk/infosystem/infoplugins/unix/fdonotifyplugin.h b/src/libtomahawk/infosystem/infoplugins/unix/fdonotifyplugin.h index 89f0667a1..ed5dfabf8 100644 --- a/src/libtomahawk/infosystem/infoplugins/unix/fdonotifyplugin.h +++ b/src/libtomahawk/infosystem/infoplugins/unix/fdonotifyplugin.h @@ -46,7 +46,7 @@ protected slots: virtual void pushInfo( QString caller, Tomahawk::InfoSystem::InfoType type, QVariant pushData ); - virtual void notInCacheSlot( uint requestId, Tomahawk::InfoSystem::InfoCriteriaHash criteria, Tomahawk::InfoSystem::InfoRequestData requestData ) + virtual void notInCacheSlot( uint requestId, Tomahawk::InfoSystem::InfoStringHash criteria, Tomahawk::InfoSystem::InfoRequestData requestData ) { Q_UNUSED( requestId ); Q_UNUSED( criteria ); diff --git a/src/libtomahawk/infosystem/infoplugins/unix/mprisplugin.cpp b/src/libtomahawk/infosystem/infoplugins/unix/mprisplugin.cpp index a51b0e410..3e1fa3466 100644 --- a/src/libtomahawk/infosystem/infoplugins/unix/mprisplugin.cpp +++ b/src/libtomahawk/infosystem/infoplugins/unix/mprisplugin.cpp @@ -263,14 +263,14 @@ MprisPlugin::metadata() const { // Need to fetch the album cover - Tomahawk::InfoSystem::InfoCriteriaHash trackInfo; + Tomahawk::InfoSystem::InfoStringHash trackInfo; trackInfo["artist"] = track->artist()->name(); trackInfo["album"] = track->album()->name(); Tomahawk::InfoSystem::InfoRequestData requestData; requestData.caller = s_mpInfoIdentifier; requestData.type = Tomahawk::InfoSystem::InfoAlbumCoverArt; - requestData.input = QVariant::fromValue< Tomahawk::InfoSystem::InfoCriteriaHash >( trackInfo ); + requestData.input = QVariant::fromValue< Tomahawk::InfoSystem::InfoStringHash >( trackInfo ); requestData.customData = QVariantMap(); Tomahawk::InfoSystem::InfoSystem::instance()->getInfo( requestData ); @@ -489,10 +489,10 @@ MprisPlugin::audioStarted( const QVariant &input ) { qDebug() << Q_FUNC_INFO; - if ( !input.canConvert< Tomahawk::InfoSystem::InfoCriteriaHash >() ) + if ( !input.canConvert< Tomahawk::InfoSystem::InfoStringHash >() ) return; - InfoCriteriaHash hash = input.value< Tomahawk::InfoSystem::InfoCriteriaHash >(); + InfoStringHash hash = input.value< Tomahawk::InfoSystem::InfoStringHash >(); if ( !hash.contains( "title" ) || !hash.contains( "artist" ) || !hash.contains( "album" ) ) return; @@ -605,13 +605,13 @@ MprisPlugin::infoSystemInfo( Tomahawk::InfoSystem::InfoRequestData requestData, image.loadFromData( ba ); // Pull out request data for album+artist - if( !requestData.input.canConvert< Tomahawk::InfoSystem::InfoCriteriaHash >() ) + if( !requestData.input.canConvert< Tomahawk::InfoSystem::InfoStringHash >() ) { qDebug() << "Cannot convert metadata input to album cover retrieval"; return; } - Tomahawk::InfoSystem::InfoCriteriaHash hash = requestData.input.value< Tomahawk::InfoSystem::InfoCriteriaHash>(); + Tomahawk::InfoSystem::InfoStringHash hash = requestData.input.value< Tomahawk::InfoSystem::InfoStringHash>(); // delete the old tempfile and make new one, to avoid caching of filename by mpris clients if( m_coverTempFile ) diff --git a/src/libtomahawk/infosystem/infoplugins/unix/mprisplugin.h b/src/libtomahawk/infosystem/infoplugins/unix/mprisplugin.h index 6c439e1e8..c708e2a23 100644 --- a/src/libtomahawk/infosystem/infoplugins/unix/mprisplugin.h +++ b/src/libtomahawk/infosystem/infoplugins/unix/mprisplugin.h @@ -119,7 +119,7 @@ public: public slots: void namChangedSlot( QNetworkAccessManager* /*nam*/ ) {} // unused - virtual void notInCacheSlot( uint requestId, const Tomahawk::InfoSystem::InfoCriteriaHash criteria, Tomahawk::InfoSystem::InfoRequestData requestData ) + virtual void notInCacheSlot( uint requestId, const Tomahawk::InfoSystem::InfoStringHash criteria, Tomahawk::InfoSystem::InfoRequestData requestData ) { Q_UNUSED( requestId ); Q_UNUSED( criteria ); diff --git a/src/libtomahawk/infosystem/infosystem.h b/src/libtomahawk/infosystem/infosystem.h index ec0ff696c..ee6662037 100644 --- a/src/libtomahawk/infosystem/infosystem.h +++ b/src/libtomahawk/infosystem/infosystem.h @@ -144,7 +144,7 @@ struct Chart { typedef QMap< InfoType, QVariant > InfoTypeMap; typedef QMap< InfoType, uint > InfoTimeoutMap; -typedef QHash< QString, QString > InfoCriteriaHash; +typedef QHash< QString, QString > InfoStringHash; class DLLEXPORT InfoPlugin : public QObject { @@ -159,15 +159,15 @@ public: QSet< InfoType > supportedPushTypes() const { return m_supportedPushTypes; } signals: - void getCachedInfo( uint requestId, Tomahawk::InfoSystem::InfoCriteriaHash criteria, qint64 newMaxAge, Tomahawk::InfoSystem::InfoRequestData requestData ); + void getCachedInfo( uint requestId, Tomahawk::InfoSystem::InfoStringHash criteria, qint64 newMaxAge, Tomahawk::InfoSystem::InfoRequestData requestData ); void info( uint requestId, Tomahawk::InfoSystem::InfoRequestData requestData, QVariant output ); - void updateCache( Tomahawk::InfoSystem::InfoCriteriaHash criteria, qint64 maxAge, Tomahawk::InfoSystem::InfoType type, QVariant output ); + void updateCache( Tomahawk::InfoSystem::InfoStringHash criteria, qint64 maxAge, Tomahawk::InfoSystem::InfoType type, QVariant output ); protected slots: virtual void getInfo( uint requestId, Tomahawk::InfoSystem::InfoRequestData requestData ) = 0; virtual void pushInfo( QString caller, Tomahawk::InfoSystem::InfoType type, QVariant data ) = 0; - virtual void notInCacheSlot( uint requestId, Tomahawk::InfoSystem::InfoCriteriaHash criteria, Tomahawk::InfoSystem::InfoRequestData requestData ) = 0; + virtual void notInCacheSlot( uint requestId, Tomahawk::InfoSystem::InfoStringHash criteria, Tomahawk::InfoSystem::InfoRequestData requestData ) = 0; virtual void namChangedSlot( QNetworkAccessManager *nam ) = 0; @@ -252,7 +252,7 @@ private: -inline uint qHash( Tomahawk::InfoSystem::InfoCriteriaHash hash ) +inline uint qHash( Tomahawk::InfoSystem::InfoStringHash hash ) { QCryptographicHash md5( QCryptographicHash::Md5 ); QStringList keys = hash.keys(); @@ -274,10 +274,10 @@ inline uint qHash( Tomahawk::InfoSystem::InfoCriteriaHash hash ) } Q_DECLARE_METATYPE( Tomahawk::InfoSystem::InfoRequestData ); -Q_DECLARE_METATYPE( Tomahawk::InfoSystem::InfoCriteriaHash ); +Q_DECLARE_METATYPE( Tomahawk::InfoSystem::InfoStringHash ); Q_DECLARE_METATYPE( QWeakPointer< Tomahawk::InfoSystem::InfoSystemCache > ); Q_DECLARE_METATYPE( Tomahawk::InfoSystem::Chart ); -Q_DECLARE_METATYPE( QList ); +Q_DECLARE_METATYPE( QList ); Q_DECLARE_METATYPE( QList ); #endif // TOMAHAWK_INFOSYSTEM_H diff --git a/src/libtomahawk/infosystem/infosystemcache.cpp b/src/libtomahawk/infosystem/infosystemcache.cpp index 8b1099b50..7ded3a9a0 100644 --- a/src/libtomahawk/infosystem/infosystemcache.cpp +++ b/src/libtomahawk/infosystem/infosystemcache.cpp @@ -121,7 +121,7 @@ InfoSystemCache::pruneTimerFired() void -InfoSystemCache::getCachedInfoSlot( uint requestId, Tomahawk::InfoSystem::InfoCriteriaHash criteria, qint64 newMaxAge, Tomahawk::InfoSystem::InfoRequestData requestData ) +InfoSystemCache::getCachedInfoSlot( uint requestId, Tomahawk::InfoSystem::InfoStringHash criteria, qint64 newMaxAge, Tomahawk::InfoSystem::InfoRequestData requestData ) { QObject* sendingObj = sender(); const QString criteriaHashVal = criteriaMd5( criteria ); @@ -214,14 +214,14 @@ InfoSystemCache::getCachedInfoSlot( uint requestId, Tomahawk::InfoSystem::InfoCr void -InfoSystemCache::notInCache( QObject *receiver, uint requestId, Tomahawk::InfoSystem::InfoCriteriaHash criteria, Tomahawk::InfoSystem::InfoRequestData requestData ) +InfoSystemCache::notInCache( QObject *receiver, uint requestId, Tomahawk::InfoSystem::InfoStringHash criteria, Tomahawk::InfoSystem::InfoRequestData requestData ) { - QMetaObject::invokeMethod( receiver, "notInCacheSlot", Q_ARG( uint, requestId ), Q_ARG( Tomahawk::InfoSystem::InfoCriteriaHash, criteria ), Q_ARG( Tomahawk::InfoSystem::InfoRequestData, requestData ) ); + QMetaObject::invokeMethod( receiver, "notInCacheSlot", Q_ARG( uint, requestId ), Q_ARG( Tomahawk::InfoSystem::InfoStringHash, criteria ), Q_ARG( Tomahawk::InfoSystem::InfoRequestData, requestData ) ); } void -InfoSystemCache::updateCacheSlot( Tomahawk::InfoSystem::InfoCriteriaHash criteria, qint64 maxAge, Tomahawk::InfoSystem::InfoType type, QVariant output ) +InfoSystemCache::updateCacheSlot( Tomahawk::InfoSystem::InfoStringHash criteria, qint64 maxAge, Tomahawk::InfoSystem::InfoType type, QVariant output ) { const QString criteriaHashVal = criteriaMd5( criteria ); const QString criteriaHashValWithType = criteriaMd5( criteria, type ); @@ -273,7 +273,7 @@ InfoSystemCache::updateCacheSlot( Tomahawk::InfoSystem::InfoCriteriaHash criteri const QString -InfoSystemCache::criteriaMd5( const Tomahawk::InfoSystem::InfoCriteriaHash &criteria, Tomahawk::InfoSystem::InfoType type ) const +InfoSystemCache::criteriaMd5( const Tomahawk::InfoSystem::InfoStringHash &criteria, Tomahawk::InfoSystem::InfoType type ) const { QCryptographicHash md5( QCryptographicHash::Md5 ); QStringList keys = criteria.keys(); diff --git a/src/libtomahawk/infosystem/infosystemcache.h b/src/libtomahawk/infosystem/infosystemcache.h index 40e1d2c03..5a013d663 100644 --- a/src/libtomahawk/infosystem/infosystemcache.h +++ b/src/libtomahawk/infosystem/infosystemcache.h @@ -46,16 +46,16 @@ signals: void info( uint requestId, Tomahawk::InfoSystem::InfoRequestData requestData, QVariant output ); public slots: - void getCachedInfoSlot( uint requestId, Tomahawk::InfoSystem::InfoCriteriaHash criteria, qint64 newMaxAge, Tomahawk::InfoSystem::InfoRequestData requestData ); - void updateCacheSlot( Tomahawk::InfoSystem::InfoCriteriaHash criteria, qint64 maxAge, Tomahawk::InfoSystem::InfoType type, QVariant output ); + void getCachedInfoSlot( uint requestId, Tomahawk::InfoSystem::InfoStringHash criteria, qint64 newMaxAge, Tomahawk::InfoSystem::InfoRequestData requestData ); + void updateCacheSlot( Tomahawk::InfoSystem::InfoStringHash criteria, qint64 maxAge, Tomahawk::InfoSystem::InfoType type, QVariant output ); private slots: void pruneTimerFired(); private: - void notInCache( QObject *receiver, uint requestId, Tomahawk::InfoSystem::InfoCriteriaHash criteria, Tomahawk::InfoSystem::InfoRequestData requestData ); + void notInCache( QObject *receiver, uint requestId, Tomahawk::InfoSystem::InfoStringHash criteria, Tomahawk::InfoSystem::InfoRequestData requestData ); void doUpgrade( uint oldVersion, uint newVersion ); - const QString criteriaMd5( const Tomahawk::InfoSystem::InfoCriteriaHash &criteria, Tomahawk::InfoSystem::InfoType type = Tomahawk::InfoSystem::InfoNoInfo ) const; + const QString criteriaMd5( const Tomahawk::InfoSystem::InfoStringHash &criteria, Tomahawk::InfoSystem::InfoType type = Tomahawk::InfoSystem::InfoNoInfo ) const; QString m_cacheBaseDir; QHash< InfoType, QHash< QString, QString > > m_fileLocationCache; diff --git a/src/libtomahawk/infosystem/infosystemworker.cpp b/src/libtomahawk/infosystem/infosystemworker.cpp index 5fd330a4c..9ae11951c 100644 --- a/src/libtomahawk/infosystem/infosystemworker.cpp +++ b/src/libtomahawk/infosystem/infosystemworker.cpp @@ -120,15 +120,15 @@ InfoSystemWorker::init( QWeakPointer< Tomahawk::InfoSystem::InfoSystemCache> cac connect( plugin.data(), - SIGNAL( getCachedInfo( uint, Tomahawk::InfoSystem::InfoCriteriaHash, qint64, Tomahawk::InfoSystem::InfoRequestData ) ), + SIGNAL( getCachedInfo( uint, Tomahawk::InfoSystem::InfoStringHash, qint64, Tomahawk::InfoSystem::InfoRequestData ) ), cache.data(), - SLOT( getCachedInfoSlot( uint, Tomahawk::InfoSystem::InfoCriteriaHash, qint64, Tomahawk::InfoSystem::InfoRequestData ) ) + SLOT( getCachedInfoSlot( uint, Tomahawk::InfoSystem::InfoStringHash, qint64, Tomahawk::InfoSystem::InfoRequestData ) ) ); connect( plugin.data(), - SIGNAL( updateCache( Tomahawk::InfoSystem::InfoCriteriaHash, qint64, Tomahawk::InfoSystem::InfoType, QVariant ) ), + SIGNAL( updateCache( Tomahawk::InfoSystem::InfoStringHash, qint64, Tomahawk::InfoSystem::InfoType, QVariant ) ), cache.data(), - SLOT( updateCacheSlot( Tomahawk::InfoSystem::InfoCriteriaHash, qint64, Tomahawk::InfoSystem::InfoType, QVariant ) ) + SLOT( updateCacheSlot( Tomahawk::InfoSystem::InfoStringHash, qint64, Tomahawk::InfoSystem::InfoType, QVariant ) ) ); connect( this, diff --git a/src/libtomahawk/playlist/albummodel.cpp b/src/libtomahawk/playlist/albummodel.cpp index 9d4e13ed2..7c629777d 100644 --- a/src/libtomahawk/playlist/albummodel.cpp +++ b/src/libtomahawk/playlist/albummodel.cpp @@ -329,7 +329,7 @@ AlbumModel::getCover( const QModelIndex& index ) if ( !item || !item->cover.isNull() ) return false; - Tomahawk::InfoSystem::InfoCriteriaHash trackInfo; + Tomahawk::InfoSystem::InfoStringHash trackInfo; if ( !item->album()->artist().isNull() ) trackInfo["artist"] = item->album()->artist()->name(); trackInfo["album"] = item->album()->name(); @@ -339,7 +339,7 @@ AlbumModel::getCover( const QModelIndex& index ) Tomahawk::InfoSystem::InfoRequestData requestData; requestData.caller = s_tmInfoIdentifier; requestData.type = Tomahawk::InfoSystem::InfoAlbumCoverArt; - requestData.input = QVariant::fromValue< Tomahawk::InfoSystem::InfoCriteriaHash >( trackInfo ); + requestData.input = QVariant::fromValue< Tomahawk::InfoSystem::InfoStringHash >( trackInfo ); requestData.customData = QVariantMap(); Tomahawk::InfoSystem::InfoSystem::instance()->getInfo( requestData ); @@ -365,7 +365,7 @@ AlbumModel::infoSystemInfo( Tomahawk::InfoSystem::InfoRequestData requestData, Q return; } - Tomahawk::InfoSystem::InfoCriteriaHash pptr = requestData.input.value< Tomahawk::InfoSystem::InfoCriteriaHash >(); + Tomahawk::InfoSystem::InfoStringHash pptr = requestData.input.value< Tomahawk::InfoSystem::InfoStringHash >(); QVariantMap returnedData = output.value< QVariantMap >(); const QByteArray ba = returnedData["imgbytes"].toByteArray(); if ( ba.length() ) diff --git a/src/libtomahawk/playlist/treemodel.cpp b/src/libtomahawk/playlist/treemodel.cpp index ebe9bd008..8dd336ea5 100644 --- a/src/libtomahawk/playlist/treemodel.cpp +++ b/src/libtomahawk/playlist/treemodel.cpp @@ -88,7 +88,7 @@ TreeModel::getCover( const QModelIndex& index ) if ( !item->cover.isNull() ) return; - Tomahawk::InfoSystem::InfoCriteriaHash trackInfo; + Tomahawk::InfoSystem::InfoStringHash trackInfo; Tomahawk::InfoSystem::InfoRequestData requestData; if ( !item->artist().isNull() ) @@ -109,7 +109,7 @@ TreeModel::getCover( const QModelIndex& index ) m_coverHash.insert( (qlonglong)item, index ); requestData.caller = m_infoId; - requestData.input = QVariant::fromValue< Tomahawk::InfoSystem::InfoCriteriaHash >( trackInfo ); + requestData.input = QVariant::fromValue< Tomahawk::InfoSystem::InfoStringHash >( trackInfo ); requestData.customData = QVariantMap(); Tomahawk::InfoSystem::InfoSystem::instance()->getInfo( requestData ); } @@ -588,13 +588,13 @@ TreeModel::addAlbums( const artist_ptr& artist, const QModelIndex& parent ) } else if ( m_mode == InfoSystem ) { - Tomahawk::InfoSystem::InfoCriteriaHash artistInfo; + Tomahawk::InfoSystem::InfoStringHash artistInfo; artistInfo["artist"] = artist->name(); Tomahawk::InfoSystem::InfoRequestData requestData; requestData.caller = m_infoId; requestData.customData["row"] = parent.row(); - requestData.input = QVariant::fromValue< Tomahawk::InfoSystem::InfoCriteriaHash >( artistInfo ); + requestData.input = QVariant::fromValue< Tomahawk::InfoSystem::InfoStringHash >( artistInfo ); requestData.type = Tomahawk::InfoSystem::InfoArtistReleases; Tomahawk::InfoSystem::InfoSystem::instance()->getInfo( requestData ); } @@ -625,14 +625,14 @@ TreeModel::addTracks( const album_ptr& album, const QModelIndex& parent ) } else if ( m_mode == InfoSystem ) { - Tomahawk::InfoSystem::InfoCriteriaHash artistInfo; + Tomahawk::InfoSystem::InfoStringHash artistInfo; artistInfo["artist"] = album->artist()->name(); artistInfo["album"] = album->name(); Tomahawk::InfoSystem::InfoRequestData requestData; requestData.caller = m_infoId; requestData.customData["rows"] = QVariant( rows ); - requestData.input = QVariant::fromValue< Tomahawk::InfoSystem::InfoCriteriaHash >( artistInfo ); + requestData.input = QVariant::fromValue< Tomahawk::InfoSystem::InfoStringHash >( artistInfo ); requestData.type = Tomahawk::InfoSystem::InfoAlbumSongs; Tomahawk::InfoSystem::InfoSystem::instance()->getInfo( requestData ); } @@ -798,7 +798,7 @@ TreeModel::infoSystemInfo( Tomahawk::InfoSystem::InfoRequestData requestData, QV case Tomahawk::InfoSystem::InfoAlbumCoverArt: case Tomahawk::InfoSystem::InfoArtistImages: { - Tomahawk::InfoSystem::InfoCriteriaHash pptr = requestData.input.value< Tomahawk::InfoSystem::InfoCriteriaHash >(); + Tomahawk::InfoSystem::InfoStringHash pptr = requestData.input.value< Tomahawk::InfoSystem::InfoStringHash >(); QVariantMap returnedData = output.value< QVariantMap >(); const QByteArray ba = returnedData["imgbytes"].toByteArray(); if ( ba.length() ) @@ -826,8 +826,8 @@ TreeModel::infoSystemInfo( Tomahawk::InfoSystem::InfoRequestData requestData, QV QStringList albums = returnedData[ "albums" ].toStringList(); QList al; - InfoSystem::InfoCriteriaHash inputInfo; - inputInfo = requestData.input.value< InfoSystem::InfoCriteriaHash >(); + InfoSystem::InfoStringHash inputInfo; + inputInfo = requestData.input.value< InfoSystem::InfoStringHash >(); artist_ptr artist = Artist::get( inputInfo[ "artist" ], false ); if ( artist.isNull() ) @@ -849,8 +849,8 @@ TreeModel::infoSystemInfo( Tomahawk::InfoSystem::InfoRequestData requestData, QV QStringList tracks = returnedData[ "tracks" ].toStringList(); QList ql; - InfoSystem::InfoCriteriaHash inputInfo; - inputInfo = requestData.input.value< InfoSystem::InfoCriteriaHash >(); + InfoSystem::InfoStringHash inputInfo; + inputInfo = requestData.input.value< InfoSystem::InfoStringHash >(); foreach ( const QString& trackName, tracks ) { diff --git a/src/libtomahawk/widgets/infowidgets/AlbumInfoWidget.cpp b/src/libtomahawk/widgets/infowidgets/AlbumInfoWidget.cpp index b2d07dec6..f4250afd6 100644 --- a/src/libtomahawk/widgets/infowidgets/AlbumInfoWidget.cpp +++ b/src/libtomahawk/widgets/infowidgets/AlbumInfoWidget.cpp @@ -136,14 +136,14 @@ AlbumInfoWidget::load( const album_ptr& album ) Database::instance()->enqueue( QSharedPointer( cmd ) ); - Tomahawk::InfoSystem::InfoCriteriaHash trackInfo; + Tomahawk::InfoSystem::InfoStringHash trackInfo; trackInfo["artist"] = album->artist()->name(); trackInfo["album"] = album->name(); Tomahawk::InfoSystem::InfoRequestData requestData; requestData.caller = s_aiInfoIdentifier; requestData.type = Tomahawk::InfoSystem::InfoAlbumCoverArt; - requestData.input = QVariant::fromValue< Tomahawk::InfoSystem::InfoCriteriaHash >( trackInfo ); + requestData.input = QVariant::fromValue< Tomahawk::InfoSystem::InfoStringHash >( trackInfo ); requestData.customData = QVariantMap(); Tomahawk::InfoSystem::InfoSystem::instance()->getInfo( requestData ); @@ -169,8 +169,8 @@ AlbumInfoWidget::infoSystemInfo( Tomahawk::InfoSystem::InfoRequestData requestDa return; } - InfoSystem::InfoCriteriaHash trackInfo; - trackInfo = requestData.input.value< InfoSystem::InfoCriteriaHash >(); + InfoSystem::InfoStringHash trackInfo; + trackInfo = requestData.input.value< InfoSystem::InfoStringHash >(); if ( output.canConvert< QVariantMap >() ) { diff --git a/src/libtomahawk/widgets/infowidgets/ArtistInfoWidget.cpp b/src/libtomahawk/widgets/infowidgets/ArtistInfoWidget.cpp index 269ee626d..553d93680 100644 --- a/src/libtomahawk/widgets/infowidgets/ArtistInfoWidget.cpp +++ b/src/libtomahawk/widgets/infowidgets/ArtistInfoWidget.cpp @@ -133,7 +133,7 @@ ArtistInfoWidget::load( const artist_ptr& artist ) m_title = artist->name(); m_albumsModel->addAlbums( artist, QModelIndex() ); - Tomahawk::InfoSystem::InfoCriteriaHash artistInfo; + Tomahawk::InfoSystem::InfoStringHash artistInfo; artistInfo["artist"] = artist->name(); Tomahawk::InfoSystem::InfoRequestData requestData; @@ -144,7 +144,7 @@ ArtistInfoWidget::load( const artist_ptr& artist ) requestData.type = Tomahawk::InfoSystem::InfoArtistBiography; Tomahawk::InfoSystem::InfoSystem::instance()->getInfo( requestData ); - requestData.input = QVariant::fromValue< Tomahawk::InfoSystem::InfoCriteriaHash >( artistInfo ); + requestData.input = QVariant::fromValue< Tomahawk::InfoSystem::InfoStringHash >( artistInfo ); requestData.type = Tomahawk::InfoSystem::InfoArtistImages; Tomahawk::InfoSystem::InfoSystem::instance()->getInfo( requestData ); @@ -163,8 +163,8 @@ ArtistInfoWidget::infoSystemInfo( Tomahawk::InfoSystem::InfoRequestData requestD if ( requestData.caller != m_infoId ) return; - InfoSystem::InfoCriteriaHash trackInfo; - trackInfo = requestData.input.value< InfoSystem::InfoCriteriaHash >(); + InfoSystem::InfoStringHash trackInfo; + trackInfo = requestData.input.value< InfoSystem::InfoStringHash >(); if ( output.canConvert< QVariantMap >() ) { diff --git a/src/libtomahawk/widgets/whatshotwidget.cpp b/src/libtomahawk/widgets/whatshotwidget.cpp index 2d5ba5864..38e444ee3 100644 --- a/src/libtomahawk/widgets/whatshotwidget.cpp +++ b/src/libtomahawk/widgets/whatshotwidget.cpp @@ -112,12 +112,12 @@ WhatsHotWidget::~WhatsHotWidget() void WhatsHotWidget::fetchData() { - Tomahawk::InfoSystem::InfoCriteriaHash artistInfo; + Tomahawk::InfoSystem::InfoStringHash artistInfo; Tomahawk::InfoSystem::InfoRequestData requestData; requestData.caller = s_whatsHotIdentifier; requestData.customData = QVariantMap(); - requestData.input = QVariant::fromValue< Tomahawk::InfoSystem::InfoCriteriaHash >( artistInfo ); + requestData.input = QVariant::fromValue< Tomahawk::InfoSystem::InfoStringHash >( artistInfo ); requestData.type = Tomahawk::InfoSystem::InfoChartCapabilities; Tomahawk::InfoSystem::InfoSystem::instance()->getInfo( requestData, 20000, true ); @@ -166,7 +166,7 @@ WhatsHotWidget::infoSystemInfo( Tomahawk::InfoSystem::InfoRequestData requestDat if( !returnedData.contains(type) ) break; const QString side = requestData.customData["whatshot_side"].toString(); - const QString chartId = requestData.input.value< Tomahawk::InfoSystem::InfoCriteriaHash >().value( "chart_id" ); + const QString chartId = requestData.input.value< Tomahawk::InfoSystem::InfoStringHash >().value( "chart_id" ); m_queuedFetches.remove( chartId ); tDebug( LOGVERBOSE ) << "WhatsHot: got chart! " << type << " on " << side; @@ -190,11 +190,11 @@ WhatsHotWidget::infoSystemInfo( Tomahawk::InfoSystem::InfoRequestData requestDat else if( type == "albums" ) { QList al; - const QList albums = returnedData[ "albums" ].value >(); + const QList albums = returnedData[ "albums" ].value >(); tDebug( LOGVERBOSE ) << "WhatsHot: got albums! " << albums.size(); AlbumModel* albumModel = new AlbumModel( ui->additionsView ); - foreach ( const Tomahawk::InfoSystem::InfoCriteriaHash& album, albums ) + foreach ( const Tomahawk::InfoSystem::InfoStringHash& album, albums ) { qDebug() << "Getting album" << album[ "album" ] << "By" << album[ "artist" ]; artist_ptr artistPtr = Artist::get( album[ "artist" ], false ); @@ -210,13 +210,13 @@ WhatsHotWidget::infoSystemInfo( Tomahawk::InfoSystem::InfoRequestData requestDat } else if( type == "tracks" ) { - const QList tracks = returnedData[ "tracks" ].value >(); + const QList tracks = returnedData[ "tracks" ].value >(); tDebug( LOGVERBOSE ) << "WhatsHot: got tracks! " << tracks.size(); PlaylistModel* trackModel = new PlaylistModel( ui->tracksViewLeft ); trackModel->setStyle( TrackModel::Short ); QList tracklist; - foreach ( const Tomahawk::InfoSystem::InfoCriteriaHash& track, tracks ) + foreach ( const Tomahawk::InfoSystem::InfoStringHash& track, tracks ) { query_ptr query = Query::get( track[ "artist" ], track[ "track" ], QString(), uuid(), false ); tracklist << query; @@ -289,7 +289,7 @@ WhatsHotWidget::leftCrumbIndexChanged( QModelIndex index ) return; } - Tomahawk::InfoSystem::InfoCriteriaHash criteria; + Tomahawk::InfoSystem::InfoStringHash criteria; criteria.insert( "chart_id", chartId ); /// Remember to lower the source! criteria.insert( "chart_source", index.data().toString().toLower() ); @@ -299,7 +299,7 @@ WhatsHotWidget::leftCrumbIndexChanged( QModelIndex index ) customData.insert( "whatshot_side", "left" ); requestData.caller = s_whatsHotIdentifier; requestData.customData = customData; - requestData.input = QVariant::fromValue< Tomahawk::InfoSystem::InfoCriteriaHash >( criteria ); + requestData.input = QVariant::fromValue< Tomahawk::InfoSystem::InfoStringHash >( criteria ); requestData.type = Tomahawk::InfoSystem::InfoChart; diff --git a/src/scrobbler.cpp b/src/scrobbler.cpp index f6732e0d2..e43613bd2 100644 --- a/src/scrobbler.cpp +++ b/src/scrobbler.cpp @@ -78,7 +78,7 @@ Scrobbler::trackStarted( const Tomahawk::result_ptr& track ) scrobble(); } - Tomahawk::InfoSystem::InfoCriteriaHash trackInfo; + Tomahawk::InfoSystem::InfoStringHash trackInfo; trackInfo["title"] = track->track(); trackInfo["artist"] = track->artist()->name(); @@ -87,7 +87,7 @@ Scrobbler::trackStarted( const Tomahawk::result_ptr& track ) Tomahawk::InfoSystem::InfoSystem::instance()->pushInfo( s_scInfoIdentifier, Tomahawk::InfoSystem::InfoSubmitNowPlaying, - QVariant::fromValue< Tomahawk::InfoSystem::InfoCriteriaHash >( trackInfo ) ); + QVariant::fromValue< Tomahawk::InfoSystem::InfoStringHash >( trackInfo ) ); m_scrobblePoint = ScrobblePoint( track->duration() / 2 ); } diff --git a/src/tomahawkapp.cpp b/src/tomahawkapp.cpp index a7196329c..798684eab 100644 --- a/src/tomahawkapp.cpp +++ b/src/tomahawkapp.cpp @@ -408,12 +408,12 @@ TomahawkApp::registerMetaTypes() qRegisterMetaType< AudioErrorCode >("AudioErrorCode"); - qRegisterMetaType< QHash< QString, QString > >( "Tomahawk::InfoSystem::InfoCriteriaHash" ); + qRegisterMetaType< QHash< QString, QString > >( "Tomahawk::InfoSystem::InfoStringHash" ); qRegisterMetaType< Tomahawk::InfoSystem::InfoType >( "Tomahawk::InfoSystem::InfoType" ); qRegisterMetaType< Tomahawk::InfoSystem::InfoRequestData >( "Tomahawk::InfoSystem::InfoRequestData" ); qRegisterMetaType< QWeakPointer< Tomahawk::InfoSystem::InfoSystemCache > >( "QWeakPointer< Tomahawk::InfoSystem::InfoSystemCache >" ); - qRegisterMetaType< QList >("QList"); + qRegisterMetaType< QList >("QList"); qRegisterMetaType< Tomahawk::InfoSystem::Chart>("Tomahawk::InfoSystem::Chart"); qRegisterMetaType< QList >("QList"); qRegisterMetaType< QPersistentModelIndex >( "QPersistentModelIndex" );