mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-11 00:24:12 +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;
|
qDebug() << "Inserted" << added;
|
||||||
|
|
||||||
// TODO building the index could be a separate job, outside this transaction
|
// TODO building the index could be a separate job, outside this transaction
|
||||||
dbi->updateSearchIndex();
|
if ( added )
|
||||||
|
dbi->updateSearchIndex();
|
||||||
|
|
||||||
qDebug() << "Committing" << added << "tracks...";
|
qDebug() << "Committing" << added << "tracks...";
|
||||||
emit done( m_files, source()->collection() );
|
emit done( m_files, source()->collection() );
|
||||||
|
@@ -61,9 +61,13 @@ SourceList::add( const Tomahawk::source_ptr& s )
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
SourceList::remove( const Tomahawk::source_ptr& s )
|
SourceList::remove( Tomahawk::source_ptr& s )
|
||||||
{
|
{
|
||||||
|
if ( s.isNull() )
|
||||||
|
return;
|
||||||
|
|
||||||
remove( s.data() );
|
remove( s.data() );
|
||||||
|
s.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -87,13 +91,12 @@ SourceList::remove( Tomahawk::Source* s )
|
|||||||
}
|
}
|
||||||
|
|
||||||
emit sourceRemoved( src );
|
emit sourceRemoved( src );
|
||||||
src.clear();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
SourceList::removeAllRemote()
|
SourceList::removeAllRemote()
|
||||||
{
|
{
|
||||||
foreach( const source_ptr& s, m_sources )
|
foreach( source_ptr s, m_sources )
|
||||||
{
|
{
|
||||||
if( s != m_local )
|
if( s != m_local )
|
||||||
remove( s );
|
remove( s );
|
||||||
|
@@ -21,7 +21,7 @@ public:
|
|||||||
|
|
||||||
const Tomahawk::source_ptr& getLocal();
|
const Tomahawk::source_ptr& getLocal();
|
||||||
void add( const Tomahawk::source_ptr& s );
|
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 remove( Tomahawk::Source* s );
|
||||||
void removeAllRemote();
|
void removeAllRemote();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user