From fa832e3a3629b73ae906b8d23bc6c2fa2a2b30d1 Mon Sep 17 00:00:00 2001 From: Dominik Schmidt Date: Tue, 9 Dec 2014 00:20:27 +0100 Subject: [PATCH] Move ScriptPlugin initialization to own factory method --- src/libtomahawk/resolvers/ScriptAccount.cpp | 7 +++++++ src/libtomahawk/resolvers/ScriptAccount.h | 2 ++ 2 files changed, 9 insertions(+) diff --git a/src/libtomahawk/resolvers/ScriptAccount.cpp b/src/libtomahawk/resolvers/ScriptAccount.cpp index d94a8a6ea..7fd013bd6 100644 --- a/src/libtomahawk/resolvers/ScriptAccount.cpp +++ b/src/libtomahawk/resolvers/ScriptAccount.cpp @@ -84,6 +84,13 @@ ScriptAccount::registerScriptPlugin( const QString& type, const QString& objectI m_objects.insert( objectId, object ); } + scriptPluginFactory( type, object ); +} + + +void +ScriptAccount::scriptPluginFactory( const QString& type, ScriptObject* object ) +{ if ( type == "linkGenerator" ) { tLog() << "Got link generator plugin"; diff --git a/src/libtomahawk/resolvers/ScriptAccount.h b/src/libtomahawk/resolvers/ScriptAccount.h index bf44625ea..cbb42b599 100644 --- a/src/libtomahawk/resolvers/ScriptAccount.h +++ b/src/libtomahawk/resolvers/ScriptAccount.h @@ -47,6 +47,8 @@ public: void reportScriptJobResult( const QVariantMap& result ); void registerScriptPlugin( const QString& type, const QString& objectId ); + virtual void scriptPluginFactory( const QString& type, ScriptObject* object ); + private slots: void onJobDeleted( const QString& jobId );