From 608b90867a97586a91e13cd63f958c6c97513697 Mon Sep 17 00:00:00 2001 From: Jeff Mitchell Date: Sun, 27 Mar 2011 19:10:30 -0400 Subject: [PATCH] Don't rescan the local collection if the settings dialog is closed with success but the path hasn't changed --- ChangeLog | 2 ++ src/scanmanager.cpp | 11 +++++++++-- src/scanmanager.h | 1 + 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 696509ace..57ebcf0d8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,6 @@ Version 0.0.2: + * Don't run a rescan of the local collection if the settings dialog is + closed successfully but the path hasn't changed. * Don't attempt to connect to unavailable Twitter peers over and over. * Find Twitter peers if the peer's Got Tomahawk? tweet is not their latest tweet. diff --git a/src/scanmanager.cpp b/src/scanmanager.cpp index 613d91d4c..ebbe0eabb 100644 --- a/src/scanmanager.cpp +++ b/src/scanmanager.cpp @@ -44,6 +44,9 @@ ScanManager::ScanManager( QObject* parent ) s_instance = this; connect( TomahawkSettings::instance(), SIGNAL( changed() ), SLOT( onSettingsChanged() ) ); + + if ( TomahawkSettings::instance()->hasScannerPath() ) + m_currScannerPath = TomahawkSettings::instance()->scannerPath(); } @@ -76,8 +79,12 @@ ScanManager::~ScanManager() void ScanManager::onSettingsChanged() { - if ( TomahawkSettings::instance()->hasScannerPath() ) - runManualScan( TomahawkSettings::instance()->scannerPath() ); + if ( TomahawkSettings::instance()->hasScannerPath() && + m_currScannerPath != TomahawkSettings::instance()->scannerPath() ) + { + m_currScannerPath = TomahawkSettings::instance()->scannerPath(); + runManualScan( m_currScannerPath ); + } } diff --git a/src/scanmanager.h b/src/scanmanager.h index dc139cded..0a115b444 100644 --- a/src/scanmanager.h +++ b/src/scanmanager.h @@ -53,6 +53,7 @@ private: MusicScanner* m_scanner; QThread* m_musicScannerThreadController; + QString m_currScannerPath; }; #endif