From dfa1c2dab99115a1ad97f4e2e93ac07e2d0705fd Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Tue, 22 Aug 2017 20:19:53 -0600 Subject: Install the webengineprofile as singleton This fixes the bug that the main process would hang on exit as long as we have a requestinterceptor installed. It's most likely a bug that this does not work, but the new solution anyways cleans up the code a bit, so that's a nice sideeffect. Fixes T5570 --- framework/src/frameworkplugin.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'framework/src/frameworkplugin.cpp') diff --git a/framework/src/frameworkplugin.cpp b/framework/src/frameworkplugin.cpp index 33bc8cbc..f5cd2cf5 100644 --- a/framework/src/frameworkplugin.cpp +++ b/framework/src/frameworkplugin.cpp @@ -35,6 +35,7 @@ #include "fabric.h" #include "kubeimage.h" #include "clipboardproxy.h" +#include "webengineprofile.h" #include @@ -45,6 +46,13 @@ static QObject *fabric_singletontype_provider(QQmlEngine *engine, QJSEngine *scr return new Kube::Fabric::Fabric; } +static QObject *webengineprofile_singletontype_provider(QQmlEngine *engine, QJSEngine *scriptEngine) +{ + Q_UNUSED(engine) + Q_UNUSED(scriptEngine) + return new WebEngineProfile; +} + void FrameworkPlugin::registerTypes (const char *uri) { qmlRegisterType(uri, 1, 0, "FolderListModel"); @@ -67,4 +75,5 @@ void FrameworkPlugin::registerTypes (const char *uri) qmlRegisterType(uri, 1, 0, "KubeImage"); qmlRegisterType(uri, 1, 0, "Clipboard"); + qmlRegisterSingletonType(uri, 1, 0, "WebEngineProfile", webengineprofile_singletontype_provider); } -- cgit v1.2.3