1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-09 15:47:38 +02:00

* Don't reindex if there weren't any new files.

This commit is contained in:
Christian Muehlhaeuser
2011-02-16 07:48:00 +01:00
parent a42df08fea
commit 10c592ccab
3 changed files with 9 additions and 5 deletions

View File

@@ -186,7 +186,8 @@ DatabaseCommand_AddFiles::exec( DatabaseImpl* dbi )
qDebug() << "Inserted" << added;
// TODO building the index could be a separate job, outside this transaction
dbi->updateSearchIndex();
if ( added )
dbi->updateSearchIndex();
qDebug() << "Committing" << added << "tracks...";
emit done( m_files, source()->collection() );

View File

@@ -61,9 +61,13 @@ SourceList::add( const Tomahawk::source_ptr& s )
void
SourceList::remove( const Tomahawk::source_ptr& s )
SourceList::remove( Tomahawk::source_ptr& s )
{
if ( s.isNull() )
return;
remove( s.data() );
s.clear();
}
@@ -87,13 +91,12 @@ SourceList::remove( Tomahawk::Source* s )
}
emit sourceRemoved( src );
src.clear();
}
void
SourceList::removeAllRemote()
{
foreach( const source_ptr& s, m_sources )
foreach( source_ptr s, m_sources )
{
if( s != m_local )
remove( s );

View File

@@ -21,7 +21,7 @@ public:
const Tomahawk::source_ptr& getLocal();
void add( const Tomahawk::source_ptr& s );
void remove( const Tomahawk::source_ptr& s );
void remove( Tomahawk::source_ptr& s );
void remove( Tomahawk::Source* s );
void removeAllRemote();