1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-04-07 01:22:49 +02:00

* Error handling in QtScriptResolver.

This commit is contained in:
Christian Muehlhaeuser 2011-03-21 16:52:14 +01:00
parent 218b92da9e
commit a06b1fdf52

View File

@ -37,7 +37,13 @@ QtScriptResolver::QtScriptResolver( const QString& scriptPath )
m_thread->start();
QFile scriptFile( scriptPath );
scriptFile.open( QIODevice::ReadOnly );
if ( !scriptFile.open( QIODevice::ReadOnly ) )
{
qDebug() << Q_FUNC_INFO << "Failed loading JavaScript resolver:" << scriptPath;
deleteLater();
return;
}
m_engine->mainFrame()->setHtml( "<html><body></body></html>" );
m_engine->mainFrame()->evaluateJavaScript( scriptFile.readAll() );
scriptFile.close();