mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-06 14:16:32 +02:00
* Fixed havoc causing bool-comparison in ScanManager. Added bool param to runFileScan which triggers whether the GUI is updated when scanning is finished.
This commit is contained in:
@@ -51,6 +51,7 @@ ScanManager::ScanManager( QObject* parent )
|
|||||||
, m_currScannerPaths()
|
, m_currScannerPaths()
|
||||||
, m_cachedScannerDirs()
|
, m_cachedScannerDirs()
|
||||||
, m_queuedScanType( None )
|
, m_queuedScanType( None )
|
||||||
|
, m_updateGUI( true )
|
||||||
{
|
{
|
||||||
s_instance = this;
|
s_instance = this;
|
||||||
|
|
||||||
@@ -131,6 +132,7 @@ ScanManager::scanTimerTimeout()
|
|||||||
runNormalScan();
|
runNormalScan();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
ScanManager::runFullRescan()
|
ScanManager::runFullRescan()
|
||||||
{
|
{
|
||||||
@@ -138,13 +140,12 @@ ScanManager::runFullRescan()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
ScanManager::runNormalScan( bool manualFull )
|
ScanManager::runNormalScan( bool manualFull )
|
||||||
{
|
{
|
||||||
if ( !Database::instance() || ( Database::instance() && !Database::instance()->isReady() ) )
|
if ( !Database::instance() || ( Database::instance() && !Database::instance()->isReady() ) )
|
||||||
{
|
{
|
||||||
tLog() << Q_FUNC_INFO << "Error...Database is not ready, but should be";
|
tLog() << Q_FUNC_INFO << "Error... Database is not ready, but should be";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -184,11 +185,11 @@ ScanManager::runNormalScan( bool manualFull )
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
ScanManager::runFileScan( const QStringList &paths )
|
ScanManager::runFileScan( const QStringList& paths, bool updateGUI )
|
||||||
{
|
{
|
||||||
if ( !Database::instance() || ( Database::instance() && !Database::instance()->isReady() ) )
|
if ( !Database::instance() || ( Database::instance() && !Database::instance()->isReady() ) )
|
||||||
{
|
{
|
||||||
tLog() << Q_FUNC_INFO << "Error...Database is not ready, but should be";
|
tLog() << Q_FUNC_INFO << "Error... Database is not ready, but should be";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -214,6 +215,7 @@ ScanManager::runFileScan( const QStringList &paths )
|
|||||||
m_scanTimer->stop();
|
m_scanTimer->stop();
|
||||||
m_musicScannerThreadController = new QThread( this );
|
m_musicScannerThreadController = new QThread( this );
|
||||||
m_currScanMode = FileScan;
|
m_currScanMode = FileScan;
|
||||||
|
m_updateGUI = updateGUI;
|
||||||
|
|
||||||
QMetaObject::invokeMethod( this, "runScan", Qt::QueuedConnection );
|
QMetaObject::invokeMethod( this, "runScan", Qt::QueuedConnection );
|
||||||
}
|
}
|
||||||
@@ -276,10 +278,11 @@ ScanManager::scannerFinished()
|
|||||||
m_musicScannerThreadController = 0;
|
m_musicScannerThreadController = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
SourceList::instance()->getLocal()->scanningFinished();
|
SourceList::instance()->getLocal()->scanningFinished( m_updateGUI );
|
||||||
|
m_updateGUI = true;
|
||||||
emit finished();
|
emit finished();
|
||||||
|
|
||||||
if ( !m_queuedScanType == File )
|
if ( m_queuedScanType != File )
|
||||||
m_currScannerPaths.clear();
|
m_currScannerPaths.clear();
|
||||||
switch ( m_queuedScanType )
|
switch ( m_queuedScanType )
|
||||||
{
|
{
|
||||||
@@ -288,7 +291,7 @@ ScanManager::scannerFinished()
|
|||||||
QMetaObject::invokeMethod( this, "runNormalScan", Qt::QueuedConnection, Q_ARG( bool, m_queuedScanType == Full ) );
|
QMetaObject::invokeMethod( this, "runNormalScan", Qt::QueuedConnection, Q_ARG( bool, m_queuedScanType == Full ) );
|
||||||
break;
|
break;
|
||||||
case File:
|
case File:
|
||||||
QMetaObject::invokeMethod( this, "runFileScan", Qt::QueuedConnection, Q_ARG( QStringList, QStringList() ) );
|
QMetaObject::invokeMethod( this, "", Qt::QueuedConnection, Q_ARG( QStringList, QStringList() ) );
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
@@ -52,7 +52,7 @@ signals:
|
|||||||
void finished();
|
void finished();
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void runFileScan( const QStringList &paths = QStringList() );
|
void runFileScan( const QStringList& paths = QStringList(), bool updateGUI = true );
|
||||||
void runFullRescan();
|
void runFullRescan();
|
||||||
void runNormalScan( bool manualFull = false );
|
void runNormalScan( bool manualFull = false );
|
||||||
|
|
||||||
@@ -79,6 +79,8 @@ private:
|
|||||||
|
|
||||||
QTimer* m_scanTimer;
|
QTimer* m_scanTimer;
|
||||||
ScanType m_queuedScanType;
|
ScanType m_queuedScanType;
|
||||||
|
|
||||||
|
bool m_updateGUI;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user