mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-09 07:36:48 +02:00
Fix some moer stuff
This commit is contained in:
@@ -88,29 +88,10 @@ LatchManager::playlistChanged( PlaylistInterface* )
|
|||||||
}
|
}
|
||||||
|
|
||||||
// We're current latched, and the user changed playlist, so stop
|
// We're current latched, and the user changed playlist, so stop
|
||||||
const PlaylistInterface* pi = AudioEngine::instance()->playlist();
|
|
||||||
bool listeningAlong = false;
|
|
||||||
source_ptr newSource;
|
|
||||||
|
|
||||||
if ( pi && dynamic_cast< const SourcePlaylistInterface* >( pi ) )
|
|
||||||
{
|
|
||||||
// Check if we're listening along to someone, to make sure it's not the same person
|
|
||||||
const SourcePlaylistInterface* sourcepi = dynamic_cast< const SourcePlaylistInterface* >( pi );
|
|
||||||
if ( !AudioEngine::instance()->state() == AudioEngine::Stopped )
|
|
||||||
{
|
|
||||||
listeningAlong = true;
|
|
||||||
newSource = sourcepi->source();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
SourcePlaylistInterface* origsourcepi = dynamic_cast< SourcePlaylistInterface* >( m_latchedInterface.data() );
|
SourcePlaylistInterface* origsourcepi = dynamic_cast< SourcePlaylistInterface* >( m_latchedInterface.data() );
|
||||||
Q_ASSERT( origsourcepi );
|
Q_ASSERT( origsourcepi );
|
||||||
const source_ptr source = origsourcepi->source();
|
const source_ptr source = origsourcepi->source();
|
||||||
|
|
||||||
// if we're currently listening along to the same source, no change
|
|
||||||
if ( listeningAlong && ( !origsourcepi->source().isNull() && origsourcepi->source()->id() == newSource->id() ) )
|
|
||||||
return;
|
|
||||||
|
|
||||||
DatabaseCommand_SocialAction* cmd = new DatabaseCommand_SocialAction();
|
DatabaseCommand_SocialAction* cmd = new DatabaseCommand_SocialAction();
|
||||||
cmd->setSource( SourceList::instance()->getLocal() );
|
cmd->setSource( SourceList::instance()->getLocal() );
|
||||||
cmd->setAction( "latchOff");
|
cmd->setAction( "latchOff");
|
||||||
|
@@ -349,7 +349,7 @@ SourceTreeView::latchOnOrCatchUp()
|
|||||||
|
|
||||||
if ( m_latchManager->isLatched( source ) )
|
if ( m_latchManager->isLatched( source ) )
|
||||||
emit catchUpRequest();
|
emit catchUpRequest();
|
||||||
|
else
|
||||||
emit latchRequest( source );
|
emit latchRequest( source );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user