mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-13 17:43:59 +02:00
Pass around scriptobject_ptr instead of ScriptObject*
This commit is contained in:
@@ -55,6 +55,7 @@ namespace Tomahawk
|
|||||||
class GeneratorInterface;
|
class GeneratorInterface;
|
||||||
class PeerInfo;
|
class PeerInfo;
|
||||||
class DatabaseCommand;
|
class DatabaseCommand;
|
||||||
|
class ScriptObject;
|
||||||
|
|
||||||
typedef QSharedPointer<Collection> collection_ptr;
|
typedef QSharedPointer<Collection> collection_ptr;
|
||||||
typedef QSharedPointer<Playlist> playlist_ptr;
|
typedef QSharedPointer<Playlist> playlist_ptr;
|
||||||
@@ -82,6 +83,11 @@ namespace Tomahawk
|
|||||||
typedef QSharedPointer<DynamicControl> dyncontrol_ptr;
|
typedef QSharedPointer<DynamicControl> dyncontrol_ptr;
|
||||||
typedef QSharedPointer<GeneratorInterface> geninterface_ptr;
|
typedef QSharedPointer<GeneratorInterface> geninterface_ptr;
|
||||||
|
|
||||||
|
|
||||||
|
// Scripting
|
||||||
|
typedef QSharedPointer< ScriptObject > scriptobject_ptr;
|
||||||
|
typedef QWeakPointer< ScriptObject > scriptobject_wptr;
|
||||||
|
|
||||||
// let's keep these typesafe, they are different kinds of GUID:
|
// let's keep these typesafe, they are different kinds of GUID:
|
||||||
typedef QString QID; //query id
|
typedef QString QID; //query id
|
||||||
typedef QString RID; //result id
|
typedef QString RID; //result id
|
||||||
|
@@ -53,7 +53,7 @@ JSAccount::setResolver( JSResolver* resolver )
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
JSAccount::scriptPluginFactory( const QString& type, ScriptObject* object )
|
JSAccount::scriptPluginFactory( const QString& type, const scriptobject_ptr& object )
|
||||||
{
|
{
|
||||||
if ( type == "resolver" )
|
if ( type == "resolver" )
|
||||||
{
|
{
|
||||||
@@ -151,7 +151,7 @@ JSAccount::startJob( ScriptJob* scriptJob )
|
|||||||
|
|
||||||
|
|
||||||
const QVariant
|
const QVariant
|
||||||
JSAccount::syncInvoke( ScriptObject* scriptObject, const QString& methodName, const QVariantMap& arguments )
|
JSAccount::syncInvoke( const scriptobject_ptr& scriptObject, const QString& methodName, const QVariantMap& arguments )
|
||||||
{
|
{
|
||||||
QString eval = QString(
|
QString eval = QString(
|
||||||
"Tomahawk.PluginManager.invokeSync("
|
"Tomahawk.PluginManager.invokeSync("
|
||||||
|
@@ -45,7 +45,7 @@ public:
|
|||||||
JSAccount( const QString& name );
|
JSAccount( const QString& name );
|
||||||
|
|
||||||
void startJob( ScriptJob* scriptJob ) override;
|
void startJob( ScriptJob* scriptJob ) override;
|
||||||
const QVariant syncInvoke( ScriptObject* scriptObject, const QString& methodName, const QVariantMap& arguments ) override;
|
const QVariant syncInvoke( const scriptobject_ptr& scriptObject, const QString& methodName, const QVariantMap& arguments ) override;
|
||||||
|
|
||||||
const QString name() const;
|
const QString name() const;
|
||||||
|
|
||||||
@@ -70,7 +70,7 @@ public:
|
|||||||
void addToJavaScriptWindowObject( const QString& name, QObject* object );
|
void addToJavaScriptWindowObject( const QString& name, QObject* object );
|
||||||
|
|
||||||
void setResolver( JSResolver* resolver );
|
void setResolver( JSResolver* resolver );
|
||||||
void scriptPluginFactory( const QString& type, ScriptObject* object ) override;
|
void scriptPluginFactory( const QString& type, const scriptobject_ptr& object ) override;
|
||||||
|
|
||||||
static QString serializeQVariantMap(const QVariantMap& map);
|
static QString serializeQVariantMap(const QVariantMap& map);
|
||||||
|
|
||||||
|
@@ -59,7 +59,7 @@ using namespace Tomahawk;
|
|||||||
|
|
||||||
JSResolver::JSResolver( const QString& accountId, const QString& scriptPath, const QStringList& additionalScriptPaths )
|
JSResolver::JSResolver( const QString& accountId, const QString& scriptPath, const QStringList& additionalScriptPaths )
|
||||||
: Tomahawk::ExternalResolverGui( scriptPath )
|
: Tomahawk::ExternalResolverGui( scriptPath )
|
||||||
, ScriptPlugin( nullptr )
|
, ScriptPlugin( scriptobject_ptr() )
|
||||||
, d_ptr( new JSResolverPrivate( this, accountId, scriptPath, additionalScriptPaths ) )
|
, d_ptr( new JSResolverPrivate( this, accountId, scriptPath, additionalScriptPaths ) )
|
||||||
{
|
{
|
||||||
Q_D( JSResolver );
|
Q_D( JSResolver );
|
||||||
|
@@ -20,6 +20,7 @@
|
|||||||
|
|
||||||
#include "ScriptObject.h"
|
#include "ScriptObject.h"
|
||||||
#include "../utils/Logger.h"
|
#include "../utils/Logger.h"
|
||||||
|
#include "../Typedefs.h"
|
||||||
|
|
||||||
// TODO: register factory methods instead of hardcoding all plugin types in here
|
// TODO: register factory methods instead of hardcoding all plugin types in here
|
||||||
#include "../utils/LinkGenerator.h"
|
#include "../utils/LinkGenerator.h"
|
||||||
@@ -46,7 +47,7 @@ requestIdGenerator()
|
|||||||
|
|
||||||
|
|
||||||
ScriptJob*
|
ScriptJob*
|
||||||
ScriptAccount::invoke( ScriptObject* scriptObject, const QString& methodName, const QVariantMap& arguments )
|
ScriptAccount::invoke( const scriptobject_ptr& scriptObject, const QString& methodName, const QVariantMap& arguments )
|
||||||
{
|
{
|
||||||
QString requestId = requestIdGenerator();
|
QString requestId = requestIdGenerator();
|
||||||
|
|
||||||
@@ -88,11 +89,12 @@ ScriptAccount::reportScriptJobResult( const QVariantMap& result )
|
|||||||
void
|
void
|
||||||
ScriptAccount::registerScriptPlugin( const QString& type, const QString& objectId )
|
ScriptAccount::registerScriptPlugin( const QString& type, const QString& objectId )
|
||||||
{
|
{
|
||||||
ScriptObject* object = m_objects.value( objectId );
|
scriptobject_ptr object = m_objects.value( objectId );
|
||||||
if( !object )
|
if( !object )
|
||||||
{
|
{
|
||||||
object = new ScriptObject( objectId, this );
|
object = scriptobject_ptr( new ScriptObject( objectId, this ), &ScriptObject::deleteLater );
|
||||||
connect( object, SIGNAL( destroyed( QObject* ) ), SLOT( onScriptObjectDeleted( QObject* ) ) );
|
object->setWeakRef( object.toWeakRef() );
|
||||||
|
connect( object.data(), SIGNAL( destroyed( QObject* ) ), SLOT( onScriptObjectDeleted() ) );
|
||||||
m_objects.insert( objectId, object );
|
m_objects.insert( objectId, object );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -101,14 +103,21 @@ ScriptAccount::registerScriptPlugin( const QString& type, const QString& objectI
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
ScriptAccount::onScriptObjectDeleted( QObject* scriptObject )
|
ScriptAccount::onScriptObjectDeleted()
|
||||||
{
|
{
|
||||||
m_objects.remove( m_objects.key( static_cast< ScriptObject* >( scriptObject ) ) );
|
foreach( const scriptobject_ptr& object, m_objects.values() )
|
||||||
|
{
|
||||||
|
if ( object.isNull() )
|
||||||
|
{
|
||||||
|
m_objects.remove( m_objects.key( object ) );
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
ScriptAccount::scriptPluginFactory( const QString& type, ScriptObject* object )
|
ScriptAccount::scriptPluginFactory( const QString& type, const scriptobject_ptr& object )
|
||||||
{
|
{
|
||||||
if ( type == "linkGenerator" )
|
if ( type == "linkGenerator" )
|
||||||
{
|
{
|
||||||
|
@@ -21,6 +21,8 @@
|
|||||||
#ifndef TOMAHAWK_SCRIPTACCOUNT_H
|
#ifndef TOMAHAWK_SCRIPTACCOUNT_H
|
||||||
#define TOMAHAWK_SCRIPTACCOUNT_H
|
#define TOMAHAWK_SCRIPTACCOUNT_H
|
||||||
|
|
||||||
|
#include "../Typedefs.h"
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QVariantMap>
|
#include <QVariantMap>
|
||||||
|
|
||||||
@@ -42,25 +44,25 @@ public:
|
|||||||
ScriptAccount( const QString& name );
|
ScriptAccount( const QString& name );
|
||||||
virtual ~ScriptAccount() {}
|
virtual ~ScriptAccount() {}
|
||||||
|
|
||||||
ScriptJob* invoke( ScriptObject* scriptObject, const QString& methodName, const QVariantMap& arguments );
|
ScriptJob* invoke( const scriptobject_ptr& scriptObject, const QString& methodName, const QVariantMap& arguments );
|
||||||
virtual const QVariant syncInvoke( ScriptObject* scriptObject, const QString& methodName, const QVariantMap& arguments ) = 0;
|
virtual const QVariant syncInvoke( const scriptobject_ptr& scriptObject, const QString& methodName, const QVariantMap& arguments ) = 0;
|
||||||
|
|
||||||
virtual void startJob( ScriptJob* scriptJob ) = 0;
|
virtual void startJob( ScriptJob* scriptJob ) = 0;
|
||||||
|
|
||||||
void reportScriptJobResult( const QVariantMap& result );
|
void reportScriptJobResult( const QVariantMap& result );
|
||||||
void registerScriptPlugin( const QString& type, const QString& objectId );
|
void registerScriptPlugin( const QString& type, const QString& objectId );
|
||||||
|
|
||||||
virtual void scriptPluginFactory( const QString& type, ScriptObject* object );
|
virtual void scriptPluginFactory( const QString& type, const scriptobject_ptr& object );
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void onJobDeleted( const QString& jobId );
|
void onJobDeleted( const QString& jobId );
|
||||||
|
|
||||||
void onScriptObjectDeleted( QObject* scriptObject );
|
void onScriptObjectDeleted();
|
||||||
|
|
||||||
private: // TODO: pimple, might be renamed before tho
|
private: // TODO: pimple, might be renamed before tho
|
||||||
QString m_name;
|
QString m_name;
|
||||||
QHash< QString, ScriptJob* > m_jobs;
|
QHash< QString, ScriptJob* > m_jobs;
|
||||||
QHash< QString, ScriptObject* > m_objects;
|
QHash< QString, scriptobject_ptr > m_objects;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // ns: Tomahawk
|
} // ns: Tomahawk
|
||||||
|
@@ -28,7 +28,7 @@
|
|||||||
|
|
||||||
using namespace Tomahawk;
|
using namespace Tomahawk;
|
||||||
|
|
||||||
ScriptInfoPlugin::ScriptInfoPlugin( ScriptObject* scriptObject, const QString& name )
|
ScriptInfoPlugin::ScriptInfoPlugin( const scriptobject_ptr& scriptObject, const QString& name )
|
||||||
: d_ptr( new ScriptInfoPluginPrivate( this ) )
|
: d_ptr( new ScriptInfoPluginPrivate( this ) )
|
||||||
, ScriptPlugin( scriptObject )
|
, ScriptPlugin( scriptObject )
|
||||||
{
|
{
|
||||||
@@ -40,7 +40,7 @@ ScriptInfoPlugin::ScriptInfoPlugin( ScriptObject* scriptObject, const QString& n
|
|||||||
|
|
||||||
setFriendlyName( QString( "ScriptInfoPlugin: %1" ).arg( name ) );
|
setFriendlyName( QString( "ScriptInfoPlugin: %1" ).arg( name ) );
|
||||||
|
|
||||||
connect( scriptObject, SIGNAL( destroyed( QObject* ) ), SLOT( onScriptObjectDeleted() ) );
|
connect( scriptObject.data(), SIGNAL( destroyed( QObject* ) ), SLOT( onScriptObjectDeleted() ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -41,7 +41,7 @@ public:
|
|||||||
/**
|
/**
|
||||||
* @param id unique identifier to identify an infoplugin in its scope
|
* @param id unique identifier to identify an infoplugin in its scope
|
||||||
*/
|
*/
|
||||||
ScriptInfoPlugin( ScriptObject* scriptObject, const QString& name );
|
ScriptInfoPlugin( const scriptobject_ptr& scriptObject, const QString& name );
|
||||||
virtual ~ScriptInfoPlugin();
|
virtual ~ScriptInfoPlugin();
|
||||||
|
|
||||||
protected slots:
|
protected slots:
|
||||||
|
@@ -24,8 +24,8 @@
|
|||||||
|
|
||||||
using namespace Tomahawk;
|
using namespace Tomahawk;
|
||||||
|
|
||||||
ScriptJob::ScriptJob( const QString& id, ScriptObject* scriptObject, const QString& methodName, const QVariantMap& arguments )
|
ScriptJob::ScriptJob( const QString& id, const scriptobject_ptr& scriptObject, const QString& methodName, const QVariantMap& arguments )
|
||||||
: QObject( scriptObject->thread() == QThread::currentThread() ? scriptObject : nullptr )
|
: QObject( scriptObject->thread() == QThread::currentThread() ? scriptObject.data() : nullptr )
|
||||||
, m_error( false )
|
, m_error( false )
|
||||||
, m_id( id )
|
, m_id( id )
|
||||||
, m_scriptObject( scriptObject )
|
, m_scriptObject( scriptObject )
|
||||||
@@ -54,7 +54,7 @@ ScriptJob::error() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ScriptObject*
|
const scriptobject_ptr
|
||||||
ScriptJob::scriptObject() const
|
ScriptJob::scriptObject() const
|
||||||
{
|
{
|
||||||
return m_scriptObject;
|
return m_scriptObject;
|
||||||
|
@@ -19,6 +19,8 @@
|
|||||||
#ifndef TOMAHAWK_SCRIPTJOB_H
|
#ifndef TOMAHAWK_SCRIPTJOB_H
|
||||||
#define TOMAHAWK_SCRIPTJOB_H
|
#define TOMAHAWK_SCRIPTJOB_H
|
||||||
|
|
||||||
|
#include "../Typedefs.h"
|
||||||
|
|
||||||
#include <QVariantMap>
|
#include <QVariantMap>
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
|
|
||||||
@@ -34,7 +36,7 @@ class DLLEXPORT ScriptJob : public QObject
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ScriptJob( const QString& id, ScriptObject* scriptObject, const QString& methodName, const QVariantMap& arguments = QVariantMap() );
|
ScriptJob( const QString& id, const scriptobject_ptr& scriptObject, const QString& methodName, const QVariantMap& arguments = QVariantMap() );
|
||||||
virtual ~ScriptJob();
|
virtual ~ScriptJob();
|
||||||
|
|
||||||
virtual void start();
|
virtual void start();
|
||||||
@@ -42,7 +44,7 @@ public:
|
|||||||
bool error() const;
|
bool error() const;
|
||||||
|
|
||||||
const QString id() const;
|
const QString id() const;
|
||||||
ScriptObject* scriptObject() const;
|
const scriptobject_ptr scriptObject() const;
|
||||||
const QString methodName() const;
|
const QString methodName() const;
|
||||||
const QVariantMap arguments() const;
|
const QVariantMap arguments() const;
|
||||||
|
|
||||||
@@ -60,7 +62,7 @@ protected:
|
|||||||
// TODO: pimple
|
// TODO: pimple
|
||||||
bool m_error;
|
bool m_error;
|
||||||
QString m_id;
|
QString m_id;
|
||||||
ScriptObject* m_scriptObject;
|
scriptobject_ptr m_scriptObject;
|
||||||
QVariantMap m_data;
|
QVariantMap m_data;
|
||||||
QString m_methodName;
|
QString m_methodName;
|
||||||
QVariantMap m_arguments;
|
QVariantMap m_arguments;
|
||||||
|
@@ -24,8 +24,8 @@
|
|||||||
|
|
||||||
using namespace Tomahawk;
|
using namespace Tomahawk;
|
||||||
|
|
||||||
ScriptLinkGeneratorPlugin::ScriptLinkGeneratorPlugin( ScriptObject* scriptObject )
|
ScriptLinkGeneratorPlugin::ScriptLinkGeneratorPlugin( const scriptobject_ptr& scriptObject )
|
||||||
: QObject( scriptObject )
|
: QObject( scriptObject.data() )
|
||||||
, ScriptPlugin( scriptObject )
|
, ScriptPlugin( scriptObject )
|
||||||
, Utils::LinkGeneratorPlugin()
|
, Utils::LinkGeneratorPlugin()
|
||||||
, d_ptr( new ScriptLinkGeneratorPluginPrivate( this, scriptObject ) )
|
, d_ptr( new ScriptLinkGeneratorPluginPrivate( this, scriptObject ) )
|
||||||
|
@@ -37,7 +37,7 @@ class DLLEXPORT ScriptLinkGeneratorPlugin : public QObject, public ScriptPlugin,
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ScriptLinkGeneratorPlugin( ScriptObject* scriptObject );
|
ScriptLinkGeneratorPlugin( const scriptobject_ptr& scriptObject );
|
||||||
virtual ~ScriptLinkGeneratorPlugin();
|
virtual ~ScriptLinkGeneratorPlugin();
|
||||||
|
|
||||||
ScriptJob* openLink( const QString& title, const QString& artist, const QString& album ) const override;
|
ScriptJob* openLink( const QString& title, const QString& artist, const QString& album ) const override;
|
||||||
|
@@ -27,7 +27,7 @@ namespace Tomahawk
|
|||||||
class ScriptLinkGeneratorPluginPrivate
|
class ScriptLinkGeneratorPluginPrivate
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ScriptLinkGeneratorPluginPrivate( ScriptLinkGeneratorPlugin* q, ScriptObject* scriptObject )
|
ScriptLinkGeneratorPluginPrivate( ScriptLinkGeneratorPlugin* q, const scriptobject_ptr& scriptObject )
|
||||||
: q_ptr ( q )
|
: q_ptr ( q )
|
||||||
, scriptObject( scriptObject )
|
, scriptObject( scriptObject )
|
||||||
{
|
{
|
||||||
@@ -36,7 +36,7 @@ public:
|
|||||||
Q_DECLARE_PUBLIC ( ScriptLinkGeneratorPlugin )
|
Q_DECLARE_PUBLIC ( ScriptLinkGeneratorPlugin )
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ScriptObject* scriptObject;
|
scriptobject_ptr scriptObject;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // ns: Tomahawk
|
} // ns: Tomahawk
|
||||||
|
@@ -31,6 +31,24 @@ ScriptObject::ScriptObject( const QString& id, ScriptAccount* parent )
|
|||||||
|
|
||||||
ScriptObject::~ScriptObject()
|
ScriptObject::~ScriptObject()
|
||||||
{
|
{
|
||||||
|
//TODO: Album clears the ownRef wptr explicitly ... why?
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
ScriptObject::setWeakRef(const scriptobject_wptr& weakRef)
|
||||||
|
{
|
||||||
|
Q_D( ScriptObject );
|
||||||
|
d->ownRef = weakRef;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const scriptobject_wptr
|
||||||
|
ScriptObject::weakRef() const
|
||||||
|
{
|
||||||
|
Q_D( const ScriptObject );
|
||||||
|
|
||||||
|
return d->ownRef;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -39,7 +57,7 @@ ScriptObject::invoke( const QString& methodName, const QVariantMap& arguments )
|
|||||||
{
|
{
|
||||||
Q_D( ScriptObject );
|
Q_D( ScriptObject );
|
||||||
|
|
||||||
return d->scriptAccount->invoke( this, methodName, arguments );
|
return d->scriptAccount->invoke( weakRef().toStrongRef(), methodName, arguments );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -48,7 +66,7 @@ ScriptObject::syncInvoke(const QString& methodName, const QVariantMap& arguments
|
|||||||
{
|
{
|
||||||
Q_D( ScriptObject );
|
Q_D( ScriptObject );
|
||||||
|
|
||||||
return d->scriptAccount->syncInvoke( this, methodName, arguments );
|
return d->scriptAccount->syncInvoke( weakRef().toStrongRef(), methodName, arguments );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -19,6 +19,8 @@
|
|||||||
#ifndef TOMAHAWK_SCRIPTOBJECT_H
|
#ifndef TOMAHAWK_SCRIPTOBJECT_H
|
||||||
#define TOMAHAWK_SCRIPTOBJECT_H
|
#define TOMAHAWK_SCRIPTOBJECT_H
|
||||||
|
|
||||||
|
#include "../Typedefs.h"
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QVariantMap>
|
#include <QVariantMap>
|
||||||
|
|
||||||
@@ -40,6 +42,9 @@ public:
|
|||||||
ScriptObject( const QString& id, ScriptAccount* parent );
|
ScriptObject( const QString& id, ScriptAccount* parent );
|
||||||
virtual ~ScriptObject();
|
virtual ~ScriptObject();
|
||||||
|
|
||||||
|
void setWeakRef( const scriptobject_wptr& weakRef );
|
||||||
|
const scriptobject_wptr weakRef() const;
|
||||||
|
|
||||||
ScriptJob* invoke( const QString& methodName, const QVariantMap& arguments = QVariantMap() );
|
ScriptJob* invoke( const QString& methodName, const QVariantMap& arguments = QVariantMap() );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -40,6 +40,7 @@ public:
|
|||||||
private:
|
private:
|
||||||
QString id;
|
QString id;
|
||||||
ScriptAccount* scriptAccount;
|
ScriptAccount* scriptAccount;
|
||||||
|
scriptobject_wptr ownRef;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // ns: Tomahawk
|
} // ns: Tomahawk
|
||||||
|
@@ -20,7 +20,7 @@
|
|||||||
|
|
||||||
using namespace Tomahawk;
|
using namespace Tomahawk;
|
||||||
|
|
||||||
ScriptPlugin::ScriptPlugin( ScriptObject* object )
|
ScriptPlugin::ScriptPlugin( const scriptobject_ptr& object )
|
||||||
: m_scriptObject( object )
|
: m_scriptObject( object )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -32,7 +32,7 @@ ScriptPlugin::~ScriptPlugin()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ScriptObject*
|
const scriptobject_ptr
|
||||||
ScriptPlugin::scriptObject() const
|
ScriptPlugin::scriptObject() const
|
||||||
{
|
{
|
||||||
return m_scriptObject;
|
return m_scriptObject;
|
||||||
|
@@ -32,13 +32,13 @@ class ScriptObject;
|
|||||||
class DLLEXPORT ScriptPlugin
|
class DLLEXPORT ScriptPlugin
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ScriptPlugin( ScriptObject* object );
|
ScriptPlugin( const scriptobject_ptr& object );
|
||||||
virtual ~ScriptPlugin();
|
virtual ~ScriptPlugin();
|
||||||
|
|
||||||
ScriptObject* scriptObject() const;
|
const scriptobject_ptr scriptObject() const;
|
||||||
|
|
||||||
protected: // TODO: pimple
|
protected: // TODO: pimple
|
||||||
QPointer< ScriptObject > m_scriptObject;
|
scriptobject_ptr m_scriptObject;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -17,9 +17,11 @@
|
|||||||
*/
|
*/
|
||||||
#include "SyncScriptJob.h"
|
#include "SyncScriptJob.h"
|
||||||
|
|
||||||
|
#include "../Typedefs.h"
|
||||||
|
#include "ScriptObject.h"
|
||||||
|
|
||||||
Tomahawk::SyncScriptJob::SyncScriptJob( const QVariantMap& resultData )
|
Tomahawk::SyncScriptJob::SyncScriptJob( const QVariantMap& resultData )
|
||||||
: ScriptJob( QString(), nullptr, QString() )
|
: ScriptJob( QString(), scriptobject_ptr(), QString() )
|
||||||
{
|
{
|
||||||
m_data = resultData;
|
m_data = resultData;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user