diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2018-12-24 14:11:38 +0000 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2018-12-24 14:11:38 +0000 |
commit | de49812990871e1705b64051c35161d5e6400269 (patch) | |
tree | 5e1e8fcb0ff4579dbd22a1bfee28a6b97dc8aaeb /kde-apps/akregator/files | |
parent | 536c3711867ec947c1738f2c4b96f22e4863322d (diff) |
gentoo resync : 24.12.2018
Diffstat (limited to 'kde-apps/akregator/files')
-rw-r--r-- | kde-apps/akregator/files/akregator-18.04.3-syndication.patch | 222 | ||||
-rw-r--r-- | kde-apps/akregator/files/akregator-18.12.0-qt-5.11-crashfix.patch | 81 |
2 files changed, 81 insertions, 222 deletions
diff --git a/kde-apps/akregator/files/akregator-18.04.3-syndication.patch b/kde-apps/akregator/files/akregator-18.04.3-syndication.patch deleted file mode 100644 index f20f8fffa93e..000000000000 --- a/kde-apps/akregator/files/akregator-18.04.3-syndication.patch +++ /dev/null @@ -1,222 +0,0 @@ -From d2797fe48b6d4429cd30163fd75003118400511f Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Daniel=20Vr=C3=A1til?= <dvratil@kde.org> -Date: Sun, 22 Apr 2018 09:13:45 +0200 -Subject: Port away from remove Syndication API - ---- - src/CMakeLists.txt | 1 + - src/akregator_part.cpp | 10 ------ - src/feed/feed.cpp | 3 +- - src/feed/feedretriever.cpp | 78 ++++++++++++++++++++++++++++++++++++++++++++++ - src/feed/feedretriever.h | 54 ++++++++++++++++++++++++++++++++ - 5 files changed, 135 insertions(+), 11 deletions(-) - create mode 100644 src/feed/feedretriever.cpp - create mode 100644 src/feed/feedretriever.h - -diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index 86af10e..312daee 100644 ---- a/src/CMakeLists.txt -+++ b/src/CMakeLists.txt -@@ -86,6 +86,7 @@ set(akregatorprivate_LIB_SRCS - article.cpp - feed/feed.cpp - feed/feedlist.cpp -+ feed/feedretriever.cpp - treenode.cpp - treenodevisitor.cpp - utils.cpp -diff --git a/src/akregator_part.cpp b/src/akregator_part.cpp -index 74acfab..afde53f 100644 ---- a/src/akregator_part.cpp -+++ b/src/akregator_part.cpp -@@ -259,14 +259,6 @@ Part::Part(QWidget *parentWidget, QObject *parent, const QVariantList &) - connect(m_autosaveTimer, &QTimer::timeout, this, &Part::slotSaveFeedList); - m_autosaveTimer->start(5 * 60 * 1000); // 5 minutes - -- QString useragent = QStringLiteral("Akregator/%1; syndication").arg(QStringLiteral(AKREGATOR_VERSION)); -- -- if (!Settings::customUserAgent().isEmpty()) { -- useragent = Settings::customUserAgent(); -- } -- -- Syndication::FileRetriever::setUserAgent(useragent); -- - loadPlugins(QStringLiteral("extension")); // FIXME: also unload them! - if (mCentralWidget->previousSessionCrashed()) { - mCentralWidget->needToRestoreCrashedSession(); -@@ -361,8 +353,6 @@ void Part::slotSettingsChanged() - m_actionManager->setTrayIcon(nullptr); - } - -- Syndication::FileRetriever::setUseCache(Settings::useHTMLCache()); -- - const QStringList fonts { - Settings::standardFont(), - Settings::fixedFont(), -diff --git a/src/feed/feed.cpp b/src/feed/feed.cpp -index 87ba473..774f506 100644 ---- a/src/feed/feed.cpp -+++ b/src/feed/feed.cpp -@@ -36,6 +36,7 @@ - #include "treenodevisitor.h" - #include "types.h" - #include "utils.h" -+#include "feedretriever.h" - - #include <Syndication/Syndication> - -@@ -681,7 +682,7 @@ void Akregator::Feed::tryFetch() - d->loader = Syndication::Loader::create(this, SLOT(fetchCompleted(Syndication::Loader *, - Syndication::FeedPtr, - Syndication::ErrorCode))); -- d->loader->loadFrom(QUrl(d->xmlUrl)); -+ d->loader->loadFrom(QUrl(d->xmlUrl), new FeedRetriever()); - } - - void Akregator::Feed::slotImageFetched(const QPixmap &image) -diff --git a/src/feed/feedretriever.cpp b/src/feed/feedretriever.cpp -new file mode 100644 -index 0000000..62526c4 ---- /dev/null -+++ b/src/feed/feedretriever.cpp -@@ -0,0 +1,78 @@ -+/* -+ This file is part of Akregator. -+ -+ Copyright (C) 2018 Daniel Vrátil <dvratil@kde.org> -+ -+ This program is free software; you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by -+ the Free Software Foundation; either version 2 of the License, or -+ (at your option) any later version. -+ -+ This program 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 General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with this program; if not, write to the Free Software -+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -+ -+ As a special exception, permission is given to link this program -+ with any edition of Qt, and distribute the resulting executable, -+ without including the source code for Qt in the source distribution. -+*/ -+ -+#include "feedretriever.h" -+#include "akregatorconfig.h" -+#include "akregator-version.h" -+ -+#include <KIO/StoredTransferJob> -+ -+#include <QUrl> -+ -+using namespace Akregator; -+ -+FeedRetriever::FeedRetriever() -+ : Syndication::DataRetriever() -+{ -+} -+ -+void FeedRetriever::retrieveData(const QUrl &url) -+{ -+ QString userAgent = QStringLiteral("Akregator/%1; syndication").arg(QStringLiteral(AKREGATOR_VERSION)); -+ if (!Settings::customUserAgent().isEmpty()) { -+ userAgent = Settings::customUserAgent(); -+ } -+ bool useCache = Settings::useHTMLCache(); -+ -+ auto job = KIO::storedGet(url, KIO::NoReload, KIO::HideProgressInfo); -+ job->addMetaData(QStringLiteral("UserAgent"), userAgent); -+ job->addMetaData(QStringLiteral("cache"), useCache ? QStringLiteral("refresh") : QStringLiteral("reload")); -+ connect(job, &KJob::result, this, &FeedRetriever::getFinished); -+ mJob = job; -+ mJob->start(); -+} -+ -+int FeedRetriever::errorCode() const -+{ -+ return mError; -+} -+ -+void FeedRetriever::abort() -+{ -+ if (mJob) { -+ mJob->kill(); -+ mJob = nullptr; -+ } -+} -+ -+void FeedRetriever::getFinished(KJob *job) -+{ -+ if (job->error()) { -+ mError = job->error(); -+ Q_EMIT dataRetrieved({}, false); -+ return; -+ } -+ -+ Q_EMIT dataRetrieved(static_cast<KIO::StoredTransferJob*>(job)->data(), true); -+} -diff --git a/src/feed/feedretriever.h b/src/feed/feedretriever.h -new file mode 100644 -index 0000000..3a0ff3d ---- /dev/null -+++ b/src/feed/feedretriever.h -@@ -0,0 +1,54 @@ -+/* -+ This file is part of Akregator. -+ -+ Copyright (C) 2018 Daniel Vrátil <dvratil@kde.org> -+ -+ This program is free software; you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by -+ the Free Software Foundation; either version 2 of the License, or -+ (at your option) any later version. -+ -+ This program 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 General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with this program; if not, write to the Free Software -+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -+ -+ As a special exception, permission is given to link this program -+ with any edition of Qt, and distribute the resulting executable, -+ without including the source code for Qt in the source distribution. -+*/ -+ -+#ifndef FEEDRETRIEVER_H_ -+#define FEEDRETRIEVER_H_ -+ -+#include <syndication/dataretriever.h> -+ -+class KJob; -+ -+namespace Akregator { -+ -+class FeedRetriever : public Syndication::DataRetriever -+{ -+ Q_OBJECT -+public: -+ explicit FeedRetriever(); -+ -+ void retrieveData(const QUrl &url) override; -+ void abort() override; -+ int errorCode() const override; -+ -+private Q_SLOTS: -+ void getFinished(KJob *job); -+ -+private: -+ KJob *mJob = nullptr; -+ int mError = 0; -+}; -+ -+} -+ -+#endif --- -cgit v0.11.2 diff --git a/kde-apps/akregator/files/akregator-18.12.0-qt-5.11-crashfix.patch b/kde-apps/akregator/files/akregator-18.12.0-qt-5.11-crashfix.patch new file mode 100644 index 000000000000..f13512117a90 --- /dev/null +++ b/kde-apps/akregator/files/akregator-18.12.0-qt-5.11-crashfix.patch @@ -0,0 +1,81 @@ +From 91a4ab57a82970bd75eee4a7aee61a7e1c1321ef Mon Sep 17 00:00:00 2001 +From: Andras Mantia <andras@kdab.com> +Date: Thu, 13 Dec 2018 17:32:52 +0200 +Subject: Don't crash with Qt 5.11+ + +Summary: +Based on the patch from https://bugs.kde.org/show_bug.cgi?id=371511 +See also https://bugreports.qt.io/browse/QTBUG-72260 + +BUG: 371511 + +Reviewers: PHID-PROJ-odxxyyfgujhgbu6ergrt, mlaurent + +Reviewed By: PHID-PROJ-odxxyyfgujhgbu6ergrt, mlaurent + +Subscribers: marten, asturmlechner, kfunk, kde-pim + +Tags: #kde_pim + +Differential Revision: https://phabricator.kde.org/D17563 +--- + .../webengine/articleviewerwebengine.cpp | 22 ++++++++++++++++++++++ + 1 file changed, 22 insertions(+) + +diff --git a/src/articleviewer-ng/webengine/articleviewerwebengine.cpp b/src/articleviewer-ng/webengine/articleviewerwebengine.cpp +index 2463fdf..174c09a 100644 +--- a/src/articleviewer-ng/webengine/articleviewerwebengine.cpp ++++ b/src/articleviewer-ng/webengine/articleviewerwebengine.cpp +@@ -46,6 +46,7 @@ + #include <QMenu> + #include <viewerplugintoolmanager.h> + #include <QWebEngineProfile> ++#include <QWebEngineUrlRequestInterceptor> + + #include <WebEngineViewer/WebHitTestResult> + #include <WebEngineViewer/WebHitTest> +@@ -57,6 +58,19 @@ + + using namespace Akregator; + ++class AkregatorRequestInterceptor : public QWebEngineUrlRequestInterceptor ++{ ++ Q_OBJECT ++ ++public: ++ explicit AkregatorRequestInterceptor(QObject *parent = nullptr) : QWebEngineUrlRequestInterceptor(parent) { ++ } ++ ++ void interceptRequest(QWebEngineUrlRequestInfo &info) override { ++ Q_UNUSED(info); ++ } ++}; ++ + ArticleViewerWebEngine::ArticleViewerWebEngine(KActionCollection *ac, QWidget *parent) + : WebEngineViewer::WebEngineView(parent) + , mActionCollection(ac) +@@ -64,10 +78,16 @@ ArticleViewerWebEngine::ArticleViewerWebEngine(KActionCollection *ac, QWidget *p + , mViewerPluginToolManager(nullptr) + { + mNetworkAccessManager = new WebEngineViewer::InterceptorManager(this, ac, this); ++ + QWebEngineProfile *profile = QWebEngineProfile::defaultProfile(); + mPageEngine = new ArticleViewerWebEnginePage(profile, this); + profile->setPersistentCookiesPolicy(QWebEngineProfile::ForcePersistentCookies); + ++ // Needed to workaround crash in webengine, see https://bugreports.qt.io/browse/QTBUG-72260 ++ auto webEngineUrlInterceptor = new AkregatorRequestInterceptor(); ++ profile->setRequestInterceptor(webEngineUrlInterceptor); ++ connect(profile, &QObject::destroyed, webEngineUrlInterceptor, &AkregatorRequestInterceptor::deleteLater); ++ + setPage(mPageEngine); + + connect(this, &ArticleViewerWebEngine::showContextMenu, this, &ArticleViewerWebEngine::slotShowContextMenu); +@@ -494,3 +514,5 @@ void ArticleViewerWebEngine::slotActivatePlugin(MessageViewer::ViewerPluginInter + interface->setUrl(mCurrentUrl); + interface->execute(); + } ++ ++#include "articleviewerwebengine.moc" +-- +cgit v1.1 |