From 52b77464f1b272acf3a1151bc4a800bef2208a25 Mon Sep 17 00:00:00 2001 From: Leo Franchi Date: Thu, 3 Nov 2011 20:51:00 -0400 Subject: [PATCH] Don't re-fetch charts on nam change --- .../infosystem/infoplugins/generic/chartsplugin.cpp | 3 ++- .../infosystem/infoplugins/generic/spotifyPlugin.cpp | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/libtomahawk/infosystem/infoplugins/generic/chartsplugin.cpp b/src/libtomahawk/infosystem/infoplugins/generic/chartsplugin.cpp index 46d064c7b..a0b3f9475 100644 --- a/src/libtomahawk/infosystem/infoplugins/generic/chartsplugin.cpp +++ b/src/libtomahawk/infosystem/infoplugins/generic/chartsplugin.cpp @@ -75,7 +75,8 @@ ChartsPlugin::namChangedSlot( QNetworkAccessManager *nam ) /// Then get each chart from resource /// We want to prepopulate the breadcrumb to fetch them before they are asked for - if( !m_chartResources.isEmpty() && m_nam ){ + if ( !m_chartResources.isEmpty() && m_nam && m_allChartsMap.isEmpty() ) + { tDebug() << "ChartsPlugin: InfoChart fetching possible resources"; foreach ( QVariant resource, m_chartResources ) diff --git a/src/libtomahawk/infosystem/infoplugins/generic/spotifyPlugin.cpp b/src/libtomahawk/infosystem/infoplugins/generic/spotifyPlugin.cpp index c9549c81e..245ceb593 100644 --- a/src/libtomahawk/infosystem/infoplugins/generic/spotifyPlugin.cpp +++ b/src/libtomahawk/infosystem/infoplugins/generic/spotifyPlugin.cpp @@ -66,6 +66,10 @@ SpotifyPlugin::namChangedSlot( QNetworkAccessManager *nam ) m_nam = QWeakPointer< QNetworkAccessManager >( nam ); + // we never need to re-fetch + if ( !m_allChartsMap.isEmpty() ) + return; + /// We need to fetch possible types before they are asked for tDebug() << "SpotifyPlugin: InfoChart fetching possible resources";