From d37fd8955c2804c31e43e3db4ea526c59796eb28 Mon Sep 17 00:00:00 2001 From: Jeff Mitchell Date: Mon, 10 Oct 2011 09:53:55 -0400 Subject: [PATCH] Optimize the full rescan path a bit, and add a check for safety (that should be a noop) --- src/musicscanner.cpp | 4 +++- src/scanmanager.cpp | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/musicscanner.cpp b/src/musicscanner.cpp index 710420f82..dc3602927 100644 --- a/src/musicscanner.cpp +++ b/src/musicscanner.cpp @@ -261,7 +261,9 @@ MusicScanner::listerFinished( const QMap& newmtimes ) m_filesToDelete << m_filemtimes[ key ].keys().first(); } commitBatch( m_scannedfiles, m_filesToDelete ); - + m_scannedfiles.clear(); + m_filesToDelete.clear(); + // remove obsolete / stale files foreach ( const QString& path, m_dirmtimes.keys() ) { diff --git a/src/scanmanager.cpp b/src/scanmanager.cpp index b5938314e..79b96f825 100644 --- a/src/scanmanager.cpp +++ b/src/scanmanager.cpp @@ -168,7 +168,8 @@ ScanManager::filesDeleted( const QStringList& files, const Tomahawk::collection_ { Q_UNUSED( files ); Q_UNUSED( collection ); - runDirScan( TomahawkSettings::instance()->scannerPaths(), true ); + if ( !TomahawkSettings::instance()->scannerPaths().isEmpty() ) + runDirScan( TomahawkSettings::instance()->scannerPaths(), true ); }