From fd99fa84beccf1cecf9bf00873fb277c6e2c7ba1 Mon Sep 17 00:00:00 2001 From: Leo Franchi Date: Mon, 22 Aug 2011 18:26:09 -0400 Subject: [PATCH] TWK-431: Don't re-use the same infosystem caller id for every artistinfowidget. (cherry picked from commit ac317eb0a6b24d67a170e9311586108cefa99777) --- src/libtomahawk/widgets/infowidgets/ArtistInfoWidget.cpp | 9 ++++----- src/libtomahawk/widgets/infowidgets/ArtistInfoWidget.h | 1 + 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/libtomahawk/widgets/infowidgets/ArtistInfoWidget.cpp b/src/libtomahawk/widgets/infowidgets/ArtistInfoWidget.cpp index e44992741..dbd2a53f6 100644 --- a/src/libtomahawk/widgets/infowidgets/ArtistInfoWidget.cpp +++ b/src/libtomahawk/widgets/infowidgets/ArtistInfoWidget.cpp @@ -31,15 +31,13 @@ #include "widgets/overlaywidget.h" -static QString s_aiInfoIdentifier = QString( "ArtistInfoWidget" ); - using namespace Tomahawk; - ArtistInfoWidget::ArtistInfoWidget( const Tomahawk::artist_ptr& artist, QWidget* parent ) : QWidget( parent ) , ui( new Ui::ArtistInfoWidget ) , m_artist( artist ) + , m_infoId( uuid() ) { ui->setupUi( this ); @@ -95,7 +93,7 @@ ArtistInfoWidget::load( const artist_ptr& artist ) artistInfo["artist"] = artist->name(); Tomahawk::InfoSystem::InfoRequestData requestData; - requestData.caller = s_aiInfoIdentifier; + requestData.caller = m_infoId; requestData.customData = QVariantMap(); requestData.input = artist->name(); @@ -121,7 +119,7 @@ ArtistInfoWidget::load( const artist_ptr& artist ) void 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"; 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 >(); switch ( requestData.type ) { diff --git a/src/libtomahawk/widgets/infowidgets/ArtistInfoWidget.h b/src/libtomahawk/widgets/infowidgets/ArtistInfoWidget.h index 155a3f2f7..b9e97259d 100644 --- a/src/libtomahawk/widgets/infowidgets/ArtistInfoWidget.h +++ b/src/libtomahawk/widgets/infowidgets/ArtistInfoWidget.h @@ -102,6 +102,7 @@ private: QString m_title; QString m_description; QString m_longDescription; + QString m_infoId; QPixmap m_pixmap; };