From f025edf095aecce9caf0a633333a50c20f5bece1 Mon Sep 17 00:00:00 2001 From: Leo Franchi Date: Wed, 2 Nov 2011 20:41:57 -0400 Subject: [PATCH] Possible fix for multiple breadcrumbs. Erase buttons before resettin the model. --- .../infosystem/infoplugins/generic/chartsplugin.cpp | 3 ++- src/libtomahawk/widgets/Breadcrumb.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 2bf0faba5..161364b73 100644 --- a/src/libtomahawk/infosystem/infoplugins/generic/chartsplugin.cpp +++ b/src/libtomahawk/infosystem/infoplugins/generic/chartsplugin.cpp @@ -73,7 +73,7 @@ ChartsPlugin::namChangedSlot( QNetworkAccessManager *nam ) m_nam = QWeakPointer< QNetworkAccessManager >( nam ); /// Then get each chart from resource - /// We need to fetch them before they are asked for + /// We want to prepopulate the breadcrumb to fetch them before they are asked for if( !m_chartResources.isEmpty() && m_nam ){ @@ -194,6 +194,7 @@ ChartsPlugin::fetchChartCapabilities( Tomahawk::InfoSystem::InfoRequestData requ } Tomahawk::InfoSystem::InfoStringHash criteria; + emit getCachedInfo( criteria, 0, requestData ); } diff --git a/src/libtomahawk/widgets/Breadcrumb.cpp b/src/libtomahawk/widgets/Breadcrumb.cpp index 59dc6cde0..aec9a7f49 100644 --- a/src/libtomahawk/widgets/Breadcrumb.cpp +++ b/src/libtomahawk/widgets/Breadcrumb.cpp @@ -56,6 +56,10 @@ Breadcrumb::~Breadcrumb() void Breadcrumb::setModel( QAbstractItemModel* model ) { + foreach ( BreadcrumbButton* b, m_buttons ) + b->deleteLater();; + m_buttons.clear(); + m_model = model; updateButtons( QModelIndex() ); }