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:
@@ -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() );
|
||||
|
@@ -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 );
|
||||
|
@@ -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();
|
||||
|
||||
|
Reference in New Issue
Block a user