mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-03-18 23:09:42 +01:00
Move more JSPlugin implementations to their own file
This commit is contained in:
parent
b2c3ab8532
commit
dbd047b42a
@ -26,7 +26,7 @@
|
||||
|
||||
#include <QWebFrame>
|
||||
#include <QFile>
|
||||
|
||||
#include <QThread>
|
||||
|
||||
using namespace Tomahawk;
|
||||
|
||||
@ -132,3 +132,32 @@ JSPlugin::name() const
|
||||
{
|
||||
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
|
||||
JSResolver::error() const
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user