From 3b219d6e39413b577b62d74897fda7353f339d48 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Fri, 15 Oct 2010 18:56:30 +0000 Subject: [PATCH] if the parsing fails, set failed to launch with a reasonable message svn path=/trunk/KDE/kdebase/runtime/; revision=1186305 --- .../javascript/plasmoid/declarativeappletscript.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scriptengines/javascript/plasmoid/declarativeappletscript.cpp b/scriptengines/javascript/plasmoid/declarativeappletscript.cpp index 37a6f2077..f628e0a77 100644 --- a/scriptengines/javascript/plasmoid/declarativeappletscript.cpp +++ b/scriptengines/javascript/plasmoid/declarativeappletscript.cpp @@ -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; }