summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Sturmlechner <asturm@gentoo.org>2021-10-03 13:18:46 +0200
committerAndreas Sturmlechner <asturm@gentoo.org>2021-10-03 13:45:50 +0200
commitc322214967d93dd6ad80fa992366f5a1177fa7f0 (patch)
tree05ca58b427247871cc1402be10d789a903a02fd7 /kde-apps/konqueror
parentsys-process/acct: drop 6.6.4-r1 (diff)
downloadgentoo-c322214967d93dd6ad80fa992366f5a1177fa7f0.tar.gz
gentoo-c322214967d93dd6ad80fa992366f5a1177fa7f0.tar.bz2
gentoo-c322214967d93dd6ad80fa992366f5a1177fa7f0.zip
kde-apps/konqueror: Fix compatibility with KDE Frameworks 5.86
Closes: https://bugs.gentoo.org/815022 Package-Manager: Portage-3.0.26, Repoman-3.0.3 Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
Diffstat (limited to 'kde-apps/konqueror')
-rw-r--r--kde-apps/konqueror/files/konqueror-21.04.3-kf-5.86-compat.patch250
-rw-r--r--kde-apps/konqueror/konqueror-21.04.3-r2.ebuild91
-rw-r--r--kde-apps/konqueror/konqueror-21.08.1-r2.ebuild92
3 files changed, 433 insertions, 0 deletions
diff --git a/kde-apps/konqueror/files/konqueror-21.04.3-kf-5.86-compat.patch b/kde-apps/konqueror/files/konqueror-21.04.3-kf-5.86-compat.patch
new file mode 100644
index 000000000000..0814c335a734
--- /dev/null
+++ b/kde-apps/konqueror/files/konqueror-21.04.3-kf-5.86-compat.patch
@@ -0,0 +1,250 @@
+From 6a46c0c8701fbde143a33e4be61f198e98f53c10 Mon Sep 17 00:00:00 2001
+From: David Faure <faure@kde.org>
+Date: Sun, 19 Sep 2021 12:03:46 +0200
+Subject: [PATCH 1/5] Don't open HTTP URLs in another browser than Konqueror,
+ from Konqueror
+
+From 8506c585594d9d0cfc0ebe8b869ca05ff7610fa7 Mon Sep 17 00:00:00 2001
+From: Stefano Crocco <stefano.crocco@alice.it>
+Date: Sun, 19 Sep 2021 20:56:38 +0200
+Subject: [PATCH 2/5] Make Konqueror compatible with KIO 5.86.0
+
+Due to a change in KIO::DesktopExecParser::hasSchemeHandler (commit
+5fa55a2395cbfb6504e56bf71c869c8e49902e13Q) URLs entered in the
+navigation bar either were always opened in a new tab or they were
+opened in another program altogether (for example, man and info URLs).
+
+To fix this issue, it has been necessary to copy the implementation of
+KRun::init and KParts::BrowserRun::init in KonqRun::init, making the
+necessary changes to restore the old behaviour.
+
+(cherry picked from commit ba1ea2b74f77832d2a26bb74fed18970eeadf301)
+
+From ec995b8091e97750c12e8e543d298a7a56045d41 Mon Sep 17 00:00:00 2001
+From: Stefano Crocco <stefano.crocco@alice.it>
+Date: Sun, 19 Sep 2021 22:01:30 +0200
+Subject: [PATCH 3/5] Fix signature and avoid calling url() repeatedly
+
+(cherry picked from commit 0326d9b8553a7c33d0c1498ca4c0199cc2344e15)
+
+From d368615b28a97993ce53691731f5152f044f98a2 Mon Sep 17 00:00:00 2001
+From: Stefano Crocco <stefano.crocco@alice.it>
+Date: Sun, 19 Sep 2021 22:47:03 +0200
+Subject: [PATCH 4/5] Add a comment explaining the interaction with
+ WebEnginePart
+
+(cherry picked from commit 5c4b0456af2a534c65c60b16add4012566309fb9)
+
+From 036fdfe1666294e5388803eb8877971362347428 Mon Sep 17 00:00:00 2001
+From: Andreas Sturmlechner <asturm@gentoo.org>
+Date: Thu, 30 Sep 2021 13:58:28 +0200
+Subject: [PATCH 5/5] Replace handleInitError with KParts::BrowserRun::init
+
+Avoids breaking string freeze.
+
+Thanks-to: Stefano Crocco <stefano.crocco@alice.it>
+Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
+
+BUG: 442636
+---
+
+diff --git a/src/konqrun.cpp b/src/konqrun.cpp
+index 8bfc22285..4415c67c4 100644
+--- a/src/konqrun.cpp
++++ b/src/konqrun.cpp
+@@ -27,8 +27,17 @@
+ #include <kio/job.h>
+ #include <QMimeDatabase>
+ #include <QMimeType>
++#include <QHostInfo>
++#include <QFileInfo>
++
+ #include <KIO/ApplicationLauncherJob>
+ #include <KIO/JobUiDelegate>
++#include <KUrlAuthorized>
++#include <KIO/DesktopExecParser>
++#include <KProtocolInfo>
++#include <KProtocolManager>
++#include <KApplicationTrader>
++#include <KJobWidgets>
+
+ #include <KService>
+ #include <KMimeTypeTrader>
+@@ -48,8 +57,9 @@ KonqRun::KonqRun(KonqMainWindow *mainWindow, KonqView *_childView,
+ // Don't use inline errors on reloading due to auto-refresh sites, but use them in all other cases
+ // (no reload or user-requested reload)
+ !req.args.reload() || req.userRequestedReload),
+- m_pMainWindow(mainWindow), m_pView(_childView), m_bFoundMimeType(false), m_req(req)
++ m_pMainWindow(mainWindow), m_pView(_childView), m_bFoundMimeType(false), m_req(req), m_inlineErrors(!req.args.reload() || req.userRequestedReload)
+ {
++ setEnableExternalBrowser(false);
+ //qCDebug(KONQUEROR_LOG) << "KonqRun::KonqRun() " << this;
+ Q_ASSERT(!m_pMainWindow.isNull());
+ if (m_pView) {
+@@ -188,15 +198,124 @@ void KonqRun::handleError(KJob *job)
+ KParts::BrowserRun::handleError(job);
+ }
+
++//Code copied from browserrun.cpp
++void KonqRun::switchToErrorUrl(KIO::Error error, const QString &stringUrl)
++{
++ KRun::setUrl(makeErrorUrl(error, stringUrl, url()));
++ setJob(nullptr);
++ mimeTypeDetermined(QStringLiteral("text/html"));
++}
++
++//Most of the code in this function has been copied from krun.cpp and browserrun.cpp
+ void KonqRun::init()
+ {
+- KParts::BrowserRun::init();
+- // Maybe init went to the "let's try stat'ing" part. Then connect to info messages.
+- // (in case it goes to scanFile, this will be done below)
+- KIO::StatJob *job = dynamic_cast<KIO::StatJob *>(KRun::job());
++ QUrl url = KRun::url();
++ if (!url.isValid() || url.scheme().isEmpty()) {
++ if (m_inlineErrors && !url.isValid()) {
++ switchToErrorUrl(KIO::ERR_MALFORMED_URL, url.toString());
++ return;
++ }
++ const QString error = !url.isValid() ? url.errorString() : url.toString();
++ KParts::BrowserRun::init();
++ qCWarning(KONQUEROR_LOG) << "Malformed URL:" << error;
++ setError(true);
++ setFinished(true);
++ return;
++ }
++
++ if (!KUrlAuthorized::authorizeUrlAction(QStringLiteral("open"), QUrl(), url)) {
++ QString msg = KIO::buildErrorString(KIO::ERR_ACCESS_DENIED, url.toDisplayString());
++ KParts::BrowserRun::init();
++ setError(true);
++ setFinished(true);
++ return;
++ }
++
++ if (url.scheme().startsWith(QLatin1String("http")) && usingWebEngine()) {
++ //This is a fake mimetype, needed only to ensure that the URL will be handled
++ //by WebEnginePart which will then determine the real mimetype. If it's
++ //a mimetype it can't handle, it'll emit the KParts::BrowserExtension::openUrlRequest
++ //passing the real mimetype. Knowing the mimetype, KonqMainWindow::openUrl will handle
++ //it correctly without needing to use KonqRun again.
++ mimeTypeDetermined(QStringLiteral("text/html"));
++ } else if (url.isLocalFile()
++ && (url.host().isEmpty() || (url.host() == QLatin1String("localhost"))
++ || (url.host().compare(QHostInfo::localHostName(), Qt::CaseInsensitive) == 0))) {
++ const QString localPath = url.toLocalFile();
++ if (!QFile::exists(localPath)) {
++ if (m_inlineErrors) {
++ switchToErrorUrl(KIO::ERR_DOES_NOT_EXIST, localPath);
++ } else {
++ KParts::BrowserRun::init();
++ setError(true);
++ setFinished(true);
++ }
++ return;
++ }
++
++ QMimeDatabase db;
++ QMimeType mime = db.mimeTypeForUrl(url);
++ if (mime.isDefault() && !QFileInfo(localPath).isReadable()) {
++ // Unknown MIME type because the file is unreadable, no point in showing an open-with dialog (#261002)
++ const QString msg = KIO::buildErrorString(KIO::ERR_ACCESS_DENIED, localPath);
++ KParts::BrowserRun::init();
++ setError(true);
++ setFinished(true);
++ return;
++ } else {
++ mimeTypeDetermined(mime.name());
++ return;
++ }
++ } else if (KIO::DesktopExecParser::hasSchemeHandler(url) && !KProtocolInfo::isKnownProtocol(url)) {
++ // looks for an application associated with x-scheme-handler/<protocol>
++ KService::Ptr service = KApplicationTrader::preferredService(QLatin1String("x-scheme-handler/") + url.scheme());
++ if (service) {
++ // if there's one...
++ if (runApplication(*service, QList<QUrl>() << url, window(), RunFlags{}, QString(), QByteArray())) {
++ setFinished(true);
++ return;
++ }
++ } else {
++ // fallback, look for associated helper protocol
++ Q_ASSERT(KProtocolInfo::isHelperProtocol(url.scheme()));
++ const auto exec = KProtocolInfo::exec(url.scheme());
++ if (exec.isEmpty()) {
++ // use default MIME type opener for file
++ mimeTypeDetermined(KProtocolManager::defaultMimetype(url));
++ return;
++ } else {
++ if (run(exec, QList<QUrl>() << url, window(), QString(), QString(), QByteArray())) {
++ setFinished(true);
++ return;
++ }
++ }
++ }
++ }
++
++ // Let's see whether it is a directory
++
++ if (!KProtocolManager::supportsListing(url)) {
++ // No support for listing => it can't be a directory (example: http)
++
++ if (!KProtocolManager::supportsReading(url)) {
++ // No support for reading files either => we can't do anything (example: mailto URL, with no associated app)
++ KParts::BrowserRun::init();
++ setError(true);
++ setFinished(true);
++ return;
++ }
++ scanFile();
++ return;
++ }
++
++ // It may be a directory or a file, let's stat
++ KIO::JobFlags flags = progressInfo() ? KIO::DefaultFlags : KIO::HideProgressInfo;
++ KIO::StatJob *job = KIO::statDetails(url, KIO::StatJob::SourceSide, KIO::StatBasic, flags);
++ KJobWidgets::setWindow(job, window());
++ connect(job, &KJob::result, this, &KonqRun::slotStatResult);
++ setJob(job);
+ if (job && !job->error() && m_pView) {
+- connect(job, SIGNAL(infoMessage(KJob*,QString,QString)),
+- m_pView, SLOT(slotInfoMessage(KJob*,QString)));
++ connect(job, &KIO::StatJob::infoMessage, m_pView, &KonqView::slotInfoMessage);
+ }
+ }
+
+diff --git a/src/konqrun.h b/src/konqrun.h
+index 591b91d19..88782ea03 100644
+--- a/src/konqrun.h
++++ b/src/konqrun.h
+@@ -26,6 +26,8 @@
+ #include "konqopenurlrequest.h"
+ #include <QUrl>
+
++#include <KIO/Global>
++
+ class KonqMainWindow;
+ class KonqView;
+
+@@ -69,6 +71,14 @@ protected:
+ void init() override;
+ void scanFile() override;
+
++ /**
++ * Displays an error page appropriate to the given error code
++ *
++ * @param error the error code
++ * @param stringUrl the string representation of the URL which caused the error
++ */
++ void switchToErrorUrl(KIO::Error error, const QString &stringUrl);
++
+ protected Q_SLOTS:
+ void slotRedirection(KIO::Job *, const QUrl &);
+
+@@ -81,6 +91,7 @@ private:
+ bool m_bFoundMimeType;
+ KonqOpenURLRequest m_req;
+ QUrl m_mailto;
++ bool m_inlineErrors;
+ };
+
+ #endif // KONQRUN_H
diff --git a/kde-apps/konqueror/konqueror-21.04.3-r2.ebuild b/kde-apps/konqueror/konqueror-21.04.3-r2.ebuild
new file mode 100644
index 000000000000..abaf095e12ce
--- /dev/null
+++ b/kde-apps/konqueror/konqueror-21.04.3-r2.ebuild
@@ -0,0 +1,91 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+ECM_HANDBOOK="optional"
+ECM_TEST="true"
+KFMIN=5.80.0
+QTMIN=5.15.2
+VIRTUALX_REQUIRED="test"
+inherit flag-o-matic ecm kde.org optfeature
+
+DESCRIPTION="Web browser and file manager based on KDE Frameworks"
+HOMEPAGE="https://apps.kde.org/konqueror/"
+
+LICENSE="GPL-2" # TODO: CHECK
+SLOT="5"
+KEYWORDS="~amd64 ~arm64 ~x86"
+IUSE="activities speech X"
+
+# 4 of 4 tests fail. Last checked for 4.0.3
+RESTRICT="test"
+
+COMMON_DEPEND="
+ >=dev-qt/qtdbus-${QTMIN}:5
+ >=dev-qt/qtgui-${QTMIN}:5
+ >=dev-qt/qtscript-${QTMIN}:5
+ >=dev-qt/qtwebengine-${QTMIN}:5[widgets]
+ >=dev-qt/qtwidgets-${QTMIN}:5
+ >=dev-qt/qtxml-${QTMIN}:5
+ >=kde-frameworks/karchive-${KFMIN}:5
+ >=kde-frameworks/kbookmarks-${KFMIN}:5
+ >=kde-frameworks/kcmutils-${KFMIN}:5
+ >=kde-frameworks/kcodecs-${KFMIN}:5
+ >=kde-frameworks/kcompletion-${KFMIN}:5
+ >=kde-frameworks/kconfig-${KFMIN}:5
+ >=kde-frameworks/kconfigwidgets-${KFMIN}:5
+ >=kde-frameworks/kcoreaddons-${KFMIN}:5
+ >=kde-frameworks/kcrash-${KFMIN}:5
+ >=kde-frameworks/kdbusaddons-${KFMIN}:5
+ >=kde-frameworks/kdesu-${KFMIN}:5
+ >=kde-frameworks/kguiaddons-${KFMIN}:5
+ >=kde-frameworks/ki18n-${KFMIN}:5
+ >=kde-frameworks/kiconthemes-${KFMIN}:5
+ >=kde-frameworks/kio-${KFMIN}:5
+ >=kde-frameworks/kitemviews-${KFMIN}:5
+ >=kde-frameworks/kjobwidgets-${KFMIN}:5
+ >=kde-frameworks/kparts-${KFMIN}:5
+ >=kde-frameworks/kservice-${KFMIN}:5
+ >=kde-frameworks/kwallet-${KFMIN}:5
+ >=kde-frameworks/kwidgetsaddons-${KFMIN}:5
+ >=kde-frameworks/kwindowsystem-${KFMIN}:5
+ >=kde-frameworks/kxmlgui-${KFMIN}:5
+ sys-libs/zlib
+ speech? ( >=dev-qt/qtspeech-${QTMIN}:5 )
+ X? ( >=dev-qt/qtx11extras-${QTMIN}:5 )
+"
+DEPEND="${COMMON_DEPEND}
+ activities? ( >=kde-frameworks/kactivities-${KFMIN}:5 )
+"
+RDEPEND="${COMMON_DEPEND}
+ kde-apps/kfind:5
+ kde-plasma/kde-cli-tools:5
+"
+
+PATCHES=( "${FILESDIR}/${P}-kf-5.86-compat.patch" ) # bug 815022
+
+src_prepare() {
+ [[ ${CHOST} == *-solaris* ]] && append-ldflags -lmalloc
+
+ ecm_src_prepare
+}
+
+src_configure() {
+ local mycmakeargs=(
+ $(cmake_use_find_package activities KF5Activities)
+ $(cmake_use_find_package speech Qt5TextToSpeech)
+ $(cmake_use_find_package X X11)
+ )
+ ecm_src_configure
+}
+
+pkg_postinst() {
+ if [[ -z "${REPLACING_VERSIONS}" ]]; then
+ optfeature "bookmarks support" kde-apps/keditbookmarks:${SLOT}
+ optfeature "filemanager component" kde-apps/dolphin:${SLOT}
+ optfeature "SVG support" kde-apps/svg:${SLOT}
+ optfeature "Java support on webpages" virtual/jre
+ fi
+ ecm_pkg_postinst
+}
diff --git a/kde-apps/konqueror/konqueror-21.08.1-r2.ebuild b/kde-apps/konqueror/konqueror-21.08.1-r2.ebuild
new file mode 100644
index 000000000000..5387dda9cf63
--- /dev/null
+++ b/kde-apps/konqueror/konqueror-21.08.1-r2.ebuild
@@ -0,0 +1,92 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+ECM_HANDBOOK="optional"
+ECM_TEST="true"
+KFMIN=5.84.0
+QTMIN=5.15.2
+VIRTUALX_REQUIRED="test"
+inherit flag-o-matic ecm kde.org optfeature
+
+DESCRIPTION="Web browser and file manager based on KDE Frameworks"
+HOMEPAGE="https://apps.kde.org/konqueror/"
+
+LICENSE="GPL-2" # TODO: CHECK
+SLOT="5"
+KEYWORDS="~amd64 ~arm64 ~x86"
+IUSE="activities speech X"
+
+# 4 of 4 tests fail. Last checked for 4.0.3
+RESTRICT="test"
+
+COMMON_DEPEND="
+ >=dev-qt/qtdbus-${QTMIN}:5
+ >=dev-qt/qtgui-${QTMIN}:5
+ >=dev-qt/qtscript-${QTMIN}:5
+ >=dev-qt/qtwebengine-${QTMIN}:5[widgets]
+ >=dev-qt/qtwidgets-${QTMIN}:5
+ >=dev-qt/qtxml-${QTMIN}:5
+ >=kde-frameworks/karchive-${KFMIN}:5
+ >=kde-frameworks/kbookmarks-${KFMIN}:5
+ >=kde-frameworks/kcmutils-${KFMIN}:5
+ >=kde-frameworks/kcodecs-${KFMIN}:5
+ >=kde-frameworks/kcompletion-${KFMIN}:5
+ >=kde-frameworks/kconfig-${KFMIN}:5
+ >=kde-frameworks/kconfigwidgets-${KFMIN}:5
+ >=kde-frameworks/kcoreaddons-${KFMIN}:5
+ >=kde-frameworks/kcrash-${KFMIN}:5
+ >=kde-frameworks/kdbusaddons-${KFMIN}:5
+ >=kde-frameworks/kdesu-${KFMIN}:5
+ >=kde-frameworks/kguiaddons-${KFMIN}:5
+ >=kde-frameworks/ki18n-${KFMIN}:5
+ >=kde-frameworks/kiconthemes-${KFMIN}:5
+ >=kde-frameworks/kio-${KFMIN}:5
+ >=kde-frameworks/kitemviews-${KFMIN}:5
+ >=kde-frameworks/kjobwidgets-${KFMIN}:5
+ >=kde-frameworks/kparts-${KFMIN}:5
+ >=kde-frameworks/kservice-${KFMIN}:5
+ >=kde-frameworks/kwallet-${KFMIN}:5
+ >=kde-frameworks/kwidgetsaddons-${KFMIN}:5
+ >=kde-frameworks/kwindowsystem-${KFMIN}:5
+ >=kde-frameworks/kxmlgui-${KFMIN}:5
+ sys-libs/zlib
+ speech? ( >=dev-qt/qtspeech-${QTMIN}:5 )
+ X? ( >=dev-qt/qtx11extras-${QTMIN}:5 )
+"
+DEPEND="${COMMON_DEPEND}
+ activities? ( >=kde-frameworks/kactivities-${KFMIN}:5 )
+"
+RDEPEND="${COMMON_DEPEND}
+ kde-apps/kfind:5
+ kde-plasma/kde-cli-tools:5
+"
+
+PATCHES=( "${FILESDIR}/${PN}-21.04.3-kf-5.86-compat.patch" ) # bug 815022
+
+src_prepare() {
+ [[ ${CHOST} == *-solaris* ]] && append-ldflags -lmalloc
+
+ ecm_src_prepare
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -DCMAKE_DISABLE_FIND_PACKAGE_Hunspell=ON # requires fixing bug 634122
+ $(cmake_use_find_package activities KF5Activities)
+ $(cmake_use_find_package speech Qt5TextToSpeech)
+ $(cmake_use_find_package X X11)
+ )
+ ecm_src_configure
+}
+
+pkg_postinst() {
+ if [[ -z "${REPLACING_VERSIONS}" ]]; then
+ optfeature "bookmarks support" kde-apps/keditbookmarks:${SLOT}
+ optfeature "filemanager component" kde-apps/dolphin:${SLOT}
+ optfeature "SVG support" kde-apps/svg:${SLOT}
+ optfeature "Java support on webpages" virtual/jre
+ fi
+ ecm_pkg_postinst
+}