mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-07-31 11:20:22 +02:00
Move more JSPlugin implementations to their own file
This commit is contained in:
@@ -26,7 +26,7 @@
|
|||||||
|
|
||||||
#include <QWebFrame>
|
#include <QWebFrame>
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
|
#include <QThread>
|
||||||
|
|
||||||
using namespace Tomahawk;
|
using namespace Tomahawk;
|
||||||
|
|
||||||
@@ -132,3 +132,32 @@ JSPlugin::name() const
|
|||||||
{
|
{
|
||||||
return m_name;
|
return m_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
QVariant
|
||||||
|
JSPlugin::evaluateJavaScriptInternal( const QString& scriptSource )
|
||||||
|
{
|
||||||
|
return m_engine->mainFrame()->evaluateJavaScript( scriptSource );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
JSPlugin::evaluateJavaScript( const QString& scriptSource )
|
||||||
|
{
|
||||||
|
if ( QThread::currentThread() != thread() )
|
||||||
|
{
|
||||||
|
QMetaObject::invokeMethod( this, "evaluateJavaScript", Qt::QueuedConnection, Q_ARG( QString, scriptSource ) );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
evaluateJavaScriptInternal( scriptSource );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
QVariant
|
||||||
|
JSPlugin::evaluateJavaScriptWithResult( const QString& scriptSource )
|
||||||
|
{
|
||||||
|
Q_ASSERT( QThread::currentThread() == thread() );
|
||||||
|
|
||||||
|
return evaluateJavaScriptInternal( scriptSource );
|
||||||
|
}
|
||||||
|
@@ -478,35 +478,6 @@ JSResolver::lookupUrl( const QString& url )
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
QVariant
|
|
||||||
JSPlugin::evaluateJavaScriptInternal( const QString& scriptSource )
|
|
||||||
{
|
|
||||||
return m_engine->mainFrame()->evaluateJavaScript( scriptSource );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
JSPlugin::evaluateJavaScript( const QString& scriptSource )
|
|
||||||
{
|
|
||||||
if ( QThread::currentThread() != thread() )
|
|
||||||
{
|
|
||||||
QMetaObject::invokeMethod( this, "evaluateJavaScript", Qt::QueuedConnection, Q_ARG( QString, scriptSource ) );
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
evaluateJavaScriptInternal( scriptSource );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
QVariant
|
|
||||||
JSPlugin::evaluateJavaScriptWithResult( const QString& scriptSource )
|
|
||||||
{
|
|
||||||
Q_ASSERT( QThread::currentThread() == thread() );
|
|
||||||
|
|
||||||
return evaluateJavaScriptInternal( scriptSource );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Tomahawk::ExternalResolver::ErrorState
|
Tomahawk::ExternalResolver::ErrorState
|
||||||
JSResolver::error() const
|
JSResolver::error() const
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user