summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2018-07-16 11:08:11 +0200
committerChristian Mollekopf <chrigi_1@fastmail.fm>2018-07-16 11:08:11 +0200
commit9a6abe17e0676acd6deb9a13ab6f8e549de987cc (patch)
treeb2e04e9495fafe52c33dddbf96b1de51e123721b
parentcd087aad3182b7cd34f5a45cee4864cf54a69057 (diff)
downloadkube-9a6abe17e0676acd6deb9a13ab6f8e549de987cc.tar.gz
kube-9a6abe17e0676acd6deb9a13ab6f8e549de987cc.zip
Removed the unused webengineprofile
-rw-r--r--framework/src/CMakeLists.txt1
-rw-r--r--framework/src/frameworkplugin.cpp9
-rw-r--r--framework/src/webengineprofile.cpp52
-rw-r--r--framework/src/webengineprofile.h30
4 files changed, 0 insertions, 92 deletions
diff --git a/framework/src/CMakeLists.txt b/framework/src/CMakeLists.txt
index b6b2d600..46ec3105 100644
--- a/framework/src/CMakeLists.txt
+++ b/framework/src/CMakeLists.txt
@@ -47,7 +47,6 @@ add_library(kubeframework SHARED
47 kubeimage.cpp 47 kubeimage.cpp
48 clipboardproxy.cpp 48 clipboardproxy.cpp
49 krecursivefilterproxymodel.cpp 49 krecursivefilterproxymodel.cpp
50 webengineprofile.cpp
51 startupcheck.cpp 50 startupcheck.cpp
52 keyring.cpp 51 keyring.cpp
53 domainobjectcontroller.cpp 52 domainobjectcontroller.cpp
diff --git a/framework/src/frameworkplugin.cpp b/framework/src/frameworkplugin.cpp
index 9c81b7e1..72e9730b 100644
--- a/framework/src/frameworkplugin.cpp
+++ b/framework/src/frameworkplugin.cpp
@@ -38,7 +38,6 @@
38#include "fabric.h" 38#include "fabric.h"
39#include "kubeimage.h" 39#include "kubeimage.h"
40#include "clipboardproxy.h" 40#include "clipboardproxy.h"
41#include "webengineprofile.h"
42#include "startupcheck.h" 41#include "startupcheck.h"
43#include "keyring.h" 42#include "keyring.h"
44#include "controller.h" 43#include "controller.h"
@@ -98,13 +97,6 @@ static QObject *fabric_singletontype_provider(QQmlEngine *engine, QJSEngine *scr
98 return new Kube::Fabric::Fabric; 97 return new Kube::Fabric::Fabric;
99} 98}
100 99
101static QObject *webengineprofile_singletontype_provider(QQmlEngine *engine, QJSEngine *scriptEngine)
102{
103 Q_UNUSED(engine)
104 Q_UNUSED(scriptEngine)
105 return new WebEngineProfile;
106}
107
108static QObject *keyring_singletontype_provider(QQmlEngine *engine, QJSEngine *scriptEngine) 100static QObject *keyring_singletontype_provider(QQmlEngine *engine, QJSEngine *scriptEngine)
109{ 101{
110 Q_UNUSED(engine) 102 Q_UNUSED(engine)
@@ -196,6 +188,5 @@ void FrameworkPlugin::registerTypes (const char *uri)
196 qmlRegisterType<ClipboardProxy>(uri, 1, 0, "Clipboard"); 188 qmlRegisterType<ClipboardProxy>(uri, 1, 0, "Clipboard");
197 qmlRegisterType<StartupCheck>(uri, 1, 0, "StartupCheck"); 189 qmlRegisterType<StartupCheck>(uri, 1, 0, "StartupCheck");
198 qmlRegisterType<ViewHighlighter>(uri, 1, 0, "ViewHighlighter"); 190 qmlRegisterType<ViewHighlighter>(uri, 1, 0, "ViewHighlighter");
199 qmlRegisterSingletonType<WebEngineProfile>(uri, 1, 0, "WebEngineProfile", webengineprofile_singletontype_provider);
200 qmlRegisterSingletonType<Kube::Keyring>(uri, 1, 0, "Keyring", keyring_singletontype_provider); 191 qmlRegisterSingletonType<Kube::Keyring>(uri, 1, 0, "Keyring", keyring_singletontype_provider);
201} 192}
diff --git a/framework/src/webengineprofile.cpp b/framework/src/webengineprofile.cpp
deleted file mode 100644
index d63bacb3..00000000
--- a/framework/src/webengineprofile.cpp
+++ /dev/null
@@ -1,52 +0,0 @@
1
2/*
3 Copyright (c) 2017 Christian Mollekopf <mollekopf@kolabsys.com>
4
5 This library is free software; you can redistribute it and/or modify it
6 under the terms of the GNU Library General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or (at your
8 option) any later version.
9
10 This library is distributed in the hope that it will be useful, but WITHOUT
11 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
13 License for more details.
14
15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to the
17 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18 02110-1301, USA.
19*/
20
21#include "webengineprofile.h"
22
23#include <QWebEngineUrlRequestInterceptor>
24#include <QDebug>
25#include <QDesktopServices>
26
27class WebUrlRequestInterceptor : public QWebEngineUrlRequestInterceptor
28{
29 Q_OBJECT
30public:
31 WebUrlRequestInterceptor(QObject *p = Q_NULLPTR) : QWebEngineUrlRequestInterceptor{p}
32 {}
33
34 void interceptRequest(QWebEngineUrlRequestInfo &info) Q_DECL_OVERRIDE
35 {
36 qDebug() << info.requestMethod() << info.requestUrl() << info.resourceType() << info.navigationType();
37 const bool isNavigationRequest = info.resourceType() == QWebEngineUrlRequestInfo::ResourceTypeMainFrame;
38 if (isNavigationRequest) {
39 QDesktopServices::openUrl(info.requestUrl());
40 info.block(true);
41 }
42 //TODO handle mailto to open a composer
43 }
44};
45
46WebEngineProfile::WebEngineProfile(QObject *parent)
47 : QQuickWebEngineProfile(parent)
48{
49 setRequestInterceptor(new WebUrlRequestInterceptor(this));
50}
51
52#include "webengineprofile.moc"
diff --git a/framework/src/webengineprofile.h b/framework/src/webengineprofile.h
deleted file mode 100644
index 3a58e23c..00000000
--- a/framework/src/webengineprofile.h
+++ /dev/null
@@ -1,30 +0,0 @@
1/*
2 Copyright (c) 2017 Christian Mollekopf <mollekopf@kolabsys.com>
3
4 This library is free software; you can redistribute it and/or modify it
5 under the terms of the GNU Library General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or (at your
7 option) any later version.
8
9 This library is distributed in the hope that it will be useful, but WITHOUT
10 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
12 License for more details.
13
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to the
16 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17 02110-1301, USA.
18*/
19#pragma once
20
21#include "kube_export.h"
22#include <QQuickWebEngineProfile>
23
24class KUBE_EXPORT WebEngineProfile : public QQuickWebEngineProfile
25{
26 Q_OBJECT
27public:
28 WebEngineProfile(QObject *parent = nullptr);
29};
30