1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-06 22:26:32 +02:00

* We need to tell source to update the index in the right thread.

This commit is contained in:
Christian Muehlhaeuser
2012-07-07 03:22:34 +02:00
parent 493cf75470
commit 5e0390bd87
2 changed files with 5 additions and 6 deletions

View File

@@ -162,11 +162,9 @@ DatabaseCommand_AddFiles::exec( DatabaseImpl* dbi )
m_ids << fileid; m_ids << fileid;
added++; added++;
} }
qDebug() << "Inserted" << added << "tracks to database"; qDebug() << "Inserted" << added << "tracks to database";
if ( added )
source()->updateIndexWhenSynced();
tDebug() << "Committing" << added << "tracks..."; tDebug() << "Committing" << added << "tracks...";
emit done( m_files, source()->collection() ); emit done( m_files, source()->collection() );
} }

View File

@@ -181,7 +181,7 @@ MusicScanner::scan()
scanFilePaths(); scanFilePaths();
return; return;
} }
m_dirListerThreadController = new QThread( this ); m_dirListerThreadController = new QThread( this );
m_dirLister = QWeakPointer< DirLister >( new DirLister( m_paths ) ); m_dirLister = QWeakPointer< DirLister >( new DirLister( m_paths ) );
@@ -237,6 +237,7 @@ MusicScanner::postOps()
if ( m_filesToDelete.length() || m_scannedfiles.length() ) if ( m_filesToDelete.length() || m_scannedfiles.length() )
{ {
SourceList::instance()->getLocal()->updateIndexWhenSynced();
commitBatch( m_scannedfiles, m_filesToDelete ); commitBatch( m_scannedfiles, m_filesToDelete );
m_scannedfiles.clear(); m_scannedfiles.clear();
m_filesToDelete.clear(); m_filesToDelete.clear();
@@ -366,7 +367,7 @@ MusicScanner::readFile( const QFileInfo& fi )
int bitrate = 0; int bitrate = 0;
int duration = 0; int duration = 0;
Tag *tag = Tag::fromFile( f ); Tag *tag = Tag::fromFile( f );
if ( f.audioProperties() ) if ( f.audioProperties() )
{ {