From 16f3ed8044857c881d23a35b3ef8efc12ad72201 Mon Sep 17 00:00:00 2001
From: Robin Burchell <robin.burchell@theqtcompany.com>
Date: Mon, 5 Jan 2015 16:36:57 +0100
Subject: [PATCH] UIDelegatesManager: Communicate load failure back to the
 dialog controller.

If the dialog controller has asked to show a dialog, then if we cannot show a
dialog, we should reject its request.

Not doing this results in the WebView becoming frozen for input if the load
fails, seemingly.

Change-Id: I7dddd5357c712f896499cdebb142e60b5e80b4f2
Reviewed-by: Pierre Rossi <pierre.rossi@theqtcompany.com>
---
 src/webengine/ui_delegates_manager.cpp | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/webengine/ui_delegates_manager.cpp b/src/webengine/ui_delegates_manager.cpp
index 637f3ea36..e2f3855f4 100644
--- a/src/webengine/ui_delegates_manager.cpp
+++ b/src/webengine/ui_delegates_manager.cpp
@@ -296,8 +296,12 @@ void UIDelegatesManager::showDialog(QSharedPointer<JavaScriptDialogController> d
         Q_UNREACHABLE();
     }
 
-    if (!ensureComponentLoaded(dialogComponentType))
+    if (!ensureComponentLoaded(dialogComponentType)) {
+        // Let the controller know it couldn't be loaded
+        qWarning("Failed to load dialog, rejecting.");
+        dialogController->reject();
         return;
+    }
 
     QQmlComponent *dialogComponent = Q_NULLPTR;
     switch (dialogComponentType) {
-- 
GitLab