1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-01 20:00:13 +02:00

Rename updateIndex to dryRun to better reflect its use

This commit is contained in:
Uwe L. Korn
2014-09-21 14:52:49 +01:00
parent ec154de61f
commit 7b096db2fd
3 changed files with 13 additions and 11 deletions

View File

@@ -138,7 +138,7 @@ MusicScanner::MusicScanner( MusicScanner::ScanMode scanMode, const QStringList&
, m_paths( paths ) , m_paths( paths )
, m_scanned( 0 ) , m_scanned( 0 )
, m_showProgress( true ) , m_showProgress( true )
, m_updateIndex( true ) , m_dryRun( false )
, m_verbose( false ) , m_verbose( false )
, m_cmdQueue( 0 ) , m_cmdQueue( 0 )
, m_batchsize( bs ) , m_batchsize( bs )
@@ -177,16 +177,16 @@ MusicScanner::showingProgress()
void void
MusicScanner::updateIndex( bool _updateIndex ) MusicScanner::setDryRun( bool _dryRun )
{ {
m_updateIndex = _updateIndex; m_dryRun = _dryRun;
} }
bool bool
MusicScanner::updatingIndex() MusicScanner::dryRun()
{ {
return m_updateIndex; return m_dryRun;
} }
@@ -295,7 +295,7 @@ MusicScanner::postOps()
if ( m_filesToDelete.length() || m_scannedfiles.length() ) if ( m_filesToDelete.length() || m_scannedfiles.length() )
{ {
if ( m_updateIndex ) if ( !m_dryRun )
{ {
SourceList::instance()->getLocal()->updateIndexWhenSynced(); SourceList::instance()->getLocal()->updateIndexWhenSynced();
commitBatch( m_scannedfiles, m_filesToDelete ); commitBatch( m_scannedfiles, m_filesToDelete );

View File

@@ -111,10 +111,12 @@ public:
bool showingProgress(); bool showingProgress();
/** /**
* Specify if the search index should be updated or if we only want a dry run. * Specify if we want a dry run, i.e. not change any of the internal data stores.
*
* This is useful for testing if the scanner works (while Tomahawk is running).
*/ */
void updateIndex( bool _updateIndex ); void setDryRun( bool _dryRun );
bool updatingIndex(); bool dryRun();
/** /**
* Adjust the verbosity of logging. * Adjust the verbosity of logging.
@@ -151,7 +153,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; bool m_dryRun;
bool m_verbose; bool m_verbose;
QList<QString> m_skippedFiles; QList<QString> m_skippedFiles;

View File

@@ -48,7 +48,7 @@ main( int argc, char* argv[] )
// We want a dry-run of the scanner and not update any internal data. // We want a dry-run of the scanner and not update any internal data.
scanner.showProgress( false ); scanner.showProgress( false );
scanner.updateIndex( false ); scanner.setDryRun( true );
scanner.setVerbose( true ); scanner.setVerbose( true );
// Start the MusicScanner in its own thread // Start the MusicScanner in its own thread