mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-03-25 10:19:41 +01:00
Replace InfoCustomData with QVariantMap
This commit is contained in:
parent
7c9c046b17
commit
ce7040d1fd
@ -167,8 +167,8 @@ AudioControls::AudioControls( QWidget* parent )
|
||||
.scaled( ui->coverImage->size(), Qt::IgnoreAspectRatio, Qt::SmoothTransformation );
|
||||
|
||||
connect( Tomahawk::InfoSystem::InfoSystem::instance(),
|
||||
SIGNAL( info( QString, Tomahawk::InfoSystem::InfoType, QVariant, QVariant, Tomahawk::InfoSystem::InfoCustomData ) ),
|
||||
SLOT( infoSystemInfo( QString, Tomahawk::InfoSystem::InfoType, QVariant, QVariant, Tomahawk::InfoSystem::InfoCustomData ) ) );
|
||||
SIGNAL( info( QString, Tomahawk::InfoSystem::InfoType, QVariant, QVariant, QVariantMap ) ),
|
||||
SLOT( infoSystemInfo( QString, Tomahawk::InfoSystem::InfoType, QVariant, QVariant, QVariantMap ) ) );
|
||||
|
||||
connect( Tomahawk::InfoSystem::InfoSystem::instance(), SIGNAL( finished( QString ) ), SLOT( infoSystemFinished( QString ) ) );
|
||||
|
||||
@ -220,12 +220,12 @@ AudioControls::onPlaybackStarted( const Tomahawk::result_ptr& result )
|
||||
|
||||
Tomahawk::InfoSystem::InfoSystem::instance()->getInfo(
|
||||
s_acInfoIdentifier, Tomahawk::InfoSystem::InfoAlbumCoverArt,
|
||||
QVariant::fromValue< Tomahawk::InfoSystem::InfoCriteriaHash >( trackInfo ), Tomahawk::InfoSystem::InfoCustomData() );
|
||||
QVariant::fromValue< Tomahawk::InfoSystem::InfoCriteriaHash >( trackInfo ), QVariantMap() );
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
AudioControls::infoSystemInfo( QString caller, Tomahawk::InfoSystem::InfoType type, QVariant input, QVariant output, Tomahawk::InfoSystem::InfoCustomData customData )
|
||||
AudioControls::infoSystemInfo( QString caller, Tomahawk::InfoSystem::InfoType type, QVariant input, QVariant output, QVariantMap customData )
|
||||
{
|
||||
Q_UNUSED( input );
|
||||
Q_UNUSED( customData );
|
||||
@ -243,13 +243,13 @@ AudioControls::infoSystemInfo( QString caller, Tomahawk::InfoSystem::InfoType ty
|
||||
return;
|
||||
}
|
||||
|
||||
if ( !output.canConvert< Tomahawk::InfoSystem::InfoCustomData >() )
|
||||
if ( !output.canConvert< QVariantMap >() )
|
||||
{
|
||||
qDebug() << "Cannot convert fetched art from a QByteArray";
|
||||
return;
|
||||
}
|
||||
|
||||
Tomahawk::InfoSystem::InfoCustomData returnedData = output.value< Tomahawk::InfoSystem::InfoCustomData >();
|
||||
QVariantMap returnedData = output.value< QVariantMap >();
|
||||
const QByteArray ba = returnedData["imgbytes"].toByteArray();
|
||||
if ( ba.length() )
|
||||
{
|
||||
|
@ -67,7 +67,7 @@ private slots:
|
||||
void onTrackClicked();
|
||||
void onLoveButtonClicked( bool );
|
||||
|
||||
void infoSystemInfo( QString caller, Tomahawk::InfoSystem::InfoType type, QVariant input, QVariant output, Tomahawk::InfoSystem::InfoCustomData customData );
|
||||
void infoSystemInfo( QString caller, Tomahawk::InfoSystem::InfoType type, QVariant input, QVariant output, QVariantMap customData );
|
||||
void infoSystemFinished( QString target );
|
||||
|
||||
private:
|
||||
|
@ -154,9 +154,9 @@ AudioEngine::stop()
|
||||
sendWaitingNotification();
|
||||
else if ( TomahawkSettings::instance()->verboseNotifications() )
|
||||
{
|
||||
Tomahawk::InfoSystem::InfoCustomData stopInfo;
|
||||
QVariantMap stopInfo;
|
||||
stopInfo["message"] = QString( "Tomahawk is stopped." );
|
||||
map[ Tomahawk::InfoSystem::InfoNotifyUser ] = QVariant::fromValue< Tomahawk::InfoSystem::InfoCustomData >( stopInfo );
|
||||
map[ Tomahawk::InfoSystem::InfoNotifyUser ] = QVariant::fromValue< QVariantMap >( stopInfo );
|
||||
}
|
||||
|
||||
Tomahawk::InfoSystem::InfoSystem::instance()->pushInfo( s_aeInfoIdentifier, map );
|
||||
@ -240,11 +240,11 @@ AudioEngine::mute()
|
||||
void
|
||||
AudioEngine::sendWaitingNotification() const
|
||||
{
|
||||
Tomahawk::InfoSystem::InfoCustomData retryInfo;
|
||||
QVariantMap retryInfo;
|
||||
retryInfo["message"] = QString( "The current track could not be resolved. Tomahawk will pick back up with the next resolvable track from this source." );
|
||||
Tomahawk::InfoSystem::InfoSystem::instance()->pushInfo(
|
||||
s_aeInfoIdentifier, Tomahawk::InfoSystem::InfoNotifyUser,
|
||||
QVariant::fromValue< Tomahawk::InfoSystem::InfoCustomData >( retryInfo ) );
|
||||
QVariant::fromValue< QVariantMap >( retryInfo ) );
|
||||
}
|
||||
|
||||
|
||||
@ -256,8 +256,8 @@ AudioEngine::sendNowPlayingNotification()
|
||||
if ( ! m_infoSystemConnected )
|
||||
{
|
||||
connect( Tomahawk::InfoSystem::InfoSystem::instance(),
|
||||
SIGNAL( info( QString, Tomahawk::InfoSystem::InfoType, QVariant, QVariant, Tomahawk::InfoSystem::InfoCustomData ) ),
|
||||
SLOT( infoSystemInfo( QString, Tomahawk::InfoSystem::InfoType, QVariant, QVariant, Tomahawk::InfoSystem::InfoCustomData ) ) );
|
||||
SIGNAL( info( QString, Tomahawk::InfoSystem::InfoType, QVariant, QVariant, QVariantMap ) ),
|
||||
SLOT( infoSystemInfo( QString, Tomahawk::InfoSystem::InfoType, QVariant, QVariant, QVariantMap ) ) );
|
||||
|
||||
connect( Tomahawk::InfoSystem::InfoSystem::instance(), SIGNAL( finished( QString ) ), SLOT( infoSystemFinished( QString ) ) );
|
||||
|
||||
@ -270,12 +270,12 @@ AudioEngine::sendNowPlayingNotification()
|
||||
|
||||
Tomahawk::InfoSystem::InfoSystem::instance()->getInfo(
|
||||
s_aeInfoIdentifier, Tomahawk::InfoSystem::InfoAlbumCoverArt,
|
||||
QVariant::fromValue< Tomahawk::InfoSystem::InfoCriteriaHash >( trackInfo ), Tomahawk::InfoSystem::InfoCustomData() );
|
||||
QVariant::fromValue< Tomahawk::InfoSystem::InfoCriteriaHash >( trackInfo ), QVariantMap() );
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
AudioEngine::infoSystemInfo( QString caller, Tomahawk::InfoSystem::InfoType type, QVariant input, QVariant output, Tomahawk::InfoSystem::InfoCustomData customData )
|
||||
AudioEngine::infoSystemInfo( QString caller, Tomahawk::InfoSystem::InfoType type, QVariant input, QVariant output, QVariantMap customData )
|
||||
{
|
||||
qDebug() << Q_FUNC_INFO;
|
||||
Q_UNUSED( input );
|
||||
@ -288,7 +288,7 @@ AudioEngine::infoSystemInfo( QString caller, Tomahawk::InfoSystem::InfoType type
|
||||
return;
|
||||
}
|
||||
|
||||
Tomahawk::InfoSystem::InfoCustomData playInfo;
|
||||
QVariantMap playInfo;
|
||||
playInfo["message"] = QString( "Tomahawk is playing \"%1\" by %2 on album %3." )
|
||||
.arg( m_currentTrack->track() )
|
||||
.arg( m_currentTrack->artist()->name() )
|
||||
@ -296,7 +296,7 @@ AudioEngine::infoSystemInfo( QString caller, Tomahawk::InfoSystem::InfoType type
|
||||
if ( !output.isNull() && output.isValid() )
|
||||
{
|
||||
qDebug() << Q_FUNC_INFO << " output is valid";
|
||||
Tomahawk::InfoSystem::InfoCustomData returnedData = output.value< Tomahawk::InfoSystem::InfoCustomData >();
|
||||
QVariantMap returnedData = output.value< QVariantMap >();
|
||||
const QByteArray ba = returnedData["imgbytes"].toByteArray();
|
||||
qDebug() << "ba.length = " << ba.length();
|
||||
if ( ba.length() )
|
||||
@ -309,7 +309,7 @@ AudioEngine::infoSystemInfo( QString caller, Tomahawk::InfoSystem::InfoType type
|
||||
|
||||
Tomahawk::InfoSystem::InfoSystem::instance()->pushInfo(
|
||||
s_aeInfoIdentifier, Tomahawk::InfoSystem::InfoNotifyUser,
|
||||
QVariant::fromValue< Tomahawk::InfoSystem::InfoCustomData >( playInfo ) );
|
||||
QVariant::fromValue< QVariantMap >( playInfo ) );
|
||||
}
|
||||
|
||||
|
||||
|
@ -87,7 +87,7 @@ public slots:
|
||||
|
||||
void playlistNextTrackReady();
|
||||
|
||||
void infoSystemInfo( QString caller, Tomahawk::InfoSystem::InfoType type, QVariant input, QVariant output, Tomahawk::InfoSystem::InfoCustomData customData );
|
||||
void infoSystemInfo( QString caller, Tomahawk::InfoSystem::InfoType type, QVariant input, QVariant output, QVariantMap customData );
|
||||
void infoSystemFinished( QString caller );
|
||||
|
||||
signals:
|
||||
|
@ -66,7 +66,7 @@ EchoNestPlugin::namChangedSlot( QNetworkAccessManager *nam )
|
||||
}
|
||||
|
||||
void
|
||||
EchoNestPlugin::getInfo(const QString caller, const Tomahawk::InfoSystem::InfoType type, const QVariant input, const Tomahawk::InfoSystem::InfoCustomData customData)
|
||||
EchoNestPlugin::getInfo(const QString caller, const Tomahawk::InfoSystem::InfoType type, const QVariant input, const QVariantMap customData)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
@ -91,7 +91,7 @@ EchoNestPlugin::getInfo(const QString caller, const Tomahawk::InfoSystem::InfoTy
|
||||
}
|
||||
|
||||
void
|
||||
EchoNestPlugin::getSongProfile(const QString &caller, const QVariant &input, const InfoCustomData &customData, const QString &item)
|
||||
EchoNestPlugin::getSongProfile(const QString &caller, const QVariant &input, const QVariantMap &customData, const QString &item)
|
||||
{
|
||||
//WARNING: Totally not implemented yet
|
||||
Q_UNUSED( item );
|
||||
@ -108,7 +108,7 @@ EchoNestPlugin::getSongProfile(const QString &caller, const QVariant &input, con
|
||||
}
|
||||
|
||||
void
|
||||
EchoNestPlugin::getArtistBiography(const QString &caller, const QVariant &input, const InfoCustomData &customData)
|
||||
EchoNestPlugin::getArtistBiography(const QString &caller, const QVariant &input, const QVariantMap &customData)
|
||||
{
|
||||
if( !isValidArtistData( caller, input, customData ) )
|
||||
return;
|
||||
@ -123,7 +123,7 @@ EchoNestPlugin::getArtistBiography(const QString &caller, const QVariant &input,
|
||||
}
|
||||
|
||||
void
|
||||
EchoNestPlugin::getArtistFamiliarity(const QString &caller, const QVariant &input, const InfoCustomData &customData)
|
||||
EchoNestPlugin::getArtistFamiliarity(const QString &caller, const QVariant &input, const QVariantMap &customData)
|
||||
{
|
||||
if( !isValidArtistData( caller, input, customData ) )
|
||||
return;
|
||||
@ -139,7 +139,7 @@ EchoNestPlugin::getArtistFamiliarity(const QString &caller, const QVariant &inpu
|
||||
}
|
||||
|
||||
void
|
||||
EchoNestPlugin::getArtistHotttnesss(const QString &caller, const QVariant &input, const InfoCustomData &customData)
|
||||
EchoNestPlugin::getArtistHotttnesss(const QString &caller, const QVariant &input, const QVariantMap &customData)
|
||||
{
|
||||
if( !isValidArtistData( caller, input, customData ) )
|
||||
return;
|
||||
@ -154,7 +154,7 @@ EchoNestPlugin::getArtistHotttnesss(const QString &caller, const QVariant &input
|
||||
}
|
||||
|
||||
void
|
||||
EchoNestPlugin::getArtistTerms(const QString &caller, const QVariant &input, const InfoCustomData &customData)
|
||||
EchoNestPlugin::getArtistTerms(const QString &caller, const QVariant &input, const QVariantMap &customData)
|
||||
{
|
||||
if( !isValidArtistData( caller, input, customData ) )
|
||||
return;
|
||||
@ -169,7 +169,7 @@ EchoNestPlugin::getArtistTerms(const QString &caller, const QVariant &input, con
|
||||
}
|
||||
|
||||
void
|
||||
EchoNestPlugin::getMiscTopTerms(const QString &caller, const QVariant &input, const InfoCustomData& customData)
|
||||
EchoNestPlugin::getMiscTopTerms(const QString &caller, const QVariant &input, const QVariantMap& customData)
|
||||
{
|
||||
Q_UNUSED( input );
|
||||
QNetworkReply* reply = Echonest::Artist::topTerms( 20 );
|
||||
@ -200,7 +200,7 @@ EchoNestPlugin::getArtistBiographySlot()
|
||||
Tomahawk::InfoSystem::InfoArtistBiography,
|
||||
reply->property( "input" ),
|
||||
QVariant::fromValue< Tomahawk::InfoSystem::InfoGenericMap >( biographyMap ),
|
||||
reply->property( "customData" ).value< Tomahawk::InfoSystem::InfoCustomData >() );
|
||||
reply->property( "customData" ).value< QVariantMap >() );
|
||||
reply->deleteLater();
|
||||
}
|
||||
|
||||
@ -214,7 +214,7 @@ EchoNestPlugin::getArtistFamiliaritySlot()
|
||||
Tomahawk::InfoSystem::InfoArtistFamiliarity,
|
||||
reply->property( "input" ),
|
||||
familiarity,
|
||||
reply->property( "customData" ).value< Tomahawk::InfoSystem::InfoCustomData >() );
|
||||
reply->property( "customData" ).value< QVariantMap >() );
|
||||
reply->deleteLater();
|
||||
}
|
||||
|
||||
@ -228,7 +228,7 @@ EchoNestPlugin::getArtistHotttnesssSlot()
|
||||
Tomahawk::InfoSystem::InfoArtistHotttness,
|
||||
reply->property( "input" ),
|
||||
hotttnesss,
|
||||
reply->property( "customData" ).value< Tomahawk::InfoSystem::InfoCustomData >() );
|
||||
reply->property( "customData" ).value< QVariantMap >() );
|
||||
reply->deleteLater();
|
||||
}
|
||||
|
||||
@ -249,7 +249,7 @@ EchoNestPlugin::getArtistTermsSlot()
|
||||
Tomahawk::InfoSystem::InfoArtistTerms,
|
||||
reply->property( "input" ),
|
||||
QVariant::fromValue< Tomahawk::InfoSystem::InfoGenericMap >( termsMap ),
|
||||
reply->property( "customData" ).value< Tomahawk::InfoSystem::InfoCustomData >() );
|
||||
reply->property( "customData" ).value< QVariantMap >() );
|
||||
reply->deleteLater();
|
||||
}
|
||||
|
||||
@ -269,12 +269,12 @@ EchoNestPlugin::getMiscTopSlot()
|
||||
Tomahawk::InfoSystem::InfoMiscTopTerms,
|
||||
QVariant(),
|
||||
QVariant::fromValue< Tomahawk::InfoSystem::InfoGenericMap >( termsMap ),
|
||||
reply->property( "customData" ).value< Tomahawk::InfoSystem::InfoCustomData >() );
|
||||
reply->property( "customData" ).value< QVariantMap >() );
|
||||
reply->deleteLater();
|
||||
}
|
||||
|
||||
bool
|
||||
EchoNestPlugin::isValidArtistData(const QString &caller, const QVariant &input, const InfoCustomData &customData)
|
||||
EchoNestPlugin::isValidArtistData(const QString &caller, const QVariant &input, const QVariantMap &customData)
|
||||
{
|
||||
if (input.isNull() || !input.isValid() || !input.canConvert<QString>())
|
||||
{
|
||||
@ -291,7 +291,7 @@ EchoNestPlugin::isValidArtistData(const QString &caller, const QVariant &input,
|
||||
}
|
||||
|
||||
bool
|
||||
EchoNestPlugin::isValidTrackData(const QString &caller, const QVariant &input, const InfoCustomData &customData)
|
||||
EchoNestPlugin::isValidTrackData(const QString &caller, const QVariant &input, const QVariantMap &customData)
|
||||
{
|
||||
if (input.isNull() || !input.isValid() || !input.canConvert<QString>())
|
||||
{
|
||||
|
@ -44,7 +44,7 @@ public:
|
||||
virtual ~EchoNestPlugin();
|
||||
|
||||
protected slots:
|
||||
virtual void getInfo( const QString caller, const Tomahawk::InfoSystem::InfoType type, const QVariant input, const Tomahawk::InfoSystem::InfoCustomData customData );
|
||||
virtual void getInfo( const QString caller, const Tomahawk::InfoSystem::InfoType type, const QVariant input, const QVariantMap customData );
|
||||
|
||||
virtual void pushInfo( const QString caller, const Tomahawk::InfoSystem::InfoType type, const QVariant data )
|
||||
{
|
||||
@ -53,7 +53,7 @@ protected slots:
|
||||
Q_UNUSED( data );
|
||||
}
|
||||
|
||||
virtual void notInCacheSlot( const Tomahawk::InfoSystem::InfoCriteriaHash criteria, const QString caller, const Tomahawk::InfoSystem::InfoType type, const QVariant input, const Tomahawk::InfoSystem::InfoCustomData customData )
|
||||
virtual void notInCacheSlot( const Tomahawk::InfoSystem::InfoCriteriaHash criteria, const QString caller, const Tomahawk::InfoSystem::InfoType type, const QVariant input, const QVariantMap customData )
|
||||
{
|
||||
Q_UNUSED( criteria );
|
||||
Q_UNUSED( caller );
|
||||
@ -66,15 +66,15 @@ public slots:
|
||||
void namChangedSlot( QNetworkAccessManager *nam );
|
||||
|
||||
private:
|
||||
void getSongProfile( const QString &caller, const QVariant &input, const InfoCustomData &customData, const QString &item = QString() );
|
||||
void getArtistBiography ( const QString &caller, const QVariant &input, const InfoCustomData &customData );
|
||||
void getArtistFamiliarity( const QString &caller, const QVariant &input, const InfoCustomData &customData );
|
||||
void getArtistHotttnesss( const QString &caller, const QVariant &input, const InfoCustomData &customData );
|
||||
void getArtistTerms( const QString &caller, const QVariant &input, const InfoCustomData &customData );
|
||||
void getMiscTopTerms( const QString &caller, const QVariant &input, const InfoCustomData &customData );
|
||||
void getSongProfile( const QString &caller, const QVariant &input, const QVariantMap &customData, const QString &item = QString() );
|
||||
void getArtistBiography ( const QString &caller, const QVariant &input, const QVariantMap &customData );
|
||||
void getArtistFamiliarity( const QString &caller, const QVariant &input, const QVariantMap &customData );
|
||||
void getArtistHotttnesss( const QString &caller, const QVariant &input, const QVariantMap &customData );
|
||||
void getArtistTerms( const QString &caller, const QVariant &input, const QVariantMap &customData );
|
||||
void getMiscTopTerms( const QString &caller, const QVariant &input, const QVariantMap &customData );
|
||||
|
||||
bool isValidArtistData( const QString &caller, const QVariant &input, const InfoCustomData& customData );
|
||||
bool isValidTrackData( const QString &caller, const QVariant &input, const InfoCustomData& customData );
|
||||
bool isValidArtistData( const QString &caller, const QVariant &input, const QVariantMap& customData );
|
||||
bool isValidTrackData( const QString &caller, const QVariant &input, const QVariantMap& customData );
|
||||
Echonest::Artist artistFromReply( QNetworkReply* );
|
||||
|
||||
private slots:
|
||||
|
@ -120,7 +120,7 @@ LastFmPlugin::namChangedSlot( QNetworkAccessManager *nam )
|
||||
|
||||
|
||||
void
|
||||
LastFmPlugin::dataError( const QString &caller, const Tomahawk::InfoSystem::InfoType type, const QVariant &input, const Tomahawk::InfoSystem::InfoCustomData &customData )
|
||||
LastFmPlugin::dataError( const QString &caller, const Tomahawk::InfoSystem::InfoType type, const QVariant &input, const QVariantMap &customData )
|
||||
{
|
||||
emit info( caller, type, input, QVariant(), customData );
|
||||
return;
|
||||
@ -128,7 +128,7 @@ LastFmPlugin::dataError( const QString &caller, const Tomahawk::InfoSystem::Info
|
||||
|
||||
|
||||
void
|
||||
LastFmPlugin::getInfo( const QString caller, const Tomahawk::InfoSystem::InfoType type, const QVariant input, const Tomahawk::InfoSystem::InfoCustomData customData )
|
||||
LastFmPlugin::getInfo( const QString caller, const Tomahawk::InfoSystem::InfoType type, const QVariant input, const QVariantMap customData )
|
||||
{
|
||||
qDebug() << Q_FUNC_INFO;
|
||||
|
||||
@ -263,7 +263,7 @@ LastFmPlugin::sendLoveSong( const InfoType type, QVariant input )
|
||||
|
||||
|
||||
void
|
||||
LastFmPlugin::fetchSimilarArtists( const QString &caller, const InfoType type, const QVariant &input, const Tomahawk::InfoSystem::InfoCustomData &customData )
|
||||
LastFmPlugin::fetchSimilarArtists( const QString &caller, const InfoType type, const QVariant &input, const QVariantMap &customData )
|
||||
{
|
||||
qDebug() << Q_FUNC_INFO;
|
||||
if ( !input.canConvert< Tomahawk::InfoSystem::InfoCriteriaHash >() )
|
||||
@ -286,7 +286,7 @@ LastFmPlugin::fetchSimilarArtists( const QString &caller, const InfoType type, c
|
||||
|
||||
|
||||
void
|
||||
LastFmPlugin::fetchTopTracks( const QString &caller, const InfoType type, const QVariant &input, const Tomahawk::InfoSystem::InfoCustomData &customData )
|
||||
LastFmPlugin::fetchTopTracks( const QString &caller, const InfoType type, const QVariant &input, const QVariantMap &customData )
|
||||
{
|
||||
qDebug() << Q_FUNC_INFO;
|
||||
if ( !input.canConvert< Tomahawk::InfoSystem::InfoCriteriaHash >() )
|
||||
@ -309,7 +309,7 @@ LastFmPlugin::fetchTopTracks( const QString &caller, const InfoType type, const
|
||||
|
||||
|
||||
void
|
||||
LastFmPlugin::fetchCoverArt( const QString &caller, const InfoType type, const QVariant &input, const Tomahawk::InfoSystem::InfoCustomData &customData )
|
||||
LastFmPlugin::fetchCoverArt( const QString &caller, const InfoType type, const QVariant &input, const QVariantMap &customData )
|
||||
{
|
||||
qDebug() << Q_FUNC_INFO;
|
||||
if ( !input.canConvert< Tomahawk::InfoSystem::InfoCriteriaHash >() )
|
||||
@ -333,7 +333,7 @@ LastFmPlugin::fetchCoverArt( const QString &caller, const InfoType type, const Q
|
||||
|
||||
|
||||
void
|
||||
LastFmPlugin::fetchArtistImages( const QString &caller, const InfoType type, const QVariant &input, const Tomahawk::InfoSystem::InfoCustomData &customData )
|
||||
LastFmPlugin::fetchArtistImages( const QString &caller, const InfoType type, const QVariant &input, const QVariantMap &customData )
|
||||
{
|
||||
qDebug() << Q_FUNC_INFO;
|
||||
if ( !input.canConvert< Tomahawk::InfoSystem::InfoCriteriaHash >() )
|
||||
@ -356,7 +356,7 @@ LastFmPlugin::fetchArtistImages( const QString &caller, const InfoType type, con
|
||||
|
||||
|
||||
void
|
||||
LastFmPlugin::notInCacheSlot( const QHash<QString, QString> criteria, const QString caller, const Tomahawk::InfoSystem::InfoType type, const QVariant input, const Tomahawk::InfoSystem::InfoCustomData customData )
|
||||
LastFmPlugin::notInCacheSlot( const QHash<QString, QString> criteria, const QString caller, const Tomahawk::InfoSystem::InfoType type, const QVariant input, const QVariantMap customData )
|
||||
{
|
||||
qDebug() << Q_FUNC_INFO;
|
||||
|
||||
@ -373,7 +373,7 @@ LastFmPlugin::notInCacheSlot( const QHash<QString, QString> criteria, const QStr
|
||||
{
|
||||
lastfm::Artist a( criteria["artist"] );
|
||||
QNetworkReply* reply = a.getSimilar();
|
||||
reply->setProperty( "customData", QVariant::fromValue<Tomahawk::InfoSystem::InfoCustomData>( customData ) );
|
||||
reply->setProperty( "customData", QVariant::fromValue<QVariantMap>( customData ) );
|
||||
reply->setProperty( "origData", input );
|
||||
reply->setProperty( "caller", caller );
|
||||
reply->setProperty( "type", (uint)(type) );
|
||||
@ -386,7 +386,7 @@ LastFmPlugin::notInCacheSlot( const QHash<QString, QString> criteria, const QStr
|
||||
{
|
||||
lastfm::Artist a( criteria["artist"] );
|
||||
QNetworkReply* reply = a.getTopTracks();
|
||||
reply->setProperty( "customData", QVariant::fromValue<Tomahawk::InfoSystem::InfoCustomData>( customData ) );
|
||||
reply->setProperty( "customData", QVariant::fromValue<QVariantMap>( customData ) );
|
||||
reply->setProperty( "origData", input );
|
||||
reply->setProperty( "caller", caller );
|
||||
reply->setProperty( "type", (uint)(type) );
|
||||
@ -403,7 +403,7 @@ LastFmPlugin::notInCacheSlot( const QHash<QString, QString> criteria, const QStr
|
||||
QString imgurl = "http://ws.audioscrobbler.com/2.0/?method=album.imageredirect&artist=%1&album=%2&autocorrect=1&size=large&api_key=7a90f6672a04b809ee309af169f34b8b";
|
||||
QNetworkRequest req( imgurl.arg( artistName ).arg( albumName ) );
|
||||
QNetworkReply* reply = lastfm::nam()->get( req );
|
||||
reply->setProperty( "customData", QVariant::fromValue<Tomahawk::InfoSystem::InfoCustomData>( customData ) );
|
||||
reply->setProperty( "customData", QVariant::fromValue<QVariantMap>( customData ) );
|
||||
reply->setProperty( "origData", input );
|
||||
reply->setProperty( "caller", caller );
|
||||
reply->setProperty( "type", (uint)(type) );
|
||||
@ -419,7 +419,7 @@ LastFmPlugin::notInCacheSlot( const QHash<QString, QString> criteria, const QStr
|
||||
QString imgurl = "http://ws.audioscrobbler.com/2.0/?method=artist.imageredirect&artist=%1&autocorrect=1&size=large&api_key=7a90f6672a04b809ee309af169f34b8b";
|
||||
QNetworkRequest req( imgurl.arg( artistName ) );
|
||||
QNetworkReply* reply = lastfm::nam()->get( req );
|
||||
reply->setProperty( "customData", QVariant::fromValue<Tomahawk::InfoSystem::InfoCustomData>( customData ) );
|
||||
reply->setProperty( "customData", QVariant::fromValue<QVariantMap>( customData ) );
|
||||
reply->setProperty( "origData", input );
|
||||
reply->setProperty( "caller", caller );
|
||||
reply->setProperty( "type", (uint)(type) );
|
||||
@ -454,11 +454,11 @@ LastFmPlugin::similarArtistsReturned()
|
||||
al << a;
|
||||
}
|
||||
|
||||
InfoCustomData returnedData;
|
||||
QVariantMap returnedData;
|
||||
returnedData["artists"] = al;
|
||||
returnedData["score"] = sl;
|
||||
|
||||
InfoCustomData customData = reply->property( "customData" ).value< Tomahawk::InfoSystem::InfoCustomData >();
|
||||
QVariantMap customData = reply->property( "customData" ).value< QVariantMap >();
|
||||
InfoType type = (Tomahawk::InfoSystem::InfoType)(reply->property( "type" ).toUInt());
|
||||
emit info(
|
||||
reply->property( "caller" ).toString(),
|
||||
@ -487,10 +487,10 @@ LastFmPlugin::topTracksReturned()
|
||||
qDebug() << "Got top-track:" << t;
|
||||
}
|
||||
|
||||
InfoCustomData returnedData;
|
||||
QVariantMap returnedData;
|
||||
returnedData["tracks"] = topTracks;
|
||||
|
||||
InfoCustomData customData = reply->property( "customData" ).value< Tomahawk::InfoSystem::InfoCustomData >();
|
||||
QVariantMap customData = reply->property( "customData" ).value< QVariantMap >();
|
||||
InfoType type = (Tomahawk::InfoSystem::InfoType)(reply->property( "type" ).toUInt());
|
||||
emit info(
|
||||
reply->property( "caller" ).toString(),
|
||||
@ -520,7 +520,7 @@ LastFmPlugin::coverArtReturned()
|
||||
{
|
||||
qDebug() << "Uh oh, null byte array";
|
||||
InfoType type = (Tomahawk::InfoSystem::InfoType)(reply->property( "type" ).toUInt());
|
||||
InfoCustomData customData = reply->property( "customData" ).value< Tomahawk::InfoSystem::InfoCustomData >();
|
||||
QVariantMap customData = reply->property( "customData" ).value< QVariantMap >();
|
||||
emit info( reply->property( "caller" ).toString(), type, reply->property( "origData" ), QVariant(), customData );
|
||||
return;
|
||||
}
|
||||
@ -530,11 +530,11 @@ LastFmPlugin::coverArtReturned()
|
||||
ba = QByteArray();
|
||||
}
|
||||
|
||||
InfoCustomData returnedData;
|
||||
QVariantMap returnedData;
|
||||
returnedData["imgbytes"] = ba;
|
||||
returnedData["url"] = reply->url().toString();
|
||||
|
||||
InfoCustomData customData = reply->property( "customData" ).value< Tomahawk::InfoSystem::InfoCustomData >();
|
||||
QVariantMap customData = reply->property( "customData" ).value< QVariantMap >();
|
||||
InfoType type = (Tomahawk::InfoSystem::InfoType)(reply->property( "type" ).toUInt());
|
||||
emit info(
|
||||
reply->property( "caller" ).toString(),
|
||||
@ -556,7 +556,7 @@ LastFmPlugin::coverArtReturned()
|
||||
{
|
||||
qDebug() << "Uh oh, nam is null";
|
||||
InfoType type = (Tomahawk::InfoSystem::InfoType)(reply->property( "type" ).toUInt());
|
||||
InfoCustomData customData = reply->property( "customData" ).value< Tomahawk::InfoSystem::InfoCustomData >();
|
||||
QVariantMap customData = reply->property( "customData" ).value< QVariantMap >();
|
||||
emit info( reply->property( "caller" ).toString(), type, reply->property( "origData" ), QVariant(), customData );
|
||||
return;
|
||||
}
|
||||
@ -587,7 +587,7 @@ LastFmPlugin::artistImagesReturned()
|
||||
{
|
||||
qDebug() << "Uh oh, null byte array";
|
||||
InfoType type = (Tomahawk::InfoSystem::InfoType)(reply->property( "type" ).toUInt());
|
||||
InfoCustomData customData = reply->property( "customData" ).value< Tomahawk::InfoSystem::InfoCustomData >();
|
||||
QVariantMap customData = reply->property( "customData" ).value< QVariantMap >();
|
||||
emit info( reply->property( "caller" ).toString(), type, reply->property( "origData" ), QVariant(), customData );
|
||||
return;
|
||||
}
|
||||
@ -596,12 +596,12 @@ LastFmPlugin::artistImagesReturned()
|
||||
if ( reply->url().toString().startsWith( url.toString() ) )
|
||||
ba = QByteArray();
|
||||
}
|
||||
InfoCustomData returnedData;
|
||||
QVariantMap returnedData;
|
||||
returnedData["imgbytes"] = ba;
|
||||
returnedData["url"] = reply->url().toString();
|
||||
|
||||
InfoType type = (Tomahawk::InfoSystem::InfoType)(reply->property( "type" ).toUInt());
|
||||
InfoCustomData customData = reply->property( "customData" ).value< Tomahawk::InfoSystem::InfoCustomData >();
|
||||
QVariantMap customData = reply->property( "customData" ).value< QVariantMap >();
|
||||
emit info( reply->property( "caller" ).toString(), type, reply->property( "origData" ), returnedData, customData );
|
||||
|
||||
InfoCriteriaHash origData = reply->property( "origData" ).value< Tomahawk::InfoSystem::InfoCriteriaHash >();
|
||||
@ -615,7 +615,7 @@ LastFmPlugin::artistImagesReturned()
|
||||
{
|
||||
qDebug() << "Uh oh, nam is null";
|
||||
InfoType type = (Tomahawk::InfoSystem::InfoType)(reply->property( "type" ).toUInt());
|
||||
InfoCustomData customData = reply->property( "customData" ).value< Tomahawk::InfoSystem::InfoCustomData >();
|
||||
QVariantMap customData = reply->property( "customData" ).value< QVariantMap >();
|
||||
emit info( reply->property( "caller" ).toString(), type, reply->property( "origData" ), QVariant(), customData );
|
||||
return;
|
||||
}
|
||||
|
@ -55,23 +55,23 @@ public slots:
|
||||
void namChangedSlot( QNetworkAccessManager *nam );
|
||||
|
||||
protected slots:
|
||||
virtual void getInfo( const QString caller, const Tomahawk::InfoSystem::InfoType type, const QVariant input, const Tomahawk::InfoSystem::InfoCustomData customData );
|
||||
virtual void notInCacheSlot( const Tomahawk::InfoSystem::InfoCriteriaHash criteria, const QString caller, const Tomahawk::InfoSystem::InfoType type, const QVariant input, const Tomahawk::InfoSystem::InfoCustomData customData );
|
||||
virtual void getInfo( const QString caller, const Tomahawk::InfoSystem::InfoType type, const QVariant input, const QVariantMap customData );
|
||||
virtual void notInCacheSlot( const Tomahawk::InfoSystem::InfoCriteriaHash criteria, const QString caller, const Tomahawk::InfoSystem::InfoType type, const QVariant input, const QVariantMap customData );
|
||||
|
||||
virtual void pushInfo( const QString caller, const Tomahawk::InfoSystem::InfoType type, const QVariant data );
|
||||
|
||||
private:
|
||||
void fetchCoverArt( const QString &caller, const Tomahawk::InfoSystem::InfoType type, const QVariant &input, const Tomahawk::InfoSystem::InfoCustomData &customData );
|
||||
void fetchArtistImages( const QString &caller, const Tomahawk::InfoSystem::InfoType type, const QVariant &input, const Tomahawk::InfoSystem::InfoCustomData &customData );
|
||||
void fetchSimilarArtists( const QString &caller, const Tomahawk::InfoSystem::InfoType type, const QVariant &input, const Tomahawk::InfoSystem::InfoCustomData &customData );
|
||||
void fetchTopTracks( const QString &caller, const Tomahawk::InfoSystem::InfoType type, const QVariant &input, const Tomahawk::InfoSystem::InfoCustomData &customData );
|
||||
void fetchCoverArt( const QString &caller, const Tomahawk::InfoSystem::InfoType type, const QVariant &input, const QVariantMap &customData );
|
||||
void fetchArtistImages( const QString &caller, const Tomahawk::InfoSystem::InfoType type, const QVariant &input, const QVariantMap &customData );
|
||||
void fetchSimilarArtists( const QString &caller, const Tomahawk::InfoSystem::InfoType type, const QVariant &input, const QVariantMap &customData );
|
||||
void fetchTopTracks( const QString &caller, const Tomahawk::InfoSystem::InfoType type, const QVariant &input, const QVariantMap &customData );
|
||||
|
||||
void createScrobbler();
|
||||
void nowPlaying( const QVariant &input );
|
||||
void scrobble();
|
||||
void sendLoveSong( const InfoType type, QVariant input );
|
||||
|
||||
void dataError( const QString &caller, const Tomahawk::InfoSystem::InfoType type, const QVariant &input, const Tomahawk::InfoSystem::InfoCustomData &customData );
|
||||
void dataError( const QString &caller, const Tomahawk::InfoSystem::InfoType type, const QVariant &input, const QVariantMap &customData );
|
||||
|
||||
lastfm::MutableTrack m_track;
|
||||
lastfm::Audioscrobbler* m_scrobbler;
|
||||
|
@ -51,12 +51,12 @@ MusixMatchPlugin::namChangedSlot( QNetworkAccessManager *nam )
|
||||
}
|
||||
|
||||
void
|
||||
MusixMatchPlugin::getInfo( const QString caller, const Tomahawk::InfoSystem::InfoType type, const QVariant input, const Tomahawk::InfoSystem::InfoCustomData customData )
|
||||
MusixMatchPlugin::getInfo( const QString caller, const Tomahawk::InfoSystem::InfoType type, const QVariant input, const QVariantMap customData )
|
||||
{
|
||||
qDebug() << Q_FUNC_INFO;
|
||||
if( !isValidTrackData(caller, input, customData) || !input.canConvert<Tomahawk::InfoSystem::InfoCustomData>() || m_nam.isNull() || type != Tomahawk::InfoSystem::InfoTrackLyrics )
|
||||
if( !isValidTrackData(caller, input, customData) || !input.canConvert<QVariantMap>() || m_nam.isNull() || type != Tomahawk::InfoSystem::InfoTrackLyrics )
|
||||
return;
|
||||
Tomahawk::InfoSystem::InfoCustomData hash = input.value<Tomahawk::InfoSystem::InfoCustomData>();
|
||||
QVariantMap hash = input.value<QVariantMap>();
|
||||
QString artist = hash["artistName"].toString();
|
||||
QString track = hash["trackName"].toString();
|
||||
if( artist.isEmpty() || track.isEmpty() )
|
||||
@ -71,7 +71,7 @@ MusixMatchPlugin::getInfo( const QString caller, const Tomahawk::InfoSystem::Inf
|
||||
url.addQueryItem("q_artist", artist);
|
||||
url.addQueryItem("q_track", track);
|
||||
QNetworkReply* reply = m_nam.data()->get(QNetworkRequest(url));
|
||||
reply->setProperty("customData", QVariant::fromValue<Tomahawk::InfoSystem::InfoCustomData>(customData));
|
||||
reply->setProperty("customData", QVariant::fromValue<QVariantMap>(customData));
|
||||
reply->setProperty("origData", input);
|
||||
reply->setProperty("caller", caller);
|
||||
|
||||
@ -79,16 +79,16 @@ MusixMatchPlugin::getInfo( const QString caller, const Tomahawk::InfoSystem::Inf
|
||||
}
|
||||
|
||||
bool
|
||||
MusixMatchPlugin::isValidTrackData( const QString &caller, const QVariant &input, const Tomahawk::InfoSystem::InfoCustomData &customData )
|
||||
MusixMatchPlugin::isValidTrackData( const QString &caller, const QVariant &input, const QVariantMap &customData )
|
||||
{
|
||||
qDebug() << Q_FUNC_INFO;
|
||||
if (input.isNull() || !input.isValid() || !input.canConvert<Tomahawk::InfoSystem::InfoCustomData>())
|
||||
if (input.isNull() || !input.isValid() || !input.canConvert<QVariantMap>())
|
||||
{
|
||||
emit info(caller, Tomahawk::InfoSystem::InfoTrackLyrics, input, QVariant(), customData);
|
||||
qDebug() << "MusixMatchPlugin::isValidTrackData: Data null, invalid, or can't convert";
|
||||
return false;
|
||||
}
|
||||
InfoCustomData hash = input.value<Tomahawk::InfoSystem::InfoCustomData>();
|
||||
QVariantMap hash = input.value<QVariantMap>();
|
||||
if (hash["trackName"].toString().isEmpty() )
|
||||
{
|
||||
emit info(caller, Tomahawk::InfoSystem::InfoTrackLyrics, input, QVariant(), customData);
|
||||
@ -111,7 +111,7 @@ MusixMatchPlugin::trackSearchSlot()
|
||||
QNetworkReply* oldReply = qobject_cast<QNetworkReply*>( sender() );
|
||||
if ( !oldReply || m_nam.isNull() )
|
||||
{
|
||||
emit info(QString(), Tomahawk::InfoSystem::InfoTrackLyrics, QVariant(), QVariant(), Tomahawk::InfoSystem::InfoCustomData());
|
||||
emit info(QString(), Tomahawk::InfoSystem::InfoTrackLyrics, QVariant(), QVariant(), QVariantMap());
|
||||
return;
|
||||
}
|
||||
QDomDocument doc;
|
||||
@ -120,7 +120,7 @@ MusixMatchPlugin::trackSearchSlot()
|
||||
QDomNodeList domNodeList = doc.elementsByTagName("track_id");
|
||||
if (domNodeList.isEmpty())
|
||||
{
|
||||
emit info(oldReply->property("caller").toString(), Tomahawk::InfoSystem::InfoTrackLyrics, oldReply->property("origData"), QVariant(), oldReply->property("customData").value<Tomahawk::InfoSystem::InfoCustomData>());
|
||||
emit info(oldReply->property("caller").toString(), Tomahawk::InfoSystem::InfoTrackLyrics, oldReply->property("origData"), QVariant(), oldReply->property("customData").value<QVariantMap>());
|
||||
return;
|
||||
}
|
||||
QString track_id = domNodeList.at(0).toElement().text();
|
||||
@ -142,7 +142,7 @@ MusixMatchPlugin::trackLyricsSlot()
|
||||
QNetworkReply* reply = qobject_cast<QNetworkReply*>( sender() );
|
||||
if (!reply)
|
||||
{
|
||||
emit info(QString(), Tomahawk::InfoSystem::InfoTrackLyrics, QVariant(), QVariant(), Tomahawk::InfoSystem::InfoCustomData());
|
||||
emit info(QString(), Tomahawk::InfoSystem::InfoTrackLyrics, QVariant(), QVariant(), QVariantMap());
|
||||
return;
|
||||
}
|
||||
QDomDocument doc;
|
||||
@ -150,10 +150,10 @@ MusixMatchPlugin::trackLyricsSlot()
|
||||
QDomNodeList domNodeList = doc.elementsByTagName("lyrics_body");
|
||||
if (domNodeList.isEmpty())
|
||||
{
|
||||
emit info(reply->property("caller").toString(), Tomahawk::InfoSystem::InfoTrackLyrics, reply->property("origData"), QVariant(), reply->property("customData").value<Tomahawk::InfoSystem::InfoCustomData>());
|
||||
emit info(reply->property("caller").toString(), Tomahawk::InfoSystem::InfoTrackLyrics, reply->property("origData"), QVariant(), reply->property("customData").value<QVariantMap>());
|
||||
return;
|
||||
}
|
||||
QString lyrics = domNodeList.at(0).toElement().text();
|
||||
qDebug() << "Emitting lyrics: " << lyrics;
|
||||
emit info(reply->property("caller").toString(), Tomahawk::InfoSystem::InfoTrackLyrics, reply->property("origData"), QVariant(lyrics), reply->property("customData").value<Tomahawk::InfoSystem::InfoCustomData>());
|
||||
emit info(reply->property("caller").toString(), Tomahawk::InfoSystem::InfoTrackLyrics, reply->property("origData"), QVariant(lyrics), reply->property("customData").value<QVariantMap>());
|
||||
}
|
||||
|
@ -45,7 +45,7 @@ public slots:
|
||||
void namChangedSlot( QNetworkAccessManager *nam );
|
||||
|
||||
protected slots:
|
||||
virtual void getInfo( const QString caller, const Tomahawk::InfoSystem::InfoType type, const QVariant input, const Tomahawk::InfoSystem::InfoCustomData customData );
|
||||
virtual void getInfo( const QString caller, const Tomahawk::InfoSystem::InfoType type, const QVariant input, const QVariantMap customData );
|
||||
|
||||
virtual void pushInfo( const QString caller, const Tomahawk::InfoSystem::InfoType type, const QVariant data )
|
||||
{
|
||||
@ -54,7 +54,7 @@ protected slots:
|
||||
Q_UNUSED( data );
|
||||
}
|
||||
|
||||
virtual void notInCacheSlot( const Tomahawk::InfoSystem::InfoCriteriaHash criteria, const QString caller, const Tomahawk::InfoSystem::InfoType type, const QVariant input, const Tomahawk::InfoSystem::InfoCustomData customData )
|
||||
virtual void notInCacheSlot( const Tomahawk::InfoSystem::InfoCriteriaHash criteria, const QString caller, const Tomahawk::InfoSystem::InfoType type, const QVariant input, const QVariantMap customData )
|
||||
{
|
||||
Q_UNUSED( criteria );
|
||||
Q_UNUSED( caller );
|
||||
@ -64,7 +64,7 @@ protected slots:
|
||||
}
|
||||
|
||||
private:
|
||||
bool isValidTrackData( const QString &caller, const QVariant &input, const InfoCustomData &customData );
|
||||
bool isValidTrackData( const QString &caller, const QVariant &input, const QVariantMap &customData );
|
||||
|
||||
QString m_apiKey;
|
||||
|
||||
|
@ -97,7 +97,7 @@ AdiumPlugin::settingsChanged()
|
||||
}
|
||||
|
||||
void
|
||||
AdiumPlugin::getInfo( const QString caller, const InfoType type, const QVariant data, InfoCustomData customData )
|
||||
AdiumPlugin::getInfo( const QString caller, const InfoType type, const QVariant data, QVariantMap customData )
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
|
@ -39,12 +39,12 @@ public:
|
||||
virtual ~AdiumPlugin();
|
||||
|
||||
protected slots:
|
||||
void getInfo( const QString caller, const InfoType type, const QVariant data, InfoCustomData customData );
|
||||
void getInfo( const QString caller, const InfoType type, const QVariant data, QVariantMap customData );
|
||||
void pushInfo( const QString caller, const Tomahawk::InfoSystem::InfoType type, const QVariant input );
|
||||
|
||||
public slots:
|
||||
void namChangedSlot( QNetworkAccessManager* /*nam*/ ) {} // unused
|
||||
void notInCacheSlot( const Tomahawk::InfoSystem::InfoCriteriaHash /*criteria*/, const QString /*caller*/, const Tomahawk::InfoSystem::InfoType /*type*/, const QVariant /*input*/, const Tomahawk::InfoSystem::InfoCustomData /*customData*/ ) {} // unused
|
||||
void notInCacheSlot( const Tomahawk::InfoSystem::InfoCriteriaHash /*criteria*/, const QString /*caller*/, const Tomahawk::InfoSystem::InfoType /*type*/, const QVariant /*input*/, const QVariantMap /*customData*/ ) {} // unused
|
||||
|
||||
private slots:
|
||||
void clearStatus();
|
||||
|
@ -63,12 +63,12 @@ FdoNotifyPlugin::pushInfo( const QString caller, const Tomahawk::InfoSystem::Inf
|
||||
{
|
||||
Q_UNUSED( caller );
|
||||
qDebug() << Q_FUNC_INFO;
|
||||
if ( type != Tomahawk::InfoSystem::InfoNotifyUser || !pushData.canConvert< Tomahawk::InfoSystem::InfoCustomData >() )
|
||||
if ( type != Tomahawk::InfoSystem::InfoNotifyUser || !pushData.canConvert< QVariantMap >() )
|
||||
{
|
||||
qDebug() << Q_FUNC_INFO << " not the right type or could not convert the hash";
|
||||
return;
|
||||
}
|
||||
Tomahawk::InfoSystem::InfoCustomData hash = pushData.value< Tomahawk::InfoSystem::InfoCustomData >();
|
||||
QVariantMap hash = pushData.value< QVariantMap >();
|
||||
if ( !hash.contains( "message" ) )
|
||||
{
|
||||
qDebug() << Q_FUNC_INFO << " hash did not contain a message";
|
||||
|
@ -38,7 +38,7 @@ public:
|
||||
virtual void namChangedSlot( QNetworkAccessManager* ) {}
|
||||
|
||||
protected slots:
|
||||
virtual void getInfo( const QString caller, const Tomahawk::InfoSystem::InfoType type, const QVariant input, const Tomahawk::InfoSystem::InfoCustomData customData )
|
||||
virtual void getInfo( const QString caller, const Tomahawk::InfoSystem::InfoType type, const QVariant input, const QVariantMap customData )
|
||||
{
|
||||
Q_UNUSED( caller );
|
||||
Q_UNUSED( type );
|
||||
@ -48,7 +48,7 @@ protected slots:
|
||||
|
||||
virtual void pushInfo( const QString caller, const Tomahawk::InfoSystem::InfoType type, const QVariant pushData );
|
||||
|
||||
virtual void notInCacheSlot( const Tomahawk::InfoSystem::InfoCriteriaHash criteria, const QString caller, const Tomahawk::InfoSystem::InfoType type, const QVariant input, const Tomahawk::InfoSystem::InfoCustomData customData )
|
||||
virtual void notInCacheSlot( const Tomahawk::InfoSystem::InfoCriteriaHash criteria, const QString caller, const Tomahawk::InfoSystem::InfoType type, const QVariant input, const QVariantMap customData )
|
||||
{
|
||||
Q_UNUSED( criteria );
|
||||
Q_UNUSED( caller );
|
||||
|
@ -71,11 +71,11 @@ InfoSystem::InfoSystem(QObject *parent)
|
||||
|
||||
connect( TomahawkSettings::instance(), SIGNAL( changed() ), SLOT( newNam() ) );
|
||||
|
||||
connect( m_cache.data(), SIGNAL( info( QString, Tomahawk::InfoSystem::InfoType, QVariant, QVariant, Tomahawk::InfoSystem::InfoCustomData ) ),
|
||||
this, SLOT( infoSlot( QString, Tomahawk::InfoSystem::InfoType, QVariant, QVariant, Tomahawk::InfoSystem::InfoCustomData ) ), Qt::UniqueConnection );
|
||||
connect( m_cache.data(), SIGNAL( info( QString, Tomahawk::InfoSystem::InfoType, QVariant, QVariant, QVariantMap ) ),
|
||||
this, SLOT( infoSlot( QString, Tomahawk::InfoSystem::InfoType, QVariant, QVariant, QVariantMap ) ), Qt::UniqueConnection );
|
||||
|
||||
connect( m_worker.data(), SIGNAL( info( QString, Tomahawk::InfoSystem::InfoType, QVariant, QVariant, Tomahawk::InfoSystem::InfoCustomData ) ),
|
||||
this, SLOT( infoSlot( QString, Tomahawk::InfoSystem::InfoType, QVariant, QVariant, Tomahawk::InfoSystem::InfoCustomData ) ), Qt::UniqueConnection );
|
||||
connect( m_worker.data(), SIGNAL( info( QString, Tomahawk::InfoSystem::InfoType, QVariant, QVariant, QVariantMap ) ),
|
||||
this, SLOT( infoSlot( QString, Tomahawk::InfoSystem::InfoType, QVariant, QVariant, QVariantMap ) ), Qt::UniqueConnection );
|
||||
}
|
||||
|
||||
InfoSystem::~InfoSystem()
|
||||
@ -116,18 +116,18 @@ InfoSystem::newNam() const
|
||||
|
||||
|
||||
void
|
||||
InfoSystem::getInfo( const QString &caller, const InfoType type, const QVariant& input, InfoCustomData customData )
|
||||
InfoSystem::getInfo( const QString &caller, const InfoType type, const QVariant& input, QVariantMap customData )
|
||||
{
|
||||
qDebug() << Q_FUNC_INFO;
|
||||
|
||||
m_dataTracker[caller][type] = m_dataTracker[caller][type] + 1;
|
||||
qDebug() << "current count in dataTracker for type" << type << "is" << m_dataTracker[caller][type];
|
||||
QMetaObject::invokeMethod( m_worker.data(), "getInfo", Qt::QueuedConnection, Q_ARG( QString, caller ), Q_ARG( Tomahawk::InfoSystem::InfoType, type ), Q_ARG( QVariant, input ), Q_ARG( Tomahawk::InfoSystem::InfoCustomData, customData ) );
|
||||
QMetaObject::invokeMethod( m_worker.data(), "getInfo", Qt::QueuedConnection, Q_ARG( QString, caller ), Q_ARG( Tomahawk::InfoSystem::InfoType, type ), Q_ARG( QVariant, input ), Q_ARG( QVariantMap, customData ) );
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
InfoSystem::getInfo( const QString &caller, const InfoTypeMap &input, InfoCustomData customData )
|
||||
InfoSystem::getInfo( const QString &caller, const InfoTypeMap &input, QVariantMap customData )
|
||||
{
|
||||
Q_FOREACH( InfoType type, input.keys() )
|
||||
getInfo( caller, type, input[type], customData );
|
||||
@ -152,7 +152,7 @@ InfoSystem::pushInfo( const QString &caller, const InfoTypeMap &input )
|
||||
|
||||
|
||||
void
|
||||
InfoSystem::infoSlot( QString target, InfoType type, QVariant input, QVariant output, InfoCustomData customData )
|
||||
InfoSystem::infoSlot( QString target, InfoType type, QVariant input, QVariant output, QVariantMap customData )
|
||||
{
|
||||
qDebug() << Q_FUNC_INFO;
|
||||
qDebug() << "current count in dataTracker is " << m_dataTracker[target][type];
|
||||
|
@ -109,7 +109,6 @@ enum InfoType { // as items are saved in cache, mark them here to not change the
|
||||
|
||||
typedef QMap< InfoType, QVariant > InfoTypeMap;
|
||||
typedef QMap< QString, QMap< QString, QString > > InfoGenericMap;
|
||||
typedef QHash< QString, QVariant > InfoCustomData;
|
||||
typedef QHash< QString, QString > InfoCriteriaHash;
|
||||
|
||||
class DLLEXPORT InfoPlugin : public QObject
|
||||
@ -125,15 +124,15 @@ public:
|
||||
QSet< InfoType > supportedPushTypes() const { return m_supportedPushTypes; }
|
||||
|
||||
signals:
|
||||
void getCachedInfo( Tomahawk::InfoSystem::InfoCriteriaHash criteria, qint64 newMaxAge, QString caller, Tomahawk::InfoSystem::InfoType type, QVariant input, Tomahawk::InfoSystem::InfoCustomData customData );
|
||||
void getCachedInfo( Tomahawk::InfoSystem::InfoCriteriaHash criteria, qint64 newMaxAge, QString caller, Tomahawk::InfoSystem::InfoType type, QVariant input, QVariantMap customData );
|
||||
void updateCache( Tomahawk::InfoSystem::InfoCriteriaHash criteria, qint64, Tomahawk::InfoSystem::InfoType type, QVariant output );
|
||||
void info( QString caller, Tomahawk::InfoSystem::InfoType type, QVariant input, QVariant output, Tomahawk::InfoSystem::InfoCustomData customData );
|
||||
void info( QString caller, Tomahawk::InfoSystem::InfoType type, QVariant input, QVariant output, QVariantMap customData );
|
||||
void finished( QString, Tomahawk::InfoSystem::InfoType );
|
||||
|
||||
protected slots:
|
||||
virtual void getInfo( const QString caller, const Tomahawk::InfoSystem::InfoType type, const QVariant data, const Tomahawk::InfoSystem::InfoCustomData customData ) = 0;
|
||||
virtual void getInfo( const QString caller, const Tomahawk::InfoSystem::InfoType type, const QVariant data, const QVariantMap customData ) = 0;
|
||||
virtual void pushInfo( const QString caller, const Tomahawk::InfoSystem::InfoType type, const QVariant data ) = 0;
|
||||
virtual void notInCacheSlot( const Tomahawk::InfoSystem::InfoCriteriaHash criteria, const QString caller, const Tomahawk::InfoSystem::InfoType type, const QVariant input, const Tomahawk::InfoSystem::InfoCustomData customData ) = 0;
|
||||
virtual void notInCacheSlot( const Tomahawk::InfoSystem::InfoCriteriaHash criteria, const QString caller, const Tomahawk::InfoSystem::InfoType type, const QVariant input, const QVariantMap customData ) = 0;
|
||||
|
||||
virtual void namChangedSlot( QNetworkAccessManager *nam ) = 0;
|
||||
|
||||
@ -158,17 +157,17 @@ public:
|
||||
InfoSystem( QObject *parent );
|
||||
~InfoSystem();
|
||||
|
||||
void getInfo( const QString &caller, const InfoType type, const QVariant &input, InfoCustomData customData );
|
||||
void getInfo( const QString &caller, const InfoTypeMap &input, InfoCustomData customData );
|
||||
void getInfo( const QString &caller, const InfoType type, const QVariant &input, QVariantMap customData );
|
||||
void getInfo( const QString &caller, const InfoTypeMap &input, QVariantMap customData );
|
||||
void pushInfo( const QString &caller, const InfoType type, const QVariant &input );
|
||||
void pushInfo( const QString &caller, const InfoTypeMap &input );
|
||||
|
||||
signals:
|
||||
void info( QString caller, Tomahawk::InfoSystem::InfoType, QVariant input, QVariant output, Tomahawk::InfoSystem::InfoCustomData customData );
|
||||
void info( QString caller, Tomahawk::InfoSystem::InfoType, QVariant input, QVariant output, QVariantMap customData );
|
||||
void finished( QString target );
|
||||
|
||||
public slots:
|
||||
void infoSlot( const QString target, const Tomahawk::InfoSystem::InfoType type, const QVariant input, const QVariant output, const Tomahawk::InfoSystem::InfoCustomData customData );
|
||||
void infoSlot( const QString target, const Tomahawk::InfoSystem::InfoType type, const QVariant input, const QVariant output, const QVariantMap customData );
|
||||
|
||||
void newNam() const;
|
||||
|
||||
@ -206,7 +205,6 @@ inline uint qHash( Tomahawk::InfoSystem::InfoCriteriaHash hash )
|
||||
}
|
||||
|
||||
Q_DECLARE_METATYPE( Tomahawk::InfoSystem::InfoGenericMap );
|
||||
Q_DECLARE_METATYPE( Tomahawk::InfoSystem::InfoCustomData );
|
||||
Q_DECLARE_METATYPE( Tomahawk::InfoSystem::InfoCriteriaHash );
|
||||
Q_DECLARE_METATYPE( QWeakPointer< Tomahawk::InfoSystem::InfoSystemCache > );
|
||||
|
||||
|
@ -84,7 +84,7 @@ InfoSystemCache::pruneTimerFired()
|
||||
|
||||
|
||||
void
|
||||
InfoSystemCache::getCachedInfoSlot( const Tomahawk::InfoSystem::InfoCriteriaHash criteria, const qint64 newMaxAge, const QString caller, const Tomahawk::InfoSystem::InfoType type, const QVariant input, const Tomahawk::InfoSystem::InfoCustomData customData )
|
||||
InfoSystemCache::getCachedInfoSlot( const Tomahawk::InfoSystem::InfoCriteriaHash criteria, const qint64 newMaxAge, const QString caller, const Tomahawk::InfoSystem::InfoType type, const QVariant input, const QVariantMap customData )
|
||||
{
|
||||
qDebug() << Q_FUNC_INFO;
|
||||
const QString criteriaHashVal = criteriaMd5( criteria );
|
||||
|
@ -43,11 +43,11 @@ public:
|
||||
virtual ~InfoSystemCache();
|
||||
|
||||
signals:
|
||||
void notInCache( Tomahawk::InfoSystem::InfoCriteriaHash criteria, QString caller, Tomahawk::InfoSystem::InfoType type, QVariant input, Tomahawk::InfoSystem::InfoCustomData customData );
|
||||
void info( QString caller, Tomahawk::InfoSystem::InfoType type, QVariant input, QVariant output, Tomahawk::InfoSystem::InfoCustomData customData );
|
||||
void notInCache( Tomahawk::InfoSystem::InfoCriteriaHash criteria, QString caller, Tomahawk::InfoSystem::InfoType type, QVariant input, QVariantMap customData );
|
||||
void info( QString caller, Tomahawk::InfoSystem::InfoType type, QVariant input, QVariant output, QVariantMap customData );
|
||||
|
||||
public slots:
|
||||
void getCachedInfoSlot( const Tomahawk::InfoSystem::InfoCriteriaHash criteria, const qint64 newMaxAge, const QString caller, const Tomahawk::InfoSystem::InfoType type, const QVariant input, const Tomahawk::InfoSystem::InfoCustomData customData );
|
||||
void getCachedInfoSlot( const Tomahawk::InfoSystem::InfoCriteriaHash criteria, const qint64 newMaxAge, const QString caller, const Tomahawk::InfoSystem::InfoType type, const QVariant input, const QVariantMap customData );
|
||||
void updateCacheSlot( const Tomahawk::InfoSystem::InfoCriteriaHash criteria, const qint64 maxAge, const Tomahawk::InfoSystem::InfoType type, const QVariant output );
|
||||
|
||||
private slots:
|
||||
|
@ -87,23 +87,23 @@ InfoSystemWorker::init( QWeakPointer< Tomahawk::InfoSystem::InfoSystemCache> cac
|
||||
{
|
||||
connect(
|
||||
plugin.data(),
|
||||
SIGNAL( info( QString, Tomahawk::InfoSystem::InfoType, QVariant, QVariant, Tomahawk::InfoSystem::InfoCustomData ) ),
|
||||
SIGNAL( info( QString, Tomahawk::InfoSystem::InfoType, QVariant, QVariant, QVariantMap ) ),
|
||||
InfoSystem::instance(),
|
||||
SLOT( infoSlot( QString, Tomahawk::InfoSystem::InfoType, QVariant, QVariant, Tomahawk::InfoSystem::InfoCustomData ) ),
|
||||
SLOT( infoSlot( QString, Tomahawk::InfoSystem::InfoType, QVariant, QVariant, QVariantMap ) ),
|
||||
Qt::UniqueConnection
|
||||
);
|
||||
|
||||
connect(
|
||||
plugin.data(),
|
||||
SIGNAL( getCachedInfo( Tomahawk::InfoSystem::InfoCriteriaHash, qint64, QString, Tomahawk::InfoSystem::InfoType, QVariant, Tomahawk::InfoSystem::InfoCustomData ) ),
|
||||
SIGNAL( getCachedInfo( Tomahawk::InfoSystem::InfoCriteriaHash, qint64, QString, Tomahawk::InfoSystem::InfoType, QVariant, QVariantMap ) ),
|
||||
cache.data(),
|
||||
SLOT( getCachedInfoSlot( Tomahawk::InfoSystem::InfoCriteriaHash, qint64, QString, Tomahawk::InfoSystem::InfoType, QVariant, Tomahawk::InfoSystem::InfoCustomData ) )
|
||||
SLOT( getCachedInfoSlot( Tomahawk::InfoSystem::InfoCriteriaHash, qint64, QString, Tomahawk::InfoSystem::InfoType, QVariant, QVariantMap ) )
|
||||
);
|
||||
connect(
|
||||
cache.data(),
|
||||
SIGNAL( notInCache( Tomahawk::InfoSystem::InfoCriteriaHash, QString, Tomahawk::InfoSystem::InfoType, QVariant, Tomahawk::InfoSystem::InfoCustomData ) ),
|
||||
SIGNAL( notInCache( Tomahawk::InfoSystem::InfoCriteriaHash, QString, Tomahawk::InfoSystem::InfoType, QVariant, QVariantMap ) ),
|
||||
plugin.data(),
|
||||
SLOT( notInCacheSlot( Tomahawk::InfoSystem::InfoCriteriaHash, QString, Tomahawk::InfoSystem::InfoType, QVariant, Tomahawk::InfoSystem::InfoCustomData ) )
|
||||
SLOT( notInCacheSlot( Tomahawk::InfoSystem::InfoCriteriaHash, QString, Tomahawk::InfoSystem::InfoType, QVariant, QVariantMap ) )
|
||||
);
|
||||
connect(
|
||||
plugin.data(),
|
||||
@ -147,7 +147,7 @@ InfoSystemWorker::determineOrderedMatches( const InfoType type ) const
|
||||
|
||||
|
||||
void
|
||||
InfoSystemWorker::getInfo( QString caller, InfoType type, QVariant input, InfoCustomData customData )
|
||||
InfoSystemWorker::getInfo( QString caller, InfoType type, QVariant input, QVariantMap customData )
|
||||
{
|
||||
qDebug() << Q_FUNC_INFO;
|
||||
QLinkedList< InfoPluginPtr > providers = determineOrderedMatches(type);
|
||||
@ -164,7 +164,7 @@ InfoSystemWorker::getInfo( QString caller, InfoType type, QVariant input, InfoCu
|
||||
return;
|
||||
}
|
||||
|
||||
QMetaObject::invokeMethod( ptr.data(), "getInfo", Qt::QueuedConnection, Q_ARG( QString, caller ), Q_ARG( Tomahawk::InfoSystem::InfoType, type ), Q_ARG( QVariant, input ), Q_ARG( Tomahawk::InfoSystem::InfoCustomData, customData ) );
|
||||
QMetaObject::invokeMethod( ptr.data(), "getInfo", Qt::QueuedConnection, Q_ARG( QString, caller ), Q_ARG( Tomahawk::InfoSystem::InfoType, type ), Q_ARG( QVariant, input ), Q_ARG( QVariantMap, customData ) );
|
||||
}
|
||||
|
||||
|
||||
|
@ -48,12 +48,12 @@ public:
|
||||
QNetworkAccessManager* nam() const;
|
||||
|
||||
signals:
|
||||
void info( QString target, Tomahawk::InfoSystem::InfoType, QVariant input, QVariant output, Tomahawk::InfoSystem::InfoCustomData customData );
|
||||
void info( QString target, Tomahawk::InfoSystem::InfoType, QVariant input, QVariant output, QVariantMap customData );
|
||||
void namChanged( QNetworkAccessManager* );
|
||||
|
||||
public slots:
|
||||
void init( QWeakPointer< Tomahawk::InfoSystem::InfoSystemCache > cache );
|
||||
void getInfo( const QString caller, const Tomahawk::InfoSystem::InfoType type, const QVariant input, const Tomahawk::InfoSystem::InfoCustomData customData );
|
||||
void getInfo( const QString caller, const Tomahawk::InfoSystem::InfoType type, const QVariant input, const QVariantMap customData );
|
||||
void pushInfo( const QString caller, const Tomahawk::InfoSystem::InfoType type, const QVariant input );
|
||||
void newNam();
|
||||
|
||||
|
@ -44,8 +44,8 @@ AlbumModel::AlbumModel( QObject* parent )
|
||||
.scaled( QSize( 120, 120 ), Qt::IgnoreAspectRatio, Qt::SmoothTransformation );
|
||||
|
||||
connect( Tomahawk::InfoSystem::InfoSystem::instance(),
|
||||
SIGNAL( info( QString, Tomahawk::InfoSystem::InfoType, QVariant, QVariant, Tomahawk::InfoSystem::InfoCustomData ) ),
|
||||
SLOT( infoSystemInfo( QString, Tomahawk::InfoSystem::InfoType, QVariant, QVariant, Tomahawk::InfoSystem::InfoCustomData ) ) );
|
||||
SIGNAL( info( QString, Tomahawk::InfoSystem::InfoType, QVariant, QVariant, QVariantMap ) ),
|
||||
SLOT( infoSystemInfo( QString, Tomahawk::InfoSystem::InfoType, QVariant, QVariant, QVariantMap ) ) );
|
||||
|
||||
connect( Tomahawk::InfoSystem::InfoSystem::instance(), SIGNAL( finished( QString ) ), SLOT( infoSystemFinished( QString ) ) );
|
||||
}
|
||||
@ -311,7 +311,7 @@ AlbumModel::onAlbumsAdded( const QList<Tomahawk::album_ptr>& albums )
|
||||
|
||||
|
||||
void
|
||||
AlbumModel::infoSystemInfo( QString caller, Tomahawk::InfoSystem::InfoType type, QVariant input, QVariant output, Tomahawk::InfoSystem::InfoCustomData customData )
|
||||
AlbumModel::infoSystemInfo( QString caller, Tomahawk::InfoSystem::InfoType type, QVariant input, QVariant output, QVariantMap customData )
|
||||
{
|
||||
Q_UNUSED( customData );
|
||||
qDebug() << Q_FUNC_INFO << " with caller " << caller;
|
||||
@ -323,14 +323,14 @@ AlbumModel::infoSystemInfo( QString caller, Tomahawk::InfoSystem::InfoType type,
|
||||
return;
|
||||
}
|
||||
|
||||
if ( !output.canConvert< Tomahawk::InfoSystem::InfoCustomData >() )
|
||||
if ( !output.canConvert< QVariantMap >() )
|
||||
{
|
||||
qDebug() << "Cannot convert fetched art from a QByteArray";
|
||||
return;
|
||||
}
|
||||
|
||||
Tomahawk::InfoSystem::InfoCriteriaHash pptr = input.value< Tomahawk::InfoSystem::InfoCriteriaHash >();
|
||||
Tomahawk::InfoSystem::InfoCustomData returnedData = output.value< Tomahawk::InfoSystem::InfoCustomData >();
|
||||
QVariantMap returnedData = output.value< QVariantMap >();
|
||||
const QByteArray ba = returnedData["imgbytes"].toByteArray();
|
||||
if ( ba.length() )
|
||||
{
|
||||
|
@ -97,7 +97,7 @@ private slots:
|
||||
void onAlbumsAdded( const QList<Tomahawk::album_ptr>& albums );
|
||||
void onDataChanged();
|
||||
|
||||
void infoSystemInfo( QString caller, Tomahawk::InfoSystem::InfoType type, QVariant input, QVariant output, Tomahawk::InfoSystem::InfoCustomData customData );
|
||||
void infoSystemInfo( QString caller, Tomahawk::InfoSystem::InfoType type, QVariant input, QVariant output, QVariantMap customData );
|
||||
void infoSystemFinished( QString target );
|
||||
|
||||
private:
|
||||
|
@ -164,7 +164,7 @@ AlbumView::onScrollTimeout()
|
||||
|
||||
Tomahawk::InfoSystem::InfoSystem::instance()->getInfo(
|
||||
s_tmInfoIdentifier, Tomahawk::InfoSystem::InfoAlbumCoverArt,
|
||||
QVariant::fromValue< Tomahawk::InfoSystem::InfoCriteriaHash >( trackInfo ), Tomahawk::InfoSystem::InfoCustomData() );
|
||||
QVariant::fromValue< Tomahawk::InfoSystem::InfoCriteriaHash >( trackInfo ), QVariantMap() );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -251,7 +251,7 @@ ArtistView::onScrollTimeout()
|
||||
|
||||
Tomahawk::InfoSystem::InfoSystem::instance()->getInfo(
|
||||
s_tmInfoIdentifier, Tomahawk::InfoSystem::InfoArtistImages,
|
||||
QVariant::fromValue< Tomahawk::InfoSystem::InfoCriteriaHash >( trackInfo ), Tomahawk::InfoSystem::InfoCustomData() );
|
||||
QVariant::fromValue< Tomahawk::InfoSystem::InfoCriteriaHash >( trackInfo ), QVariantMap() );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -47,8 +47,8 @@ TreeModel::TreeModel( QObject* parent )
|
||||
connect( AudioEngine::instance(), SIGNAL( stopped() ), SLOT( onPlaybackStopped() ), Qt::DirectConnection );
|
||||
|
||||
connect( Tomahawk::InfoSystem::InfoSystem::instance(),
|
||||
SIGNAL( info( QString, Tomahawk::InfoSystem::InfoType, QVariant, QVariant, Tomahawk::InfoSystem::InfoCustomData ) ),
|
||||
SLOT( infoSystemInfo( QString, Tomahawk::InfoSystem::InfoType, QVariant, QVariant, Tomahawk::InfoSystem::InfoCustomData ) ) );
|
||||
SIGNAL( info( QString, Tomahawk::InfoSystem::InfoType, QVariant, QVariant, QVariantMap ) ),
|
||||
SLOT( infoSystemInfo( QString, Tomahawk::InfoSystem::InfoType, QVariant, QVariant, QVariantMap ) ) );
|
||||
|
||||
connect( Tomahawk::InfoSystem::InfoSystem::instance(), SIGNAL( finished( QString ) ), SLOT( infoSystemFinished( QString ) ) );
|
||||
}
|
||||
@ -544,7 +544,7 @@ TreeModel::onAlbumsAdded( const QList<Tomahawk::album_ptr>& albums, const QVaria
|
||||
|
||||
Tomahawk::InfoSystem::InfoSystem::instance()->getInfo(
|
||||
s_tmInfoIdentifier, Tomahawk::InfoSystem::InfoAlbumCoverArt,
|
||||
QVariant::fromValue< Tomahawk::InfoSystem::InfoCriteriaHash >( trackInfo ), Tomahawk::InfoSystem::InfoCustomData() );
|
||||
QVariant::fromValue< Tomahawk::InfoSystem::InfoCriteriaHash >( trackInfo ), QVariantMap() );
|
||||
}
|
||||
|
||||
if ( !parent.isValid() || crows.second > 0 )
|
||||
@ -600,7 +600,7 @@ TreeModel::onTracksAdded( const QList<Tomahawk::query_ptr>& tracks, const QVaria
|
||||
|
||||
|
||||
void
|
||||
TreeModel::infoSystemInfo( QString caller, Tomahawk::InfoSystem::InfoType type, QVariant input, QVariant output, Tomahawk::InfoSystem::InfoCustomData customData )
|
||||
TreeModel::infoSystemInfo( QString caller, Tomahawk::InfoSystem::InfoType type, QVariant input, QVariant output, QVariantMap customData )
|
||||
{
|
||||
Q_UNUSED( customData );
|
||||
qDebug() << Q_FUNC_INFO;
|
||||
@ -612,14 +612,14 @@ TreeModel::infoSystemInfo( QString caller, Tomahawk::InfoSystem::InfoType type,
|
||||
return;
|
||||
}
|
||||
|
||||
if ( !output.canConvert< Tomahawk::InfoSystem::InfoCustomData >() )
|
||||
if ( !output.canConvert< QVariantMap >() )
|
||||
{
|
||||
qDebug() << "Cannot convert fetched art from a QByteArray";
|
||||
return;
|
||||
}
|
||||
|
||||
Tomahawk::InfoSystem::InfoCriteriaHash pptr = input.value< Tomahawk::InfoSystem::InfoCriteriaHash >();
|
||||
Tomahawk::InfoSystem::InfoCustomData returnedData = output.value< Tomahawk::InfoSystem::InfoCustomData >();
|
||||
QVariantMap returnedData = output.value< QVariantMap >();
|
||||
const QByteArray ba = returnedData["imgbytes"].toByteArray();
|
||||
qDebug() << "ba.length = " << ba.length();
|
||||
if ( ba.length() )
|
||||
|
@ -125,7 +125,7 @@ private slots:
|
||||
void onAlbumsAdded( const QList<Tomahawk::album_ptr>& albums, const QVariant& data );
|
||||
void onTracksAdded( const QList<Tomahawk::query_ptr>& tracks, const QVariant& data );
|
||||
|
||||
void infoSystemInfo( QString caller, Tomahawk::InfoSystem::InfoType type, QVariant input, QVariant output, Tomahawk::InfoSystem::InfoCustomData customData );
|
||||
void infoSystemInfo( QString caller, Tomahawk::InfoSystem::InfoType type, QVariant input, QVariant output, QVariantMap customData );
|
||||
void infoSystemFinished( QString target );
|
||||
|
||||
void onPlaybackFinished( const Tomahawk::result_ptr& result );
|
||||
|
@ -64,8 +64,8 @@ ArtistInfoWidget::ArtistInfoWidget( const Tomahawk::artist_ptr& artist, QWidget*
|
||||
m_pixmap = QPixmap( RESPATH "images/no-album-art-placeholder.png" ).scaledToWidth( 48, Qt::SmoothTransformation );
|
||||
|
||||
connect( Tomahawk::InfoSystem::InfoSystem::instance(),
|
||||
SIGNAL( info( QString, Tomahawk::InfoSystem::InfoType, QVariant, QVariant, Tomahawk::InfoSystem::InfoCustomData ) ),
|
||||
SLOT( infoSystemInfo( QString, Tomahawk::InfoSystem::InfoType, QVariant, QVariant, Tomahawk::InfoSystem::InfoCustomData ) ) );
|
||||
SIGNAL( info( QString, Tomahawk::InfoSystem::InfoType, QVariant, QVariant, QVariantMap ) ),
|
||||
SLOT( infoSystemInfo( QString, Tomahawk::InfoSystem::InfoType, QVariant, QVariant, QVariantMap ) ) );
|
||||
|
||||
connect( Tomahawk::InfoSystem::InfoSystem::instance(), SIGNAL( finished( QString ) ), SLOT( infoSystemFinished( QString ) ) );
|
||||
|
||||
@ -89,7 +89,7 @@ ArtistInfoWidget::load( const artist_ptr& artist )
|
||||
artistInfo["artist"] = artist->name();
|
||||
|
||||
InfoSystem::InfoTypeMap infoMap;
|
||||
InfoSystem::InfoCustomData hash;
|
||||
QVariantMap hash;
|
||||
infoMap[InfoSystem::InfoArtistBiography] = artist->name();
|
||||
|
||||
Tomahawk::InfoSystem::InfoSystem::instance()->getInfo(
|
||||
@ -97,20 +97,20 @@ ArtistInfoWidget::load( const artist_ptr& artist )
|
||||
|
||||
Tomahawk::InfoSystem::InfoSystem::instance()->getInfo(
|
||||
s_aiInfoIdentifier, Tomahawk::InfoSystem::InfoArtistImages,
|
||||
QVariant::fromValue< Tomahawk::InfoSystem::InfoCriteriaHash >( artistInfo ), Tomahawk::InfoSystem::InfoCustomData() );
|
||||
QVariant::fromValue< Tomahawk::InfoSystem::InfoCriteriaHash >( artistInfo ), QVariantMap() );
|
||||
|
||||
Tomahawk::InfoSystem::InfoSystem::instance()->getInfo(
|
||||
s_aiInfoIdentifier, Tomahawk::InfoSystem::InfoArtistSimilars,
|
||||
QVariant::fromValue< Tomahawk::InfoSystem::InfoCriteriaHash >( artistInfo ), Tomahawk::InfoSystem::InfoCustomData() );
|
||||
QVariant::fromValue< Tomahawk::InfoSystem::InfoCriteriaHash >( artistInfo ), QVariantMap() );
|
||||
|
||||
Tomahawk::InfoSystem::InfoSystem::instance()->getInfo(
|
||||
s_aiInfoIdentifier, Tomahawk::InfoSystem::InfoArtistSongs,
|
||||
QVariant::fromValue< Tomahawk::InfoSystem::InfoCriteriaHash >( artistInfo ), Tomahawk::InfoSystem::InfoCustomData() );
|
||||
QVariant::fromValue< Tomahawk::InfoSystem::InfoCriteriaHash >( artistInfo ), QVariantMap() );
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
ArtistInfoWidget::infoSystemInfo( QString caller, Tomahawk::InfoSystem::InfoType type, QVariant input, QVariant output, Tomahawk::InfoSystem::InfoCustomData customData )
|
||||
ArtistInfoWidget::infoSystemInfo( QString caller, Tomahawk::InfoSystem::InfoType type, QVariant input, QVariant output, QVariantMap customData )
|
||||
{
|
||||
Q_UNUSED( input );
|
||||
Q_UNUSED( customData );
|
||||
@ -125,7 +125,7 @@ ArtistInfoWidget::infoSystemInfo( QString caller, Tomahawk::InfoSystem::InfoType
|
||||
InfoSystem::InfoCriteriaHash trackInfo;
|
||||
trackInfo = input.value< InfoSystem::InfoCriteriaHash >();
|
||||
|
||||
if ( output.canConvert< Tomahawk::InfoSystem::InfoCustomData >() )
|
||||
if ( output.canConvert< QVariantMap >() )
|
||||
{
|
||||
if ( trackInfo["artist"] != m_artist->name() )
|
||||
{
|
||||
@ -134,7 +134,7 @@ ArtistInfoWidget::infoSystemInfo( QString caller, Tomahawk::InfoSystem::InfoType
|
||||
}
|
||||
}
|
||||
|
||||
InfoSystem::InfoCustomData returnedData = output.value< Tomahawk::InfoSystem::InfoCustomData >();
|
||||
QVariantMap returnedData = output.value< QVariantMap >();
|
||||
switch ( type )
|
||||
{
|
||||
case InfoSystem::InfoArtistBiography:
|
||||
|
@ -86,7 +86,7 @@ protected:
|
||||
void changeEvent( QEvent* e );
|
||||
|
||||
private slots:
|
||||
void infoSystemInfo( QString caller, Tomahawk::InfoSystem::InfoType type, QVariant input, QVariant output, Tomahawk::InfoSystem::InfoCustomData customData );
|
||||
void infoSystemInfo( QString caller, Tomahawk::InfoSystem::InfoType type, QVariant input, QVariant output, QVariantMap customData );
|
||||
void infoSystemFinished( QString target );
|
||||
|
||||
private:
|
||||
|
@ -38,8 +38,8 @@ Scrobbler::Scrobbler( QObject* parent )
|
||||
SLOT( engineTick( unsigned int ) ), Qt::QueuedConnection );
|
||||
|
||||
connect( Tomahawk::InfoSystem::InfoSystem::instance(),
|
||||
SIGNAL( info( QString, Tomahawk::InfoSystem::InfoType, QVariant, QVariant, Tomahawk::InfoSystem::InfoCustomData ) ),
|
||||
SLOT( infoSystemInfo( QString, Tomahawk::InfoSystem::InfoType, QVariant, QVariant, Tomahawk::InfoSystem::InfoCustomData ) ) );
|
||||
SIGNAL( info( QString, Tomahawk::InfoSystem::InfoType, QVariant, QVariant, QVariantMap ) ),
|
||||
SLOT( infoSystemInfo( QString, Tomahawk::InfoSystem::InfoType, QVariant, QVariant, QVariantMap ) ) );
|
||||
|
||||
connect( AudioEngine::instance(), SIGNAL( started( const Tomahawk::result_ptr& ) ),
|
||||
SLOT( trackStarted( const Tomahawk::result_ptr& ) ), Qt::QueuedConnection );
|
||||
@ -135,7 +135,7 @@ Scrobbler::scrobble()
|
||||
|
||||
|
||||
void
|
||||
Scrobbler::infoSystemInfo( QString caller, Tomahawk::InfoSystem::InfoType type, QVariant input, QVariant output, Tomahawk::InfoSystem::InfoCustomData customData )
|
||||
Scrobbler::infoSystemInfo( QString caller, Tomahawk::InfoSystem::InfoType type, QVariant input, QVariant output, QVariantMap customData )
|
||||
{
|
||||
Q_UNUSED( type );
|
||||
Q_UNUSED( input );
|
||||
|
@ -45,7 +45,7 @@ public slots:
|
||||
void trackStopped();
|
||||
void engineTick( unsigned int secondsElapsed );
|
||||
|
||||
void infoSystemInfo( QString caller, Tomahawk::InfoSystem::InfoType type, QVariant input, QVariant output, Tomahawk::InfoSystem::InfoCustomData customData );
|
||||
void infoSystemInfo( QString caller, Tomahawk::InfoSystem::InfoType type, QVariant input, QVariant output, QVariantMap customData );
|
||||
void infoSystemFinished( QString target );
|
||||
|
||||
private:
|
||||
|
@ -418,7 +418,6 @@ TomahawkApp::registerMetaTypes()
|
||||
qRegisterMetaType< AudioErrorCode >("AudioErrorCode");
|
||||
|
||||
qRegisterMetaType< QMap< QString, QMap< QString, QString > > >( "Tomahawk::InfoSystem::InfoGenericMap" );
|
||||
qRegisterMetaType< QHash< QString, QVariant > >( "Tomahawk::InfoSystem::InfoCustomData" );
|
||||
qRegisterMetaType< QHash< QString, QString > >( "Tomahawk::InfoSystem::InfoCriteriaHash" );
|
||||
qRegisterMetaType< Tomahawk::InfoSystem::InfoType >( "Tomahawk::InfoSystem::InfoType" );
|
||||
qRegisterMetaType< QWeakPointer< Tomahawk::InfoSystem::InfoSystemCache > >( "QWeakPointer< Tomahawk::InfoSystem::InfoSystemCache >" );
|
||||
|
@ -66,8 +66,8 @@ XMPPBot::XMPPBot(QObject *parent)
|
||||
SLOT(newTrackSlot(const Tomahawk::result_ptr &)));
|
||||
|
||||
connect(InfoSystem::instance(),
|
||||
SIGNAL(info(QString, Tomahawk::InfoSystem::InfoType, QVariant, QVariant, Tomahawk::InfoSystem::InfoCustomData)),
|
||||
SLOT(infoReturnedSlot(QString, Tomahawk::InfoSystem::InfoType, QVariant, QVariant, Tomahawk::InfoSystem::InfoCustomData)));
|
||||
SIGNAL(info(QString, Tomahawk::InfoSystem::InfoType, QVariant, QVariant, QVariantMap)),
|
||||
SLOT(infoReturnedSlot(QString, Tomahawk::InfoSystem::InfoType, QVariant, QVariant, QVariantMap)));
|
||||
|
||||
connect(InfoSystem::instance(), SIGNAL(finished(QString)), SLOT(infoFinishedSlot(QString)));
|
||||
|
||||
@ -214,10 +214,10 @@ void XMPPBot::handleMessage(const Message& msg, MessageSession* session)
|
||||
infoMap[InfoArtistFamiliarity] = m_currTrack.data()->artist()->name();
|
||||
if (token == "lyrics")
|
||||
{
|
||||
InfoCustomData myhash;
|
||||
QVariantMap myhash;
|
||||
myhash["trackName"] = QVariant::fromValue<QString>(m_currTrack.data()->track());
|
||||
myhash["artistName"] = QVariant::fromValue<QString>(m_currTrack.data()->artist()->name());
|
||||
infoMap[InfoTrackLyrics] = QVariant::fromValue<Tomahawk::InfoSystem::InfoCustomData>(myhash);
|
||||
infoMap[InfoTrackLyrics] = QVariant::fromValue<QVariantMap>(myhash);
|
||||
}
|
||||
}
|
||||
|
||||
@ -234,12 +234,12 @@ void XMPPBot::handleMessage(const Message& msg, MessageSession* session)
|
||||
QString waitMsg("Please wait...");
|
||||
Message retMsg(Message::Chat, JID(originatingJid.toStdString()), waitMsg.toStdString());
|
||||
m_client.data()->send(retMsg);
|
||||
Tomahawk::InfoSystem::InfoCustomData hash;
|
||||
QVariantMap hash;
|
||||
hash["XMPPBotSendToJID"] = originatingJid;
|
||||
InfoSystem::instance()->getInfo(s_botInfoIdentifier, infoMap, hash);
|
||||
}
|
||||
|
||||
void XMPPBot::infoReturnedSlot(QString caller, Tomahawk::InfoSystem::InfoType type, QVariant input, QVariant output, Tomahawk::InfoSystem::InfoCustomData customData)
|
||||
void XMPPBot::infoReturnedSlot(QString caller, Tomahawk::InfoSystem::InfoType type, QVariant input, QVariant output, QVariantMap customData)
|
||||
{
|
||||
qDebug() << Q_FUNC_INFO;
|
||||
|
||||
@ -363,13 +363,13 @@ void XMPPBot::infoReturnedSlot(QString caller, Tomahawk::InfoSystem::InfoType ty
|
||||
{
|
||||
qDebug() << "Lyrics requested";
|
||||
if (!output.canConvert<QString>() ||
|
||||
!input.canConvert<Tomahawk::InfoSystem::InfoCustomData>()
|
||||
!input.canConvert<QVariantMap>()
|
||||
)
|
||||
{
|
||||
qDebug() << "Variants failed to be valid";
|
||||
break;
|
||||
}
|
||||
InfoCustomData inHash = input.value<InfoCustomData>();
|
||||
QVariantMap inHash = input.value<QVariantMap>();
|
||||
QString artist = inHash["artistName"].toString();
|
||||
QString track = inHash["trackName"].toString();
|
||||
QString lyrics = output.toString();
|
||||
|
@ -66,7 +66,7 @@ public:
|
||||
|
||||
public slots:
|
||||
virtual void newTrackSlot(const Tomahawk::result_ptr &track);
|
||||
virtual void infoReturnedSlot(QString caller, Tomahawk::InfoSystem::InfoType type, QVariant input, QVariant output, Tomahawk::InfoSystem::InfoCustomData customData);
|
||||
virtual void infoReturnedSlot(QString caller, Tomahawk::InfoSystem::InfoType type, QVariant input, QVariant output, QVariantMap customData);
|
||||
virtual void infoFinishedSlot(QString caller);
|
||||
|
||||
protected:
|
||||
|
Loading…
x
Reference in New Issue
Block a user