forked from pool/discover
Accepting request 798238 from home:Vogtinator:plasma5.18
- Add patch to fix build against Qt 5.15: * 0001-Make-it-compile-against-qt5.15.-SkipEmptyParts-is-pa.patch OBS-URL: https://build.opensuse.org/request/show/798238 OBS-URL: https://build.opensuse.org/package/show/KDE:Frameworks5/discover?expand=0&rev=221
This commit is contained in:
parent
ab8ab37550
commit
8ab6048e84
104
0001-Make-it-compile-against-qt5.15.-SkipEmptyParts-is-pa.patch
Normal file
104
0001-Make-it-compile-against-qt5.15.-SkipEmptyParts-is-pa.patch
Normal file
@ -0,0 +1,104 @@
|
||||
From 6ef9094f6db1ee6e00d96c04ce7e8aa212fdfdab Mon Sep 17 00:00:00 2001
|
||||
From: Laurent Montel <montel@kde.org>
|
||||
Date: Wed, 4 Mar 2020 08:57:14 +0100
|
||||
Subject: [PATCH] Make it compile against qt5.15. SkipEmptyParts is part of
|
||||
Qt::.
|
||||
|
||||
---
|
||||
libdiscover/DiscoverBackendsFactory.cpp | 4 ++++
|
||||
libdiscover/appstream/AppStreamUtils.cpp | 4 ++++
|
||||
libdiscover/appstream/OdrsReviewsBackend.cpp | 12 ------------
|
||||
libdiscover/backends/KNSBackend/KNSBackend.cpp | 4 ++++
|
||||
4 files changed, 12 insertions(+), 12 deletions(-)
|
||||
|
||||
diff --git a/libdiscover/DiscoverBackendsFactory.cpp b/libdiscover/DiscoverBackendsFactory.cpp
|
||||
index ef817306..890ffef7 100644
|
||||
--- a/libdiscover/DiscoverBackendsFactory.cpp
|
||||
+++ b/libdiscover/DiscoverBackendsFactory.cpp
|
||||
@@ -122,7 +122,11 @@ void DiscoverBackendsFactory::setupCommandLine(QCommandLineParser* parser)
|
||||
|
||||
void DiscoverBackendsFactory::processCommandLine(QCommandLineParser* parser, bool test)
|
||||
{
|
||||
+#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
|
||||
QStringList backends = test ? QStringList{ QStringLiteral("dummy-backend") } : parser->value(QStringLiteral("backends")).split(QLatin1Char(','), QString::SkipEmptyParts);
|
||||
+#else
|
||||
+ QStringList backends = test ? QStringList{ QStringLiteral("dummy-backend") } : parser->value(QStringLiteral("backends")).split(QLatin1Char(','), Qt::SkipEmptyParts);
|
||||
+#endif
|
||||
for(auto &backend: backends) {
|
||||
if (!backend.endsWith(QLatin1String("-backend")))
|
||||
backend.append(QLatin1String("-backend"));
|
||||
diff --git a/libdiscover/appstream/AppStreamUtils.cpp b/libdiscover/appstream/AppStreamUtils.cpp
|
||||
index 94e62c79..9cf68099 100644
|
||||
--- a/libdiscover/appstream/AppStreamUtils.cpp
|
||||
+++ b/libdiscover/appstream/AppStreamUtils.cpp
|
||||
@@ -111,7 +111,11 @@ QStringList AppStreamUtils::appstreamIds(const QUrl &appstreamUrl)
|
||||
ret += appstreamUrl.host().isEmpty() ? appstreamUrl.path() : appstreamUrl.host();
|
||||
if (appstreamUrl.hasQuery()) {
|
||||
QUrlQuery query(appstreamUrl);
|
||||
+#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
|
||||
ret << query.queryItemValue(QStringLiteral("alt")).split(QLatin1Char(','), QString::SkipEmptyParts);
|
||||
+#else
|
||||
+ ret << query.queryItemValue(QStringLiteral("alt")).split(QLatin1Char(','), Qt::SkipEmptyParts);
|
||||
+#endif
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
diff --git a/libdiscover/appstream/OdrsReviewsBackend.cpp b/libdiscover/appstream/OdrsReviewsBackend.cpp
|
||||
index 3d6c7981..15eb7deb 100644
|
||||
--- a/libdiscover/appstream/OdrsReviewsBackend.cpp
|
||||
+++ b/libdiscover/appstream/OdrsReviewsBackend.cpp
|
||||
@@ -142,11 +142,7 @@ void OdrsReviewsBackend::reviewsFetched()
|
||||
QNetworkReply* reply = qobject_cast<QNetworkReply*>(sender());
|
||||
QScopedPointer<QNetworkReply, QScopedPointerDeleteLater> replyPtr(reply);
|
||||
const QByteArray data = reply->readAll();
|
||||
-#if (QT_VERSION < QT_VERSION_CHECK(5, 15, 0))
|
||||
const auto networkError = reply->error();
|
||||
-#else
|
||||
- const auto networkError = reply->networkError();
|
||||
-#endif
|
||||
if (networkError != QNetworkReply::NoError) {
|
||||
qCWarning(LIBDISCOVER_LOG) << "error fetching reviews:" << reply->errorString() << data;
|
||||
m_isFetching = false;
|
||||
@@ -189,11 +185,7 @@ void OdrsReviewsBackend::submitUsefulness(Review *review, bool useful)
|
||||
void OdrsReviewsBackend::usefulnessSubmitted()
|
||||
{
|
||||
QNetworkReply* reply = qobject_cast<QNetworkReply*>(sender());
|
||||
-#if (QT_VERSION < QT_VERSION_CHECK(5, 15, 0))
|
||||
const auto networkError = reply->error();
|
||||
-#else
|
||||
- const auto networkError = reply->networkError();
|
||||
-#endif
|
||||
if (networkError == QNetworkReply::NoError) {
|
||||
qCWarning(LIBDISCOVER_LOG) << "Usefulness submitted";
|
||||
} else {
|
||||
@@ -239,11 +231,7 @@ void OdrsReviewsBackend::submitReview(AbstractResource *res, const QString &summ
|
||||
|
||||
void OdrsReviewsBackend::reviewSubmitted(QNetworkReply *reply)
|
||||
{
|
||||
-#if (QT_VERSION < QT_VERSION_CHECK(5, 15, 0))
|
||||
const auto networkError = reply->error();
|
||||
-#else
|
||||
- const auto networkError = reply->networkError();
|
||||
-#endif
|
||||
if (networkError == QNetworkReply::NoError) {
|
||||
AbstractResource *resource = qobject_cast<AbstractResource*>(reply->request().originatingObject());
|
||||
qCWarning(LIBDISCOVER_LOG) << "Review submitted" << resource;
|
||||
diff --git a/libdiscover/backends/KNSBackend/KNSBackend.cpp b/libdiscover/backends/KNSBackend/KNSBackend.cpp
|
||||
index 278d5e2d..d4cf5dba 100644
|
||||
--- a/libdiscover/backends/KNSBackend/KNSBackend.cpp
|
||||
+++ b/libdiscover/backends/KNSBackend/KNSBackend.cpp
|
||||
@@ -554,7 +554,11 @@ ResultsStream * KNSBackend::findResourceByPackageName(const QUrl& search)
|
||||
if (search.scheme() != QLatin1String("kns") || search.host() != name())
|
||||
return voidStream();
|
||||
|
||||
+#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
|
||||
const auto pathParts = search.path().split(QLatin1Char('/'), QString::SkipEmptyParts);
|
||||
+#else
|
||||
+ const auto pathParts = search.path().split(QLatin1Char('/'), Qt::SkipEmptyParts);
|
||||
+#endif
|
||||
if (pathParts.size() != 2) {
|
||||
Q_EMIT passiveMessage(i18n("Wrong KNewStuff URI: %1", search.toString()));
|
||||
return voidStream();
|
||||
--
|
||||
2.25.1
|
||||
|
@ -1,3 +1,9 @@
|
||||
-------------------------------------------------------------------
|
||||
Mon Apr 27 12:26:09 UTC 2020 - Fabian Vogt <fabian@ritter-vogt.de>
|
||||
|
||||
- Add patch to fix build against Qt 5.15:
|
||||
* 0001-Make-it-compile-against-qt5.15.-SkipEmptyParts-is-pa.patch
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Apr 10 07:58:49 UTC 2020 - Wolfgang Bauer <wbauer@tmo.at>
|
||||
|
||||
|
@ -31,6 +31,8 @@ Source2: plasma.keyring
|
||||
%endif
|
||||
# PATCH-FIX-OPENSUSE
|
||||
Patch1: 0001-Warning-for-FlatHub.patch
|
||||
# PATCH-FIX-UPSTREAM
|
||||
Patch2: 0001-Make-it-compile-against-qt5.15.-SkipEmptyParts-is-pa.patch
|
||||
BuildRequires: cmake >= 2.8.12
|
||||
BuildRequires: extra-cmake-modules
|
||||
BuildRequires: flatpak-devel
|
||||
|
Loading…
x
Reference in New Issue
Block a user