1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-04-22 00:42:04 +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
src/libtomahawk

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

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