summaryrefslogtreecommitdiffstats
path: root/framework/src/frameworkplugin.cpp
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2017-08-22 20:19:53 -0600
committerChristian Mollekopf <chrigi_1@fastmail.fm>2017-08-22 20:19:53 -0600
commitdfa1c2dab99115a1ad97f4e2e93ac07e2d0705fd (patch)
treedf28c8dc60e9718e12093425497268b5021a0a1d /framework/src/frameworkplugin.cpp
parent2844ef37db4c498f39ba9804483831a27b8aa412 (diff)
downloadkube-dfa1c2dab99115a1ad97f4e2e93ac07e2d0705fd.tar.gz
kube-dfa1c2dab99115a1ad97f4e2e93ac07e2d0705fd.zip
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
Diffstat (limited to 'framework/src/frameworkplugin.cpp')
-rw-r--r--framework/src/frameworkplugin.cpp9
1 files changed, 9 insertions, 0 deletions
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 @@
35#include "fabric.h" 35#include "fabric.h"
36#include "kubeimage.h" 36#include "kubeimage.h"
37#include "clipboardproxy.h" 37#include "clipboardproxy.h"
38#include "webengineprofile.h"
38 39
39#include <QtQml> 40#include <QtQml>
40 41
@@ -45,6 +46,13 @@ static QObject *fabric_singletontype_provider(QQmlEngine *engine, QJSEngine *scr
45 return new Kube::Fabric::Fabric; 46 return new Kube::Fabric::Fabric;
46} 47}
47 48
49static QObject *webengineprofile_singletontype_provider(QQmlEngine *engine, QJSEngine *scriptEngine)
50{
51 Q_UNUSED(engine)
52 Q_UNUSED(scriptEngine)
53 return new WebEngineProfile;
54}
55
48void FrameworkPlugin::registerTypes (const char *uri) 56void FrameworkPlugin::registerTypes (const char *uri)
49{ 57{
50 qmlRegisterType<FolderListModel>(uri, 1, 0, "FolderListModel"); 58 qmlRegisterType<FolderListModel>(uri, 1, 0, "FolderListModel");
@@ -67,4 +75,5 @@ void FrameworkPlugin::registerTypes (const char *uri)
67 75
68 qmlRegisterType<KubeImage>(uri, 1, 0, "KubeImage"); 76 qmlRegisterType<KubeImage>(uri, 1, 0, "KubeImage");
69 qmlRegisterType<ClipboardProxy>(uri, 1, 0, "Clipboard"); 77 qmlRegisterType<ClipboardProxy>(uri, 1, 0, "Clipboard");
78 qmlRegisterSingletonType<WebEngineProfile>(uri, 1, 0, "WebEngineProfile", webengineprofile_singletontype_provider);
70} 79}