From 247e8ffbf4189115c91b39dd6499ab9fb233d460 Mon Sep 17 00:00:00 2001 From: Jeff Mitchell Date: Sat, 29 Oct 2011 14:15:52 -0400 Subject: [PATCH] Treemodel: don't consider an infosystem request resolved if it has invalid data returned --- src/libtomahawk/playlist/treemodel.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/libtomahawk/playlist/treemodel.cpp b/src/libtomahawk/playlist/treemodel.cpp index 14cc9e06f..956b064f1 100644 --- a/src/libtomahawk/playlist/treemodel.cpp +++ b/src/libtomahawk/playlist/treemodel.cpp @@ -827,7 +827,7 @@ TreeModel::infoSystemInfo( Tomahawk::InfoSystem::InfoRequestData requestData, QV QStringList albums = returnedData[ "albums" ].toStringList(); QList al; - InfoSystem::InfoStringHash inputInfo; + Tomahawk::InfoSystem::InfoStringHash inputInfo; inputInfo = requestData.input.value< InfoSystem::InfoStringHash >(); artist_ptr artist = Artist::get( inputInfo[ "artist" ], false ); @@ -848,14 +848,19 @@ TreeModel::infoSystemInfo( Tomahawk::InfoSystem::InfoRequestData requestData, QV { if ( m_receivedInfoData.contains( requestData.input.value< Tomahawk::InfoSystem::InfoStringHash >() ) ) break; + + QVariantMap returnedData = output.value< QVariantMap >(); + if ( returnedData.isEmpty() ) + break; + m_receivedInfoData.insert( requestData.input.value< Tomahawk::InfoSystem::InfoStringHash >() ); - QVariantMap returnedData = output.value< QVariantMap >(); + QStringList tracks = returnedData[ "tracks" ].toStringList(); QList ql; - InfoSystem::InfoStringHash inputInfo; - inputInfo = requestData.input.value< InfoSystem::InfoStringHash >(); + Tomahawk::InfoSystem::InfoStringHash inputInfo; + inputInfo = requestData.input.value< Tomahawk::InfoSystem::InfoStringHash >(); foreach ( const QString& trackName, tracks ) {