mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-06 14:16:32 +02:00
Be able to do a dry-run scan
This commit is contained in:
@@ -137,6 +137,7 @@ MusicScanner::MusicScanner( MusicScanner::ScanMode scanMode, const QStringList&
|
|||||||
, m_scanMode( scanMode )
|
, m_scanMode( scanMode )
|
||||||
, m_paths( paths )
|
, m_paths( paths )
|
||||||
, m_showProgress( true )
|
, m_showProgress( true )
|
||||||
|
, m_updateIndex( true )
|
||||||
, m_cmdQueue( 0 )
|
, m_cmdQueue( 0 )
|
||||||
, m_batchsize( bs )
|
, m_batchsize( bs )
|
||||||
, m_dirListerThreadController( 0 )
|
, m_dirListerThreadController( 0 )
|
||||||
@@ -173,6 +174,20 @@ MusicScanner::showingProgress()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
MusicScanner::updateIndex( bool _updateIndex )
|
||||||
|
{
|
||||||
|
m_updateIndex = _updateIndex;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool
|
||||||
|
MusicScanner::updatingIndex()
|
||||||
|
{
|
||||||
|
return m_updateIndex;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
MusicScanner::startScan()
|
MusicScanner::startScan()
|
||||||
{
|
{
|
||||||
@@ -263,9 +278,12 @@ MusicScanner::postOps()
|
|||||||
tDebug( LOGEXTRA ) << s;
|
tDebug( LOGEXTRA ) << s;
|
||||||
|
|
||||||
if ( m_filesToDelete.length() || m_scannedfiles.length() )
|
if ( m_filesToDelete.length() || m_scannedfiles.length() )
|
||||||
|
{
|
||||||
|
if ( m_updateIndex )
|
||||||
{
|
{
|
||||||
SourceList::instance()->getLocal()->updateIndexWhenSynced();
|
SourceList::instance()->getLocal()->updateIndexWhenSynced();
|
||||||
commitBatch( m_scannedfiles, m_filesToDelete );
|
commitBatch( m_scannedfiles, m_filesToDelete );
|
||||||
|
}
|
||||||
m_scannedfiles.clear();
|
m_scannedfiles.clear();
|
||||||
m_filesToDelete.clear();
|
m_filesToDelete.clear();
|
||||||
}
|
}
|
||||||
|
@@ -110,6 +110,12 @@ public:
|
|||||||
void showProgress( bool _showProgress );
|
void showProgress( bool _showProgress );
|
||||||
bool showingProgress();
|
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:
|
signals:
|
||||||
//void fileScanned( QVariantMap );
|
//void fileScanned( QVariantMap );
|
||||||
void finished();
|
void finished();
|
||||||
@@ -137,6 +143,7 @@ private:
|
|||||||
unsigned int m_scanned;
|
unsigned int m_scanned;
|
||||||
unsigned int m_skipped;
|
unsigned int m_skipped;
|
||||||
bool m_showProgress;
|
bool m_showProgress;
|
||||||
|
bool m_updateIndex;
|
||||||
|
|
||||||
QList<QString> m_skippedFiles;
|
QList<QString> m_skippedFiles;
|
||||||
QMap<QString, QMap< unsigned int, unsigned int > > m_filemtimes;
|
QMap<QString, QMap< unsigned int, unsigned int > > m_filemtimes;
|
||||||
|
Reference in New Issue
Block a user