if the parsing fails, set failed to launch with a reasonable message

svn path=/trunk/KDE/kdebase/runtime/; revision=1186305
This commit is contained in:
Marco Martin 2010-10-15 18:56:30 +00:00
parent 5d1f73a693
commit 3b219d6e39

View File

@ -79,7 +79,12 @@ bool DeclarativeAppletScript::init()
m_declarativeWidget->setInitializationDelayed(true);
m_declarativeWidget->setQmlPath(mainScript());
if (!m_declarativeWidget->engine()) {
if (!m_declarativeWidget->engine() || !m_declarativeWidget->engine()->rootContext() || !m_declarativeWidget->engine()->rootContext()->isValid() || m_declarativeWidget->mainComponent()->isError()) {
QString reason;
foreach (QDeclarativeError error, m_declarativeWidget->mainComponent()->errors()) {
reason += error.toString();
}
setFailedToLaunch(true, reason);
return false;
}