mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-01 03:40:16 +02:00
End listen along status job if the listener quits tomahawk
This commit is contained in:
@@ -80,9 +80,26 @@ LatchedStatusManager::latchedOn( const Tomahawk::source_ptr& from, const Tomahaw
|
|||||||
LatchedStatusItem* item = new LatchedStatusItem( from, to, this );
|
LatchedStatusItem* item = new LatchedStatusItem( from, to, this );
|
||||||
m_jobs[ from->userName() ] = item;
|
m_jobs[ from->userName() ] = item;
|
||||||
JobStatusView::instance()->model()->addJob( item );
|
JobStatusView::instance()->model()->addJob( item );
|
||||||
|
|
||||||
|
connect( from.data(), SIGNAL( offline() ), this, SLOT( sourceOffline() ), Qt::UniqueConnection );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
LatchedStatusManager::sourceOffline()
|
||||||
|
{
|
||||||
|
Tomahawk::Source* s = qobject_cast< Tomahawk::Source* >( sender() );
|
||||||
|
Q_ASSERT( s );
|
||||||
|
|
||||||
|
if ( m_jobs.contains( s->userName() ) )
|
||||||
|
{
|
||||||
|
QWeakPointer< LatchedStatusItem> job = m_jobs.take( s->userName() ).data();
|
||||||
|
if ( !job.isNull() )
|
||||||
|
job.data()->stop();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
LatchedStatusManager::latchedOff( const Tomahawk::source_ptr& from, const Tomahawk::source_ptr& to )
|
LatchedStatusManager::latchedOff( const Tomahawk::source_ptr& from, const Tomahawk::source_ptr& to )
|
||||||
{
|
{
|
||||||
|
@@ -56,6 +56,7 @@ public:
|
|||||||
private slots:
|
private slots:
|
||||||
void latchedOn( const Tomahawk::source_ptr&, const Tomahawk::source_ptr& );
|
void latchedOn( const Tomahawk::source_ptr&, const Tomahawk::source_ptr& );
|
||||||
void latchedOff( const Tomahawk::source_ptr&, const Tomahawk::source_ptr& );
|
void latchedOff( const Tomahawk::source_ptr&, const Tomahawk::source_ptr& );
|
||||||
|
void sourceOffline();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QPixmap m_pixmap;
|
QPixmap m_pixmap;
|
||||||
|
Reference in New Issue
Block a user