1
0
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:
Dominik Schmidt
2015-01-05 02:42:39 +01:00
parent 07838afaa6
commit 96a601d16f
2 changed files with 12 additions and 0 deletions

View File

@@ -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()
{

View File

@@ -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);