From a0cd7869bc370377ed1905efd7d1c156f004880f Mon Sep 17 00:00:00 2001 From: hugolm84 Date: Tue, 6 Sep 2011 14:25:40 +0200 Subject: [PATCH] Loop --- src/libtomahawk/utils/itunesparser.cpp | 10 ++++++---- src/libtomahawk/utils/itunesparser.h | 1 + 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/libtomahawk/utils/itunesparser.cpp b/src/libtomahawk/utils/itunesparser.cpp index ef0815ff3..3a406cbf2 100644 --- a/src/libtomahawk/utils/itunesparser.cpp +++ b/src/libtomahawk/utils/itunesparser.cpp @@ -127,11 +127,13 @@ ItunesParser::itunesResponseLookupFinished() foreach(QVariant itune, itunesResponse){ QString title, artist, album; - if( itune.toMap().value( "wrapperType" ).toString().contains( "track" ) ){ + QVariantMap ituneMap = itune.toMap(); - title = itune.toMap().value( "trackName" ).toString(); - artist = itune.toMap().value( "artistName" ).toString(); - album = itune.toMap().value( "collectionName" ).toString(); + if( ituneMap.value( "wrapperType" ).toString().contains( "track" ) ){ + + title = ituneMap.value( "trackName" ).toString(); + artist = ituneMap.value( "artistName" ).toString(); + album = ituneMap.value( "collectionName" ).toString(); if ( title.isEmpty() && artist.isEmpty() ) // don't have enough... { tLog() << "Didn't get an artist and track name from itunes, not enough to build a query on. Aborting" << title << artist << album; diff --git a/src/libtomahawk/utils/itunesparser.h b/src/libtomahawk/utils/itunesparser.h index 6a3f5d956..df847416b 100644 --- a/src/libtomahawk/utils/itunesparser.h +++ b/src/libtomahawk/utils/itunesparser.h @@ -51,6 +51,7 @@ signals: void tracks( const QList< Tomahawk::query_ptr > tracks ); void playlist( const Tomahawk::query_ptr& playlist ); + private slots: void itunesResponseLookupFinished();