From ba63aeaa94b39dba077daa8b048e816ebd6104fc46e2812d8a55c7c0aaa701a2 Mon Sep 17 00:00:00 2001 From: Christophe Giboudeaux Date: Mon, 28 Jun 2021 07:47:14 +0000 Subject: [PATCH 1/2] --qtwebkit OBS-URL: https://build.opensuse.org/package/show/KDE:Applications/umbrello?expand=0&rev=164 --- ...age-in-WelcomePage-optional-with-QTe.patch | 135 ++++++++++++++++++ umbrello.changes | 6 + umbrello.spec | 3 +- 3 files changed, 143 insertions(+), 1 deletion(-) create mode 100644 0001-Make-QtWebKit-usage-in-WelcomePage-optional-with-QTe.patch diff --git a/0001-Make-QtWebKit-usage-in-WelcomePage-optional-with-QTe.patch b/0001-Make-QtWebKit-usage-in-WelcomePage-optional-with-QTe.patch new file mode 100644 index 0000000..30bd969 --- /dev/null +++ b/0001-Make-QtWebKit-usage-in-WelcomePage-optional-with-QTe.patch @@ -0,0 +1,135 @@ +From 54f1a640704f088645763663d4004ad567689630 Mon Sep 17 00:00:00 2001 +From: Andreas Sturmlechner +Date: Mon, 12 Oct 2020 11:46:24 +0200 +Subject: [PATCH] Make QtWebKit usage in WelcomePage optional, with + QTextBrowser fallback + +Thanks-to: Ralf Habacker for QTextBrowser fallback code. + +Signed-off-by: Andreas Sturmlechner +--- + CMakeLists.txt | 7 ++++++- + cmake/modules/ECMKDE4Macros.cmake | 7 ++++++- + umbrello/CMakeLists.txt | 8 ++++++-- + umbrello/umlappprivate.h | 13 +++++++++++++ + 4 files changed, 31 insertions(+), 4 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index d98036c..59873cd 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -102,9 +102,14 @@ find_package(Qt5 ${QT_MIN_VERSION} REQUIRED COMPONENTS + Test + Widgets + Xml +- WebKitWidgets + ) + ++find_package(Qt5WebKitWidgets ${QT_MIN_VERSION}) ++if(Qt5WebKitWidgets_FOUND) ++ add_definitions(-DWEBKIT_WELCOMEPAGE) ++ set(WEBKIT_WELCOMEPAGE 1) ++endif() ++ + # search packages used by KDE + find_package(KF5 REQUIRED COMPONENTS + Archive +diff --git a/cmake/modules/ECMKDE4Macros.cmake b/cmake/modules/ECMKDE4Macros.cmake +index 3de4722..e1a31b4 100644 +--- a/cmake/modules/ECMKDE4Macros.cmake ++++ b/cmake/modules/ECMKDE4Macros.cmake +@@ -106,7 +106,12 @@ macro(find_package package) + #message("-- ${ARGV} --") + if("${package}" MATCHES "^(Qt5)") + #message("-- replaced by finding Qt4 --") +- _find_package(Qt4 4.4.3 REQUIRED QtCore QtGui QtXml QtTest QtWebKit) ++ _find_package(Qt4 4.4.3 REQUIRED QtCore QtGui QtXml QtTest) ++ _find_package(Qt4QtWebKit 4.4.3) ++ if(Qt4QtWebKit_FOUND) ++ add_definitions(-DWEBKIT_WELCOMEPAGE) ++ set(WEBKIT_WELCOMEPAGE 1) ++ endif() + elseif("${package}" MATCHES "^(KF5)$") + #message("-- replaced by finding KDE4 --") + _find_package(KDE4 REQUIRED) +diff --git a/umbrello/CMakeLists.txt b/umbrello/CMakeLists.txt +index 4a21685..56ae7d8 100644 +--- a/umbrello/CMakeLists.txt ++++ b/umbrello/CMakeLists.txt +@@ -525,13 +525,15 @@ if(NOT BUILD_KF5) + Qt4::QtCore + Qt4::QtGui + Qt4::QtXml +- Qt4::QtWebKit + ${LIBXML2_LIBRARIES} + ${LIBXSLT_LIBRARIES} + ${KDE4_KTEXTEDITOR_LIBS} + ${KDE4_KFILE_LIBS} + codeimport + ) ++ if(WEBKIT_WELCOMEPAGE) ++ target_link_libraries(libumbrello Qt4::QtWebKit) ++ endif() + + kde4_add_app_icon(umbrello_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/pics/global/hi*-apps-umbrello.png") + kde4_add_executable(umbrello ${umbrello_SRCS}) +@@ -549,7 +551,6 @@ else() + Qt5::Xml + Qt5::PrintSupport + Qt5::Svg +- Qt5::WebKitWidgets + KF5::Archive + KF5::Completion + KF5::CoreAddons +@@ -565,6 +566,9 @@ else() + ${LIBXML2_LIBRARIES} + codeimport + ) ++ if(WEBKIT_WELCOMEPAGE) ++ target_link_libraries(libumbrello Qt5::WebKitWidgets) ++ endif() + ecm_add_app_icon(umbrello_SRCS + ICONS + ${CMAKE_CURRENT_SOURCE_DIR}/pics/global/16-apps-umbrello.png +diff --git a/umbrello/umlappprivate.h b/umbrello/umlappprivate.h +index a85de1f..a7212cc 100644 +--- a/umbrello/umlappprivate.h ++++ b/umbrello/umlappprivate.h +@@ -42,7 +42,11 @@ + #include + #include + #include ++#ifdef WEBKIT_WELCOMEPAGE + #include ++#else ++#include ++#endif + + class QWidget; + +@@ -160,6 +164,7 @@ public slots: + // qDebug() << html; + welcomeWindow = new QDockWidget(i18n("Welcome"), parent); + welcomeWindow->setObjectName(QLatin1String("WelcomeDock")); ++#ifdef WEBKIT_WELCOMEPAGE + QWebView *view = new QWebView; + view->page()->setLinkDelegationPolicy(QWebPage::DelegateAllLinks); + view->setContextMenuPolicy(Qt::NoContextMenu); +@@ -167,6 +172,14 @@ public slots: + view->setHtml(html); + view->show(); + welcomeWindow->setWidget(view); ++#else ++ QTextBrowser *tb = new QTextBrowser(dynamic_cast(this)); ++ tb->setOpenExternalLinks(true); ++ tb->setOpenLinks(false); ++ tb->setHtml(html); ++ connect(tb, SIGNAL(anchorClicked(const QUrl)), this, SLOT(slotWelcomeWindowLinkClicked(const QUrl))); ++ welcomeWindow->setWidget(tb); ++#endif + parent->addDockWidget(Qt::RightDockWidgetArea, welcomeWindow); + + viewWelcomeWindow = parent->actionCollection()->add(QLatin1String("view_show_welcome")); +-- +2.32.0 + diff --git a/umbrello.changes b/umbrello.changes index 55d20b1..cdad64c 100644 --- a/umbrello.changes +++ b/umbrello.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Mon Jun 28 07:46:19 UTC 2021 - Christophe Giboudeaux + +- Add patch to get rid of the QtWebKit dependency: + * 0001-Make-QtWebKit-usage-in-WelcomePage-optional-with-QTe.patch + ------------------------------------------------------------------- Tue Jun 8 12:41:31 UTC 2021 - Christophe Giboudeaux diff --git a/umbrello.spec b/umbrello.spec index def2586..ce71687 100644 --- a/umbrello.spec +++ b/umbrello.spec @@ -32,6 +32,8 @@ Source: https://download.kde.org/stable/release-service/%{version}/src/% Source1: https://download.kde.org/stable/release-service/%{version}/src/%{name}-%{version}.tar.xz.sig Source2: applications.keyring %endif +# PATCH-FIX-UPSTREAM +Patch0: 0001-Make-QtWebKit-usage-in-WelcomePage-optional-with-QTe.patch BuildRequires: extra-cmake-modules BuildRequires: kdevelop5-pg-qt BuildRequires: kdevplatform-devel @@ -60,7 +62,6 @@ BuildRequires: cmake(Qt5Gui) BuildRequires: cmake(Qt5PrintSupport) BuildRequires: cmake(Qt5Svg) BuildRequires: cmake(Qt5Test) -BuildRequires: cmake(Qt5WebKitWidgets) BuildRequires: cmake(Qt5Widgets) BuildRequires: cmake(Qt5Xml) Recommends: %{name}-lang From 93d679c006572b771c81849e4396199130970da5ee180c30b39d88a3d6a7add6 Mon Sep 17 00:00:00 2001 From: Christophe Giboudeaux Date: Mon, 28 Jun 2021 07:56:32 +0000 Subject: [PATCH 2/2] OBS-URL: https://build.opensuse.org/package/show/KDE:Applications/umbrello?expand=0&rev=165 --- ...usage-in-WelcomePage-optional-with-QTe.patch | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/0001-Make-QtWebKit-usage-in-WelcomePage-optional-with-QTe.patch b/0001-Make-QtWebKit-usage-in-WelcomePage-optional-with-QTe.patch index 30bd969..f7b5207 100644 --- a/0001-Make-QtWebKit-usage-in-WelcomePage-optional-with-QTe.patch +++ b/0001-Make-QtWebKit-usage-in-WelcomePage-optional-with-QTe.patch @@ -1,4 +1,4 @@ -From 54f1a640704f088645763663d4004ad567689630 Mon Sep 17 00:00:00 2001 +From bc20a61b530b39a4a0dde9fd69a46fb4b3f27585 Mon Sep 17 00:00:00 2001 From: Andreas Sturmlechner Date: Mon, 12 Oct 2020 11:46:24 +0200 Subject: [PATCH] Make QtWebKit usage in WelcomePage optional, with @@ -12,7 +12,8 @@ Signed-off-by: Andreas Sturmlechner cmake/modules/ECMKDE4Macros.cmake | 7 ++++++- umbrello/CMakeLists.txt | 8 ++++++-- umbrello/umlappprivate.h | 13 +++++++++++++ - 4 files changed, 31 insertions(+), 4 deletions(-) + unittests/CMakeLists.txt | 1 - + 5 files changed, 31 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d98036c..59873cd 100644 @@ -130,6 +131,18 @@ index a85de1f..a7212cc 100644 parent->addDockWidget(Qt::RightDockWidgetArea, welcomeWindow); viewWelcomeWindow = parent->actionCollection()->add(QLatin1String("view_show_welcome")); +diff --git a/unittests/CMakeLists.txt b/unittests/CMakeLists.txt +index 08cd43a..e96659f 100644 +--- a/unittests/CMakeLists.txt ++++ b/unittests/CMakeLists.txt +@@ -60,7 +60,6 @@ else() + Qt5::Xml + Qt5::Test + Qt5::Widgets +- Qt5::WebKitWidgets + KF5::I18n + KF5::Crash + ${LIBXML2_LIBRARIES} -- 2.32.0