1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-20 04:41:36 +02:00

* Don't skip over unsolved but playable tracks.

* Don't assert on invalid connections.
This commit is contained in:
Christian Muehlhaeuser
2011-03-19 05:09:57 +01:00
parent 64846c1abd
commit 520806f0bb
4 changed files with 9 additions and 4 deletions

View File

@@ -183,7 +183,7 @@ ControlConnection::dbSyncConnection()
if ( !m_dbsyncconn )
{
setupDbSyncConnection( true );
Q_ASSERT( m_dbsyncconn );
// Q_ASSERT( m_dbsyncconn );
}
return m_dbsyncconn;

View File

@@ -137,7 +137,7 @@ TrackProxyModel::siblingItem( int itemsAway )
{
PlItem* item = itemFromIndex( mapToSource( idx ) );
qDebug() << item->query()->toString();
if ( item && item->query()->solved() )
if ( item && item->query()->playable() )
{
qDebug() << "Next PlaylistItem found:" << item->query()->toString() << item->query()->results().at( 0 )->url();
setCurrentItem( idx );

View File

@@ -44,6 +44,7 @@ Query::get( const QString& artist, const QString& track, const QString& album, c
Query::Query( const QString& artist, const QString& track, const QString& album, const QID& qid )
: m_solved( false )
, m_playable( false )
, m_qid( qid )
, m_artist( artist )
, m_album( album )
@@ -167,6 +168,7 @@ Query::checkResults()
{
bool becameSolved = false;
bool becameUnsolved = true;
m_playable = m_results.count() > 0;
// hook up signals, and check solved status
foreach( const result_ptr& rp, m_results )

View File

@@ -59,8 +59,10 @@ public:
/// sorter for list of results
static bool resultSorter( const result_ptr &left, const result_ptr& right );
/// solved=true when a perfect result has been found (score of 1.0)
/// true when a perfect result has been found (score of 1.0)
bool solved() const { return m_solved; }
/// true when any result has been found (score may be less than 1.0)
bool playable() const { return m_playable; }
unsigned int lastPipelineWeight() const { return m_lastpipelineweight; }
void setLastPipelineWeight( unsigned int w ) { m_lastpipelineweight = w; }
@@ -105,6 +107,7 @@ private:
QList< Tomahawk::result_ptr > m_results;
bool m_solved;
bool m_playable;
mutable QID m_qid;
unsigned int m_lastpipelineweight;