1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-05 21:57:41 +02:00

* Don't emit tracks in batches.

This commit is contained in:
Christian Muehlhaeuser
2011-03-07 00:50:54 +01:00
parent eadfd92929
commit c1a65587cd

View File

@@ -60,6 +60,7 @@ DatabaseCommand_AllTracks::exec( DatabaseImpl* dbi )
while( query.next() ) while( query.next() )
{ {
Tomahawk::result_ptr result = Tomahawk::result_ptr( new Tomahawk::Result() ); Tomahawk::result_ptr result = Tomahawk::result_ptr( new Tomahawk::Result() );
QVariantMap attr; QVariantMap attr;
TomahawkSqlQuery attrQuery = dbi->newquery(); TomahawkSqlQuery attrQuery = dbi->newquery();
@@ -89,7 +90,7 @@ DatabaseCommand_AllTracks::exec( DatabaseImpl* dbi )
result->setAlbumPos( query.value( 11 ).toUInt() ); result->setAlbumPos( query.value( 11 ).toUInt() );
result->setScore( 1.0 ); result->setScore( 1.0 );
result->setCollection( m_collection ); result->setCollection( m_collection );
attrQuery.prepare( "SELECT k, v FROM track_attributes WHERE id = ?" ); attrQuery.prepare( "SELECT k, v FROM track_attributes WHERE id = ?" );
attrQuery.bindValue( 0, result->dbid() ); attrQuery.bindValue( 0, result->dbid() );
attrQuery.exec(); attrQuery.exec();
@@ -105,12 +106,6 @@ DatabaseCommand_AllTracks::exec( DatabaseImpl* dbi )
qry->addResults( results ); qry->addResults( results );
ql << qry; ql << qry;
if ( ++i % 5000 == 0 )
{
emit tracks( ql, m_collection );
ql.clear();
}
} }
qDebug() << Q_FUNC_INFO << ql.length(); qDebug() << Q_FUNC_INFO << ql.length();