1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-01-31 05:38:04 +01:00

Be able to do a dry-run scan

This commit is contained in:
Uwe L. Korn 2014-09-21 11:36:30 +01:00
parent f6c2a40cca
commit 6e22032aa5
2 changed files with 27 additions and 2 deletions

View File

@ -137,6 +137,7 @@ MusicScanner::MusicScanner( MusicScanner::ScanMode scanMode, const QStringList&
, m_scanMode( scanMode )
, m_paths( paths )
, m_showProgress( true )
, m_updateIndex( true )
, m_cmdQueue( 0 )
, m_batchsize( bs )
, m_dirListerThreadController( 0 )
@ -173,6 +174,20 @@ MusicScanner::showingProgress()
}
void
MusicScanner::updateIndex( bool _updateIndex )
{
m_updateIndex = _updateIndex;
}
bool
MusicScanner::updatingIndex()
{
return m_updateIndex;
}
void
MusicScanner::startScan()
{
@ -264,8 +279,11 @@ MusicScanner::postOps()
if ( m_filesToDelete.length() || m_scannedfiles.length() )
{
SourceList::instance()->getLocal()->updateIndexWhenSynced();
commitBatch( m_scannedfiles, m_filesToDelete );
if ( m_updateIndex )
{
SourceList::instance()->getLocal()->updateIndexWhenSynced();
commitBatch( m_scannedfiles, m_filesToDelete );
}
m_scannedfiles.clear();
m_filesToDelete.clear();
}

View File

@ -110,6 +110,12 @@ public:
void showProgress( bool _showProgress );
bool showingProgress();
/**
* Specify if the search index should be updated or if we only want a dry run.
*/
void updateIndex( bool _updateIndex );
bool updatingIndex();
signals:
//void fileScanned( QVariantMap );
void finished();
@ -137,6 +143,7 @@ private:
unsigned int m_scanned;
unsigned int m_skipped;
bool m_showProgress;
bool m_updateIndex;
QList<QString> m_skippedFiles;
QMap<QString, QMap< unsigned int, unsigned int > > m_filemtimes;