mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-12 17:14:00 +02:00
Delete ScriptInfoPlugin if underlying ScriptObject dies
This commit is contained in:
@@ -39,6 +39,8 @@ ScriptInfoPlugin::ScriptInfoPlugin( ScriptObject* scriptObject, const QString& n
|
||||
m_supportedPushTypes = parseSupportedTypes( m_scriptObject->syncInvoke( "supportedPushTypes" ) );
|
||||
|
||||
setFriendlyName( QString( "ScriptInfoPlugin: %1" ).arg( name ) );
|
||||
|
||||
connect( scriptObject, SIGNAL( destroyed( QObject* ) ), SLOT( onScriptObjectDeleted() ) );
|
||||
}
|
||||
|
||||
|
||||
@@ -47,6 +49,13 @@ ScriptInfoPlugin::~ScriptInfoPlugin()
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
ScriptInfoPlugin::onScriptObjectDeleted()
|
||||
{
|
||||
deleteLater();
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
ScriptInfoPlugin::init()
|
||||
{
|
||||
|
@@ -54,6 +54,9 @@ protected slots:
|
||||
void onGetInfoRequestDone( const QVariantMap& result );
|
||||
void onNotInCacheRequestDone( const QVariantMap& result );
|
||||
|
||||
// boilerplate: to be removed with Qt5 (can be put into ScriptPlugin)
|
||||
void onScriptObjectDeleted();
|
||||
|
||||
private:
|
||||
static QSet< Tomahawk::InfoSystem::InfoType > parseSupportedTypes(const QVariant& variant);
|
||||
static QString serializeQVariantMap(const QVariantMap& map);
|
||||
|
Reference in New Issue
Block a user