mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-07 14:46:33 +02:00
* Prevent restoring queue too early.
This commit is contained in:
@@ -25,6 +25,7 @@
|
|||||||
#include "utils/Logger.h"
|
#include "utils/Logger.h"
|
||||||
#include "Pipeline.h"
|
#include "Pipeline.h"
|
||||||
#include "Source.h"
|
#include "Source.h"
|
||||||
|
#include "SourceList.h"
|
||||||
#include "TomahawkSettings.h"
|
#include "TomahawkSettings.h"
|
||||||
#include "utils/TomahawkUtilsGui.h"
|
#include "utils/TomahawkUtilsGui.h"
|
||||||
|
|
||||||
@@ -52,12 +53,13 @@ QueueView::QueueView( QWidget* parent )
|
|||||||
TrackItemDelegate* delegate = new TrackItemDelegate( TrackItemDelegate::LovedTracks, trackView(), trackView()->proxyModel() );
|
TrackItemDelegate* delegate = new TrackItemDelegate( TrackItemDelegate::LovedTracks, trackView(), trackView()->proxyModel() );
|
||||||
trackView()->setPlaylistItemDelegate( delegate );
|
trackView()->setPlaylistItemDelegate( delegate );
|
||||||
|
|
||||||
if ( Pipeline::instance()->isRunning() )
|
if ( Pipeline::instance()->isRunning() && SourceList::instance()->isReady() )
|
||||||
{
|
{
|
||||||
restoreState();
|
restoreState();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
connect( SourceList::instance(), SIGNAL( ready() ), SLOT( restoreState() ) );
|
||||||
connect( Pipeline::instance(), SIGNAL( running() ), SLOT( restoreState() ) );
|
connect( Pipeline::instance(), SIGNAL( running() ), SLOT( restoreState() ) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -73,6 +75,9 @@ QueueView::~QueueView()
|
|||||||
void
|
void
|
||||||
QueueView::restoreState()
|
QueueView::restoreState()
|
||||||
{
|
{
|
||||||
|
if ( !Pipeline::instance()->isRunning() || !SourceList::instance()->isReady() )
|
||||||
|
return;
|
||||||
|
|
||||||
QVariantList vl = TomahawkSettings::instance()->queueState().toList();
|
QVariantList vl = TomahawkSettings::instance()->queueState().toList();
|
||||||
QList< query_ptr > ql;
|
QList< query_ptr > ql;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user