From 9a6abe17e0676acd6deb9a13ab6f8e549de987cc Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Mon, 16 Jul 2018 11:08:11 +0200 Subject: Removed the unused webengineprofile --- framework/src/CMakeLists.txt | 1 - framework/src/frameworkplugin.cpp | 9 ------- framework/src/webengineprofile.cpp | 52 -------------------------------------- framework/src/webengineprofile.h | 30 ---------------------- 4 files changed, 92 deletions(-) delete mode 100644 framework/src/webengineprofile.cpp delete mode 100644 framework/src/webengineprofile.h 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 kubeimage.cpp clipboardproxy.cpp krecursivefilterproxymodel.cpp - webengineprofile.cpp startupcheck.cpp keyring.cpp 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 @@ #include "fabric.h" #include "kubeimage.h" #include "clipboardproxy.h" -#include "webengineprofile.h" #include "startupcheck.h" #include "keyring.h" #include "controller.h" @@ -98,13 +97,6 @@ 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; -} - static QObject *keyring_singletontype_provider(QQmlEngine *engine, QJSEngine *scriptEngine) { Q_UNUSED(engine) @@ -196,6 +188,5 @@ void FrameworkPlugin::registerTypes (const char *uri) qmlRegisterType(uri, 1, 0, "Clipboard"); qmlRegisterType(uri, 1, 0, "StartupCheck"); qmlRegisterType(uri, 1, 0, "ViewHighlighter"); - qmlRegisterSingletonType(uri, 1, 0, "WebEngineProfile", webengineprofile_singletontype_provider); qmlRegisterSingletonType(uri, 1, 0, "Keyring", keyring_singletontype_provider); } 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 @@ - -/* - Copyright (c) 2017 Christian Mollekopf - - This library is free software; you can redistribute it and/or modify it - under the terms of the GNU Library General Public License as published by - the Free Software Foundation; either version 2 of the License, or (at your - option) any later version. - - This library is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public - License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to the - Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA - 02110-1301, USA. -*/ - -#include "webengineprofile.h" - -#include -#include -#include - -class WebUrlRequestInterceptor : public QWebEngineUrlRequestInterceptor -{ - Q_OBJECT -public: - WebUrlRequestInterceptor(QObject *p = Q_NULLPTR) : QWebEngineUrlRequestInterceptor{p} - {} - - void interceptRequest(QWebEngineUrlRequestInfo &info) Q_DECL_OVERRIDE - { - qDebug() << info.requestMethod() << info.requestUrl() << info.resourceType() << info.navigationType(); - const bool isNavigationRequest = info.resourceType() == QWebEngineUrlRequestInfo::ResourceTypeMainFrame; - if (isNavigationRequest) { - QDesktopServices::openUrl(info.requestUrl()); - info.block(true); - } - //TODO handle mailto to open a composer - } -}; - -WebEngineProfile::WebEngineProfile(QObject *parent) - : QQuickWebEngineProfile(parent) -{ - setRequestInterceptor(new WebUrlRequestInterceptor(this)); -} - -#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 @@ -/* - Copyright (c) 2017 Christian Mollekopf - - This library is free software; you can redistribute it and/or modify it - under the terms of the GNU Library General Public License as published by - the Free Software Foundation; either version 2 of the License, or (at your - option) any later version. - - This library is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public - License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to the - Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA - 02110-1301, USA. -*/ -#pragma once - -#include "kube_export.h" -#include - -class KUBE_EXPORT WebEngineProfile : public QQuickWebEngineProfile -{ - Q_OBJECT -public: - WebEngineProfile(QObject *parent = nullptr); -}; - -- cgit v1.2.3