mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-05 13:47:26 +02:00
CLean up some logic
This commit is contained in:
@@ -372,6 +372,10 @@ SourceTreeView::latchOn()
|
|||||||
void
|
void
|
||||||
SourceTreeView::playlistChanged( PlaylistInterface* newInterface )
|
SourceTreeView::playlistChanged( PlaylistInterface* newInterface )
|
||||||
{
|
{
|
||||||
|
// If we were latched on and changed, send the listening along stop
|
||||||
|
if ( m_latch.isNull() )
|
||||||
|
return;
|
||||||
|
|
||||||
const PlaylistInterface* pi = AudioEngine::instance()->playlist();
|
const PlaylistInterface* pi = AudioEngine::instance()->playlist();
|
||||||
bool listeningAlong = false;
|
bool listeningAlong = false;
|
||||||
source_ptr newSource;
|
source_ptr newSource;
|
||||||
@@ -386,9 +390,6 @@ SourceTreeView::playlistChanged( PlaylistInterface* newInterface )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// If we were latched on and changed, send the listening along stop
|
|
||||||
if ( !m_latch.isNull() )
|
|
||||||
{
|
|
||||||
SourcePlaylistInterface* origsourcepi = dynamic_cast< SourcePlaylistInterface* >( m_latch.data() );
|
SourcePlaylistInterface* origsourcepi = dynamic_cast< SourcePlaylistInterface* >( m_latch.data() );
|
||||||
Q_ASSERT( origsourcepi );
|
Q_ASSERT( origsourcepi );
|
||||||
const source_ptr source = origsourcepi->source();
|
const source_ptr source = origsourcepi->source();
|
||||||
@@ -405,7 +406,6 @@ SourceTreeView::playlistChanged( PlaylistInterface* newInterface )
|
|||||||
Database::instance()->enqueue( QSharedPointer< DatabaseCommand >( cmd ) );
|
Database::instance()->enqueue( QSharedPointer< DatabaseCommand >( cmd ) );
|
||||||
|
|
||||||
m_latch.clear();
|
m_latch.clear();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
Reference in New Issue
Block a user