mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-15 02:24:50 +02:00
Remove info plugins automatically from InfoSystemWorker when they are deleted
This commit is contained in:
@@ -136,6 +136,29 @@ InfoSystemWorker::addInfoPlugin( Tomahawk::InfoSystem::InfoPluginPtr plugin )
|
|||||||
|
|
||||||
emit updatedSupportedGetTypes( QSet< InfoType >::fromList( m_infoGetMap.keys() ) );
|
emit updatedSupportedGetTypes( QSet< InfoType >::fromList( m_infoGetMap.keys() ) );
|
||||||
emit updatedSupportedPushTypes( QSet< InfoType >::fromList( m_infoPushMap.keys() ) );
|
emit updatedSupportedPushTypes( QSet< InfoType >::fromList( m_infoPushMap.keys() ) );
|
||||||
|
|
||||||
|
connect( plugin.data(), SIGNAL( destroyed( QObject* ) ), SLOT( onInfoPluginDeleted() ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
InfoSystemWorker::onInfoPluginDeleted()
|
||||||
|
{
|
||||||
|
foreach( const InfoPluginPtr& plugin, m_plugins )
|
||||||
|
{
|
||||||
|
if ( plugin.isNull() )
|
||||||
|
{
|
||||||
|
m_plugins.removeOne( plugin );
|
||||||
|
foreach( InfoType type, m_infoGetMap.keys() )
|
||||||
|
{
|
||||||
|
m_infoGetMap[type].removeOne( plugin );
|
||||||
|
}
|
||||||
|
foreach( InfoType type, m_infoPushMap.keys() )
|
||||||
|
{
|
||||||
|
m_infoPushMap[type].removeOne( plugin );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -72,6 +72,7 @@ public slots:
|
|||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void checkTimeoutsTimerFired();
|
void checkTimeoutsTimerFired();
|
||||||
|
void onInfoPluginDeleted();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void registerInfoTypes( const InfoPluginPtr &plugin, const QSet< InfoType > &getTypes, const QSet< InfoType > &pushTypes );
|
void registerInfoTypes( const InfoPluginPtr &plugin, const QSet< InfoType > &getTypes, const QSet< InfoType > &pushTypes );
|
||||||
|
Reference in New Issue
Block a user