1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-07-31 19:30:21 +02:00

Only print every scanned file in the musicscan tool

This commit is contained in:
Uwe L. Korn
2014-09-21 14:43:37 +01:00
parent 9893c8c9fc
commit ec154de61f
3 changed files with 27 additions and 1 deletions

View File

@@ -139,6 +139,7 @@ MusicScanner::MusicScanner( MusicScanner::ScanMode scanMode, const QStringList&
, m_scanned( 0 )
, m_showProgress( true )
, m_updateIndex( true )
, m_verbose( false )
, m_cmdQueue( 0 )
, m_batchsize( bs )
, m_dirListerThreadController( 0 )
@@ -189,6 +190,20 @@ MusicScanner::updatingIndex()
}
void
MusicScanner::setVerbose( bool _verbose )
{
m_verbose = _verbose;
}
bool
MusicScanner::verbose()
{
return m_verbose;
}
void
MusicScanner::startScan()
{
@@ -452,7 +467,8 @@ MusicScanner::readFile( const QFileInfo& fi )
if ( m_scanned )
if ( m_scanned % 3 == 0 && m_showProgress )
SourceList::instance()->getLocal()->scanningProgress( m_scanned );
tDebug( LOGINFO ) << "Scanning file:" << m_scanned << fi.canonicalFilePath();
if ( m_scanned % 100 == 0 || m_verbose )
tDebug( LOGINFO ) << "Scanning file:" << m_scanned << fi.canonicalFilePath();
if ( m.toMap().isEmpty() )
{

View File

@@ -116,6 +116,14 @@ public:
void updateIndex( bool _updateIndex );
bool updatingIndex();
/**
* Adjust the verbosity of logging.
*
* For example in verbose mode we will log each file we have scanned.
*/
void setVerbose( bool _verbose );
bool verbose();
signals:
//void fileScanned( QVariantMap );
void finished();
@@ -144,6 +152,7 @@ private:
unsigned int m_skipped;
bool m_showProgress;
bool m_updateIndex;
bool m_verbose;
QList<QString> m_skippedFiles;
QMap<QString, QMap< unsigned int, unsigned int > > m_filemtimes;

View File

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