1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-03-20 07:49:42 +01:00

Since InfoCriteriaHash is now being used for things that aren't

criteria, rename it to the more generic InfoStringHash
This commit is contained in:
Jeff Mitchell 2011-10-20 16:26:08 -04:00
parent d73800bd5f
commit b2dc6f1f3c
29 changed files with 146 additions and 146 deletions

View File

@ -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<DatabaseCommand>(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<DatabaseCommand>(cmd) );

View File

@ -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<DatabaseCommand>(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 ) );
}
}

View File

@ -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 >() )
{

View File

@ -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 >() )
{

View File

@ -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 );

View File

@ -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<InfoCriteriaHash> top_tracks;
QList<InfoCriteriaHash> top_albums;
QList<InfoStringHash> top_tracks;
QList<InfoStringHash> 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;

View File

@ -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 );

View File

@ -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 );

View File

@ -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<QString, QString> 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<lastfm::Track> tracks = parseTrackList( reply );
QList<InfoCriteriaHash> top_tracks;
QList<InfoStringHash> 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 );
}

View File

@ -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 );

View File

@ -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 );

View File

@ -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 );

View File

@ -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 );

View File

@ -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;

View File

@ -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;

View File

@ -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 );

View File

@ -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 )

View File

@ -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 );

View File

@ -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<Tomahawk::InfoSystem::InfoCriteriaHash> );
Q_DECLARE_METATYPE( QList<Tomahawk::InfoSystem::InfoStringHash> );
Q_DECLARE_METATYPE( QList<Tomahawk::InfoSystem::Chart> );
#endif // TOMAHAWK_INFOSYSTEM_H

View File

@ -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();

View File

@ -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;

View File

@ -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,

View File

@ -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() )

View File

@ -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<album_ptr> 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<query_ptr> ql;
InfoSystem::InfoCriteriaHash inputInfo;
inputInfo = requestData.input.value< InfoSystem::InfoCriteriaHash >();
InfoSystem::InfoStringHash inputInfo;
inputInfo = requestData.input.value< InfoSystem::InfoStringHash >();
foreach ( const QString& trackName, tracks )
{

View File

@ -136,14 +136,14 @@ AlbumInfoWidget::load( const album_ptr& album )
Database::instance()->enqueue( QSharedPointer<DatabaseCommand>( 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 >() )
{

View File

@ -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 >() )
{

View File

@ -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<album_ptr> al;
const QList<Tomahawk::InfoSystem::InfoCriteriaHash> albums = returnedData[ "albums" ].value<QList<Tomahawk::InfoSystem::InfoCriteriaHash> >();
const QList<Tomahawk::InfoSystem::InfoStringHash> albums = returnedData[ "albums" ].value<QList<Tomahawk::InfoSystem::InfoStringHash> >();
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<Tomahawk::InfoSystem::InfoCriteriaHash> tracks = returnedData[ "tracks" ].value<QList<Tomahawk::InfoSystem::InfoCriteriaHash> >();
const QList<Tomahawk::InfoSystem::InfoStringHash> tracks = returnedData[ "tracks" ].value<QList<Tomahawk::InfoSystem::InfoStringHash> >();
tDebug( LOGVERBOSE ) << "WhatsHot: got tracks! " << tracks.size();
PlaylistModel* trackModel = new PlaylistModel( ui->tracksViewLeft );
trackModel->setStyle( TrackModel::Short );
QList<query_ptr> 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;

View File

@ -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 );
}

View File

@ -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<Tomahawk::InfoSystem::InfoCriteriaHash> >("QList<Tomahawk::InfoSystem::InfoCriteriaHash>");
qRegisterMetaType< QList<Tomahawk::InfoSystem::InfoStringHash> >("QList<Tomahawk::InfoSystem::InfoStringHash>");
qRegisterMetaType< Tomahawk::InfoSystem::Chart>("Tomahawk::InfoSystem::Chart");
qRegisterMetaType< QList<Tomahawk::InfoSystem::Chart> >("QList<Tomahawk::InfoSystem::Chart>");
qRegisterMetaType< QPersistentModelIndex >( "QPersistentModelIndex" );