forked from pool/discover
- Add patch to show an informative warning when adding FlatHub:
* 0001-Warning-for-FlatHub.patch OBS-URL: https://build.opensuse.org/package/show/KDE:Frameworks5/discover?expand=0&rev=125
This commit is contained in:
parent
24dd2f1fc4
commit
8706c2bcb7
44
0001-Warning-for-FlatHub.patch
Normal file
44
0001-Warning-for-FlatHub.patch
Normal file
@ -0,0 +1,44 @@
|
||||
From 74a4eff529e6b71f6a822841d9112d9b71b44d24 Mon Sep 17 00:00:00 2001
|
||||
From: Fabian Vogt <fabian@ritter-vogt.de>
|
||||
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 <KLocalizedString>
|
||||
#include <QDebug>
|
||||
+#include <QAbstractButton>
|
||||
+#include <QMessageBox>
|
||||
#include <QNetworkAccessManager>
|
||||
#include <QNetworkReply>
|
||||
#include <QAction>
|
||||
@@ -57,7 +59,17 @@ FlatpakSourcesBackend::FlatpakSourcesBackend(const QVector<FlatpakInstallation *
|
||||
|
||||
m_flathubAction->setToolTip(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
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user