From ac7aadf615f4b6f686f5237d93eded235c44babb Mon Sep 17 00:00:00 2001 From: Leo Franchi Date: Thu, 13 Oct 2011 22:33:32 -0400 Subject: [PATCH] Fix latching when switching directly between latches --- src/libtomahawk/LatchManager.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/libtomahawk/LatchManager.cpp b/src/libtomahawk/LatchManager.cpp index 9e7aa7f94..8955a306d 100644 --- a/src/libtomahawk/LatchManager.cpp +++ b/src/libtomahawk/LatchManager.cpp @@ -97,6 +97,17 @@ LatchManager::playlistChanged( PlaylistInterface* ) cmd->setTimestamp( QDateTime::currentDateTime().toTime_t() ); Database::instance()->enqueue( QSharedPointer< DatabaseCommand >( cmd ) ); + if ( !m_waitingForLatch.isNull() && + m_waitingForLatch != m_latchedOnTo ) + { + // We are asked to latch on immediately to another source + m_latchedOnTo.clear(); + m_latchedInterface.clear(); + + // call ourselves to hit the "create latch" condition + playlistChanged( 0 ); + return; + } m_latchedOnTo.clear(); m_waitingForLatch.clear(); m_latchedInterface.clear();