1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-06 14:16:32 +02:00

* Recalculate collection stats after finish scanning.

This commit is contained in:
Christian Muehlhaeuser
2011-06-23 18:02:09 +02:00
parent 1a4ed2e551
commit 337c4e6e9c

View File

@@ -26,6 +26,7 @@
#include "database/database.h"
#include "database/databasecommand_dirmtimes.h"
#include "database/databasecommand_filemtimes.h"
#include "database/databasecommand_collectionstats.h"
#include "database/databasecommand_addfiles.h"
#include "database/databasecommand_deletefiles.h"
@@ -277,12 +278,20 @@ MusicScanner::listerFinished( const QMap<QString, unsigned int>& newmtimes )
foreach( const QString& s, m_skippedFiles )
qDebug() << s;
// save mtimes, then quit thread
{
DatabaseCommand_DirMtimes* cmd = new DatabaseCommand_DirMtimes( newmtimes );
connect( cmd, SIGNAL( finished() ), SIGNAL( finished() ) );
Database::instance()->enqueue( QSharedPointer<DatabaseCommand>(cmd) );
}
// re-calculate source stats
{
DatabaseCommand_CollectionStats* cmd = new DatabaseCommand_CollectionStats( SourceList::instance()->getLocal() );
connect( cmd, SIGNAL( done( QVariantMap ) ),
SourceList::instance()->getLocal().data(), SLOT( setStats( QVariantMap ) ), Qt::QueuedConnection );
Database::instance()->enqueue( QSharedPointer<DatabaseCommand>( cmd ) );
}
if ( !m_dirLister.isNull() )
{