mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-07 22:56:42 +02:00
* Recalculate collection stats after finish scanning.
This commit is contained in:
@@ -26,6 +26,7 @@
|
|||||||
#include "database/database.h"
|
#include "database/database.h"
|
||||||
#include "database/databasecommand_dirmtimes.h"
|
#include "database/databasecommand_dirmtimes.h"
|
||||||
#include "database/databasecommand_filemtimes.h"
|
#include "database/databasecommand_filemtimes.h"
|
||||||
|
#include "database/databasecommand_collectionstats.h"
|
||||||
#include "database/databasecommand_addfiles.h"
|
#include "database/databasecommand_addfiles.h"
|
||||||
#include "database/databasecommand_deletefiles.h"
|
#include "database/databasecommand_deletefiles.h"
|
||||||
|
|
||||||
@@ -277,12 +278,20 @@ MusicScanner::listerFinished( const QMap<QString, unsigned int>& newmtimes )
|
|||||||
foreach( const QString& s, m_skippedFiles )
|
foreach( const QString& s, m_skippedFiles )
|
||||||
qDebug() << s;
|
qDebug() << s;
|
||||||
|
|
||||||
|
|
||||||
// save mtimes, then quit thread
|
// save mtimes, then quit thread
|
||||||
|
{
|
||||||
DatabaseCommand_DirMtimes* cmd = new DatabaseCommand_DirMtimes( newmtimes );
|
DatabaseCommand_DirMtimes* cmd = new DatabaseCommand_DirMtimes( newmtimes );
|
||||||
connect( cmd, SIGNAL( finished() ), SIGNAL( finished() ) );
|
connect( cmd, SIGNAL( finished() ), SIGNAL( finished() ) );
|
||||||
|
|
||||||
Database::instance()->enqueue( QSharedPointer<DatabaseCommand>(cmd) );
|
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() )
|
if ( !m_dirLister.isNull() )
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user