diff --git a/0001-Warning-for-FlatHub.patch b/0001-Warning-for-FlatHub.patch new file mode 100644 index 0000000..d277510 --- /dev/null +++ b/0001-Warning-for-FlatHub.patch @@ -0,0 +1,44 @@ +From 74a4eff529e6b71f6a822841d9112d9b71b44d24 Mon Sep 17 00:00:00 2001 +From: Fabian Vogt +Date: Sat, 13 Jan 2018 15:16:39 +0100 +Subject: [PATCH] Warning for FlatHub + +--- + .../backends/FlatpakBackend/FlatpakSourcesBackend.cpp | 14 +++++++++++++- + 1 file changed, 13 insertions(+), 1 deletion(-) + +diff --git a/libdiscover/backends/FlatpakBackend/FlatpakSourcesBackend.cpp b/libdiscover/backends/FlatpakBackend/FlatpakSourcesBackend.cpp +index e96dd5bc..77646179 100644 +--- a/libdiscover/backends/FlatpakBackend/FlatpakSourcesBackend.cpp ++++ b/libdiscover/backends/FlatpakBackend/FlatpakSourcesBackend.cpp +@@ -24,6 +24,8 @@ + #include "FlatpakBackend.h" + #include + #include ++#include ++#include + #include + #include + #include +@@ -57,7 +59,17 @@ FlatpakSourcesBackend::FlatpakSourcesBackend(const QVectorsetToolTip(QStringLiteral("flathub")); + connect(m_flathubAction, &QAction::triggered, this, [this](){ +- addSource(QStringLiteral("https://flathub.org/repo/flathub.flatpakrepo")); ++ auto *warnBox = new QMessageBox(QMessageBox::Information, i18n("Adding a third-party source"), ++ i18n("FlatHub is not part of the openSUSE distribution.\n" ++ "It contains packages of unknown quality which might not be tested to work correctly " ++ "on openSUSE. Prefer to install software from the official openSUSE repository."), ++ QMessageBox::Ok | QMessageBox::Abort); ++ connect(warnBox, &QMessageBox::buttonClicked, this, [this, warnBox](QAbstractButton *button) { ++ if (warnBox->standardButton(button) == QMessageBox::Ok) ++ addSource(QStringLiteral("https://flathub.org/repo/flathub.flatpakrepo")); ++ }); ++ warnBox->setAttribute(Qt::WA_DeleteOnClose); ++ warnBox->show(); + }); + for (auto installation : installations) { + if (!listRepositories(installation)) { +-- +2.16.2 + diff --git a/discover.changes b/discover.changes index ab6fa8e..c9b1860 100644 --- a/discover.changes +++ b/discover.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Fri Mar 23 20:42:00 UTC 2018 - fabian@ritter-vogt.de + +- Add patch to show an informative warning when adding FlatHub: + * 0001-Warning-for-FlatHub.patch + ------------------------------------------------------------------- Tue Mar 6 16:07:11 CET 2018 - fabian@ritter-vogt.de diff --git a/discover.spec b/discover.spec index 0070277..4dc6ec2 100644 --- a/discover.spec +++ b/discover.spec @@ -25,6 +25,8 @@ License: GPL-2.0 and GPL-3.0 and GPL-3.0+ Group: System/GUI/KDE Url: https://quickgit.kde.org/?p=discover.git Source: http://download.kde.org/stable/plasma/%{version}/discover-%{version}.tar.xz +# PATCH-FIX-OPENSUSE +Patch1: 0001-Warning-for-FlatHub.patch %if 0%{?suse_version} < 1330 # It does not build with the default compiler (GCC 4.8) on Leap 42.x %if 0%{?sle_version} < 120300 @@ -96,6 +98,7 @@ This is the systray plasmoid to notify the user that updates are available %prep %setup -q +%autopatch -p1 %build %if 0%{?suse_version} < 1330