mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-03-21 00:09:47 +01:00
* PlaylistModel's setAcceptPlayableQueriesOnly( bool ) toggles whether dropping unplayable queries is allowed.
This commit is contained in:
parent
85b3a83144
commit
3a10c53026
@ -45,6 +45,7 @@ PlaylistModel::PlaylistModel( QObject* parent )
|
||||
, m_isTemporary( false )
|
||||
, m_changesOngoing( false )
|
||||
, m_isLoading( false )
|
||||
, m_acceptPlayableQueriesOnly( false )
|
||||
, m_savedInsertPos( -1 )
|
||||
{
|
||||
m_dropStorage.parent = QPersistentModelIndex();
|
||||
@ -218,6 +219,9 @@ PlaylistModel::insertQueries( const QList< Tomahawk::query_ptr >& queries, int r
|
||||
QList< Tomahawk::plentry_ptr > entries;
|
||||
foreach ( const query_ptr& query, queries )
|
||||
{
|
||||
if ( m_acceptPlayableQueriesOnly && query && query->resolvingFinished() && !query->playable() )
|
||||
continue;
|
||||
|
||||
plentry_ptr entry = plentry_ptr( new PlaylistEntry() );
|
||||
|
||||
entry->setDuration( query->displayQuery()->duration() );
|
||||
|
@ -57,6 +57,9 @@ public:
|
||||
virtual void loadPlaylist( const Tomahawk::playlist_ptr& playlist, bool loadEntries = true );
|
||||
bool isTemporary() const;
|
||||
|
||||
bool acceptPlayableQueriesOnly() const { return m_acceptPlayableQueriesOnly; }
|
||||
void setAcceptPlayableQueriesOnly( bool b ) { m_acceptPlayableQueriesOnly = b; }
|
||||
|
||||
public slots:
|
||||
virtual void clear();
|
||||
|
||||
@ -95,6 +98,7 @@ private:
|
||||
bool m_isTemporary;
|
||||
bool m_changesOngoing;
|
||||
bool m_isLoading;
|
||||
bool m_acceptPlayableQueriesOnly;
|
||||
QList< Tomahawk::Query* > m_waitingForResolved;
|
||||
QStringList m_waitForRevision;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user