1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-09 07:36:48 +02:00

TWK-431: Don't re-use the same infosystem caller id for every artistinfowidget.

(cherry picked from commit ac317eb0a6)
This commit is contained in:
Leo Franchi
2011-08-22 18:26:09 -04:00
parent 13ab10adea
commit fd99fa84be
2 changed files with 5 additions and 5 deletions

View File

@@ -31,15 +31,13 @@
#include "widgets/overlaywidget.h" #include "widgets/overlaywidget.h"
static QString s_aiInfoIdentifier = QString( "ArtistInfoWidget" );
using namespace Tomahawk; using namespace Tomahawk;
ArtistInfoWidget::ArtistInfoWidget( const Tomahawk::artist_ptr& artist, QWidget* parent ) ArtistInfoWidget::ArtistInfoWidget( const Tomahawk::artist_ptr& artist, QWidget* parent )
: QWidget( parent ) : QWidget( parent )
, ui( new Ui::ArtistInfoWidget ) , ui( new Ui::ArtistInfoWidget )
, m_artist( artist ) , m_artist( artist )
, m_infoId( uuid() )
{ {
ui->setupUi( this ); ui->setupUi( this );
@@ -95,7 +93,7 @@ ArtistInfoWidget::load( const artist_ptr& artist )
artistInfo["artist"] = artist->name(); artistInfo["artist"] = artist->name();
Tomahawk::InfoSystem::InfoRequestData requestData; Tomahawk::InfoSystem::InfoRequestData requestData;
requestData.caller = s_aiInfoIdentifier; requestData.caller = m_infoId;
requestData.customData = QVariantMap(); requestData.customData = QVariantMap();
requestData.input = artist->name(); requestData.input = artist->name();
@@ -121,7 +119,7 @@ ArtistInfoWidget::load( const artist_ptr& artist )
void void
ArtistInfoWidget::infoSystemInfo( Tomahawk::InfoSystem::InfoRequestData requestData, QVariant output ) ArtistInfoWidget::infoSystemInfo( Tomahawk::InfoSystem::InfoRequestData requestData, QVariant output )
{ {
if ( requestData.caller != s_aiInfoIdentifier ) if ( requestData.caller != m_infoId )
{ {
// qDebug() << "Info of wrong type or not with our identifier"; // qDebug() << "Info of wrong type or not with our identifier";
return; return;
@@ -139,6 +137,7 @@ ArtistInfoWidget::infoSystemInfo( Tomahawk::InfoSystem::InfoRequestData requestD
} }
} }
qDebug() << "ARTISTINFOWIDGET got infosystem info for:" << m_title << output.value< Tomahawk::InfoSystem::InfoGenericMap >();
QVariantMap returnedData = output.value< QVariantMap >(); QVariantMap returnedData = output.value< QVariantMap >();
switch ( requestData.type ) switch ( requestData.type )
{ {

View File

@@ -102,6 +102,7 @@ private:
QString m_title; QString m_title;
QString m_description; QString m_description;
QString m_longDescription; QString m_longDescription;
QString m_infoId;
QPixmap m_pixmap; QPixmap m_pixmap;
}; };