summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin Burchell <robin.burchell@theqtcompany.com>2015-01-05 16:36:52 +0100
committerRobin Burchell <robin.burchell@viroteck.net>2015-01-06 11:38:37 +0100
commitf3d17dd6e77c297543868ad67f009cc01116ac39 (patch)
treee0dec768922459ee112e5d4e25c19ef1bb676aab
parent6cef158c0e9d12fc061fdf3b4fd8b6e3361a9e59 (diff)
UIDelegatesManager: Always print errors if component loading fails.
This setting is useful when developing a new UI set, and one may not initially know about the suppression of errors, which is a painful problem to run into. Furthermore, make sure to delete the failed component so that subsequent attempted use of it doesn't succeed if UI_DELEGATES_DEBUG isn't enabled. Change-Id: I3d2abc19fb4a007d06795d2e8149ae78d7c9c020 Reviewed-by: Pierre Rossi <pierre.rossi@theqtcompany.com>
-rw-r--r--src/webengine/ui_delegates_manager.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/webengine/ui_delegates_manager.cpp b/src/webengine/ui_delegates_manager.cpp
index 95e04d69..637f3ea3 100644
--- a/src/webengine/ui_delegates_manager.cpp
+++ b/src/webengine/ui_delegates_manager.cpp
@@ -173,10 +173,10 @@ bool UIDelegatesManager::ensureComponentLoaded(ComponentType type)
*component = (new QQmlComponent(engine, QUrl::fromLocalFile(fi.absoluteFilePath()), QQmlComponent::PreferSynchronous, m_view));
if ((*component)->status() != QQmlComponent::Ready) {
-#ifdef UI_DELEGATES_DEBUG
Q_FOREACH (const QQmlError& err, (*component)->errors())
- fprintf(stderr, " component error: %s\n", qPrintable(err.toString()));
-#endif
+ qWarning("QtWebEngine: component error: %s\n", qPrintable(err.toString()));
+ delete *component;
+ *component = 0;
return false;
}
return true;