From d3271cffde49c861032100bb65904b5609d1503e Mon Sep 17 00:00:00 2001 From: Christian Muehlhaeuser Date: Sun, 20 May 2012 10:20:38 +0200 Subject: [PATCH] * Don't try to load the playback history if the sources instance isn't ready yet. --- src/libtomahawk/playlist/RecentlyPlayedModel.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/libtomahawk/playlist/RecentlyPlayedModel.cpp b/src/libtomahawk/playlist/RecentlyPlayedModel.cpp index 9e071838d..99d8d1c63 100644 --- a/src/libtomahawk/playlist/RecentlyPlayedModel.cpp +++ b/src/libtomahawk/playlist/RecentlyPlayedModel.cpp @@ -40,9 +40,11 @@ RecentlyPlayedModel::RecentlyPlayedModel( const source_ptr& source, QObject* par { if ( source.isNull() ) { - onSourcesReady(); + if ( SourceList::instance()->isReady() ) + onSourcesReady(); + else + connect( SourceList::instance(), SIGNAL( ready() ), SLOT( onSourcesReady() ) ); - connect( SourceList::instance(), SIGNAL( ready() ), SLOT( onSourcesReady() ) ); connect( SourceList::instance(), SIGNAL( sourceAdded( Tomahawk::source_ptr ) ), SLOT( onSourceAdded( Tomahawk::source_ptr ) ) ); } else