mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-03-20 07:49:42 +01:00
End listen along status job if the listener quits tomahawk
This commit is contained in:
parent
bc33bd8420
commit
92fb2dbb0d
@ -80,9 +80,26 @@ LatchedStatusManager::latchedOn( const Tomahawk::source_ptr& from, const Tomahaw
|
||||
LatchedStatusItem* item = new LatchedStatusItem( from, to, this );
|
||||
m_jobs[ from->userName() ] = 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
|
||||
LatchedStatusManager::latchedOff( const Tomahawk::source_ptr& from, const Tomahawk::source_ptr& to )
|
||||
{
|
||||
|
@ -56,6 +56,7 @@ public:
|
||||
private slots:
|
||||
void latchedOn( const Tomahawk::source_ptr&, const Tomahawk::source_ptr& );
|
||||
void latchedOff( const Tomahawk::source_ptr&, const Tomahawk::source_ptr& );
|
||||
void sourceOffline();
|
||||
|
||||
private:
|
||||
QPixmap m_pixmap;
|
||||
|
Loading…
x
Reference in New Issue
Block a user