diff options
Diffstat (limited to 'app-text/kchmviewer/files')
3 files changed, 117 insertions, 0 deletions
diff --git a/app-text/kchmviewer/files/kchmviewer-8.0-custom-url-scheme-registration.patch b/app-text/kchmviewer/files/kchmviewer-8.0-custom-url-scheme-registration.patch new file mode 100644 index 000000000000..144d673b2b17 --- /dev/null +++ b/app-text/kchmviewer/files/kchmviewer-8.0-custom-url-scheme-registration.patch @@ -0,0 +1,59 @@ +From 9ac73e7ad15de08aab6b1198115be2eb44da7afe Mon Sep 17 00:00:00 2001 +From: George Yunaev <gyunaev@ulduzsoft.com> +Date: Fri, 21 May 2021 15:57:21 -0700 +Subject: [PATCH] Custom URL scheme registration needs to be applied once per + https://doc.qt.io/qt-5/qwebengineurlschemehandler.html + +--- + src/viewwindow_webengine.cpp | 20 +++++++++++++------- + src/viewwindow_webengine.h | 3 --- + 2 files changed, 13 insertions(+), 10 deletions(-) + +diff --git a/src/viewwindow_webengine.cpp b/src/viewwindow_webengine.cpp +index 631d84d..34f3396 100644 +--- a/src/viewwindow_webengine.cpp ++++ b/src/viewwindow_webengine.cpp +@@ -63,16 +63,22 @@ ViewWindow::ViewWindow( QWidget * parent ) + m_contextMenuLink = 0; + m_storedScrollbarPosition = -1; // see header + +- // Use our network emulation layer. I don't know if we transfer the ownership when we install it, +- // so we create one per page. May be unnecessary. +- m_provider = new DataProvider_QWebEngine( this ); +- +- page()->profile()->installUrlSchemeHandler( EBook_CHM::urlScheme(), m_provider ); +- page()->profile()->installUrlSchemeHandler( EBook_EPUB::urlScheme(), m_provider ); +- + // All links are going through us + //page()->setLinkDelegationPolicy( QWebPage::DelegateAllLinks ); + ++ // This needs to be done only once ++ static bool providerInstalled = false; ++ ++ if ( !providerInstalled ) ++ { ++ // Use our network emulation layer. We do not transfer the ownership when we install it. See https://doc.qt.io/qt-5/qwebengineurlschemehandler.html ++ DataProvider_QWebEngine * provider = new DataProvider_QWebEngine( 0 ); ++ ++ QWebEngineProfile::defaultProfile()->installUrlSchemeHandler( EBook_CHM::urlScheme(), provider ); ++ QWebEngineProfile::defaultProfile()->installUrlSchemeHandler( EBook_EPUB::urlScheme(), provider ); ++ providerInstalled = true; ++ } ++ + connect( this, SIGNAL( loadFinished(bool)), this, SLOT( onLoadFinished(bool)) ); + + // Search results highlighter +diff --git a/src/viewwindow_webengine.h b/src/viewwindow_webengine.h +index 0adea31..3e96690 100644 +--- a/src/viewwindow_webengine.h ++++ b/src/viewwindow_webengine.h +@@ -128,9 +128,6 @@ class ViewWindow : public QWebEngineView + // It is set to -1 if no scrollbar position has been set and the page is not loaded yet + // It is set to 0 if no scrollbar position has been set and the page is loaded already + int m_storedScrollbarPosition; +- +- // Data provider +- DataProvider_QWebEngine * m_provider; + }; + + #endif // VIEWWINDOW_WEBENGINE_H diff --git a/app-text/kchmviewer/files/kchmviewer-8.0-no-qtwebkit.patch b/app-text/kchmviewer/files/kchmviewer-8.0-no-qtwebkit.patch new file mode 100644 index 000000000000..18360c897821 --- /dev/null +++ b/app-text/kchmviewer/files/kchmviewer-8.0-no-qtwebkit.patch @@ -0,0 +1,28 @@ +From a4a3984465cb635822953350c571950ae726b539 Mon Sep 17 00:00:00 2001 +From: George Yunaev <gyunaev@ulduzsoft.com> +Date: Sun, 23 May 2021 15:01:24 -0700 +Subject: [PATCH] Only add Webkit stuff to QT if we're compiling under 5.6. + Thanks to @u-235 for reporting. + +--- + src/src.pro | 7 +------ + 1 file changed, 1 insertion(+), 6 deletions(-) + +diff --git a/src/src.pro b/src/src.pro +index f502259..e75d6a9 100644 +--- a/src/src.pro ++++ b/src/src.pro +@@ -60,12 +60,7 @@ FORMS += tab_bookmarks.ui \ + toolbareditor.ui + RESOURCES += resources/images.qrc + +-QT += webkit \ +- xml \ +- network \ +- widgets \ +- webkitwidgets \ +- printsupport ++QT += xml network widgets printsupport + + linux-g++*:{ + LIBS += -lX11 diff --git a/app-text/kchmviewer/files/kchmviewer-8.0-underlinking.patch b/app-text/kchmviewer/files/kchmviewer-8.0-underlinking.patch new file mode 100644 index 000000000000..b4ed3b500c8d --- /dev/null +++ b/app-text/kchmviewer/files/kchmviewer-8.0-underlinking.patch @@ -0,0 +1,30 @@ +From e3b09edbbae17ad19661a7514afe5a9d84ca0ffa Mon Sep 17 00:00:00 2001 +From: George Yunaev <gyunaev@ulduzsoft.com> +Date: Sun, 23 May 2021 15:03:06 -0700 +Subject: [PATCH] Adding support for old single-pass gcc linker which requires + a specific order of libraries. Thanks to @u-235 for reporting and patch. + +--- + src/src.pro | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/src.pro b/src/src.pro +index e75d6a9..14c31a1 100644 +--- a/src/src.pro ++++ b/src/src.pro +@@ -40,7 +40,6 @@ SOURCES += config.cpp \ + textencodings.cpp \ + treeitem_toc.cpp \ + treeitem_index.cpp +-LIBS += -lchm -lzip + TARGET = ../bin/kchmviewer + CONFIG += threads \ + warn_on \ +@@ -106,6 +105,7 @@ unix:!macx: { + LIBS += ../lib/libebook/libebook.a + POST_TARGETDEPS += ../lib/libebook/libebook.a + } ++LIBS += -lchm -lzip + + greaterThan(QT_MAJOR_VERSION, 4) { + # Qt 5 |