2
0
mirror of https://codeberg.org/kiss-community/repo synced 2024-07-02 14:02:27 +00:00

falkon: move to community

This commit is contained in:
Dylan Araps 2020-02-14 13:06:07 +02:00
parent 039334693a
commit 6627681877
No known key found for this signature in database
GPG Key ID: 46D62DD9F1DE636E
8 changed files with 0 additions and 562 deletions

View File

@ -1,26 +0,0 @@
#!/bin/sh -e
export DESTDIR="$1"
for patch in *.patch; do
patch -p1 < "$patch"
done
# Get rid of i18n.
rm -rf po poqm
# Fix missing include in latest Qt.
sed -i 's/\(Settings>\)/\1\n#include <QFile>/' \
src/plugins/VerticalTabs/verticaltabsplugin.cpp
cmake -B build \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_INSTALL_LIBDIR=/usr/lib \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_TESTING=OFF \
-DDISABLE_DBUS=ON
cmake --build build
cmake --install build
install -Dm755 falkon-privacy "$1/usr/bin/falkon-privacy"

View File

@ -1,4 +0,0 @@
19423bae577005bb0491cdbb1161ad021761460e343367528bc11b8cd9e60879 1cecd14fd069ff778224fe778b7117cb4e3bc0ee.tar.gz
6840921795d025f2a02baec8baa5456e245c84f10ecbb06ba85f33f193939af1 0001-falkon-no-karchive.patch
e0a3dadfe241f6407d1c7914359d65230eeb4b119a9458a98a3f70e0ebfe9d4e 0002-falkon-open-mpv.patch
929dc4ee0e1ec87510696894e0ba3d0218707d6fe9903be3cde5c4ff71a50aa2 falkon-privacy

View File

@ -1,6 +0,0 @@
cmake make
extra-cmake-modules make
qt5-webengine
qt5-svg
qt5-webchannel
qt5-x11extras

View File

@ -1,28 +0,0 @@
#!/bin/sh
exec falkon \
--disable-file-system \
--disable-gpu-watchdog \
--disable-notifications \
--disable-permissions-api \
--disable-presentation-api \
--disable-print-preview \
--disable-remote-playback-api \
--disable-renderer-accessibility \
--disable-shared-workers \
--disable-speech-api \
--disable-sync \
--disable-wake-on-wifi \
--disable-webgl \
--disable-3d-apis \
--disable-media-session-api \
--disable-background-networking \
--force-webrtc-ip-handling-policy=default_public_interface_only \
--webview-disable-safebrowsing-support \
--google-base-url about:blank \
--google-apis-url about:blank \
--google-url about:blank \
--connectivity-check-url about:blank \
--crash-server-url about:blank \
--cryptauth-http-host about:blank \
"$@"

View File

@ -1,78 +0,0 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 207c90a5..46484769 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -55,7 +55,7 @@ endif()
if (UNIX AND NOT APPLE AND NOT NO_X11)
add_definitions(-DQZ_WS_X11)
- find_package(XCB REQUIRED COMPONENTS XCB UTIL)
+ find_package(XCB REQUIRED COMPONENTS XCB)
find_package(Qt5 ${QT_MIN_VERSION} REQUIRED COMPONENTS X11Extras)
endif()
if (WIN32)
@@ -88,9 +88,6 @@ endif()
# Mandatory: OpenSSL
find_package(OpenSSL REQUIRED)
-# Mandatory: KF5
-find_package(KF5 REQUIRED COMPONENTS Archive)
-
# KF5I18n: Mandatory with downloaded translations (only for ki18n_install)
if (EXISTS "${CMAKE_SOURCE_DIR}/po")
find_package(KF5I18n REQUIRED)
diff --git a/src/lib/CMakeLists.txt b/src/lib/CMakeLists.txt
index 3b7efff0..70416b47 100644
--- a/src/lib/CMakeLists.txt
+++ b/src/lib/CMakeLists.txt
@@ -156,7 +156,6 @@ set(SRCS ${SRCS}
plugins/pluginproxy.cpp
plugins/plugins.cpp
plugins/speeddial.cpp
- plugins/ocssupport.cpp
plugins/qml/qmlpluginloader.cpp
plugins/qml/qmlplugin.cpp
plugins/qml/qmlplugins.cpp
@@ -352,7 +351,6 @@ target_link_libraries(FalkonPrivate
Qt5::PrintSupport
Qt5::QuickWidgets
Qt5::WebChannel
- KF5::Archive
${OPENSSL_CRYPTO_LIBRARY}
)
diff --git a/src/lib/app/browserwindow.cpp b/src/lib/app/browserwindow.cpp
index 5481f369..368bae43 100644
--- a/src/lib/app/browserwindow.cpp
+++ b/src/lib/app/browserwindow.cpp
@@ -81,7 +81,6 @@
#ifdef QZ_WS_X11
#include <QX11Info>
#include <xcb/xcb.h>
-#include <xcb/xcb_atom.h>
#endif
static const int savedWindowVersion = 2;
diff --git a/src/lib/webengine/webpage.cpp b/src/lib/webengine/webpage.cpp
index 5037b1cb..af1461f8 100644
--- a/src/lib/webengine/webpage.cpp
+++ b/src/lib/webengine/webpage.cpp
@@ -42,7 +42,6 @@
#include "ui_jsprompt.h"
#include "passwordmanager.h"
#include "scripts.h"
-#include "ocssupport.h"
#include <iostream>
@@ -454,10 +453,6 @@ bool WebPage::acceptNavigationRequest(const QUrl &url, QWebEnginePage::Navigatio
}
}
- if (url.scheme() == QL1S("ocs") && OcsSupport::instance()->handleUrl(url)) {
- return false;
- }
-
const bool result = QWebEnginePage::acceptNavigationRequest(url, type, isMainFrame);
if (result) {

View File

@ -1,415 +0,0 @@
diff --git a/src/plugins/CMakeLists.txt b/src/plugins/CMakeLists.txt
index bfcf593..21b4db6 100644
--- a/src/plugins/CMakeLists.txt
+++ b/src/plugins/CMakeLists.txt
@@ -8,6 +8,7 @@ add_subdirectory(PIM)
add_subdirectory(StatusBarIcons)
add_subdirectory(TabManager)
add_subdirectory(VerticalTabs)
+add_subdirectory(OpenInMpv)
if (ENABLE_KDE_FRAMEWORKS_INTEGRATION_PLUGIN)
add_subdirectory(KDEFrameworksIntegration)
diff --git a/src/plugins/OpenInMpv/CMakeLists.txt b/src/plugins/OpenInMpv/CMakeLists.txt
new file mode 100644
index 00000000..5f7d66a6
--- /dev/null
+++ b/src/plugins/OpenInMpv/CMakeLists.txt
@@ -0,0 +1,16 @@
+set( OpenInMpv_SRCS
+ openinmpv.cpp
+ icon.cpp
+ )
+
+
+set( OpenInMpv_RSCS
+ openinmpv.qrc
+)
+qt5_add_resources(RSCS ${OpenInMpv_RSCS})
+
+ecm_create_qm_loader( OpenInMpv_SRCS falkon_OpenInMpv_qt )
+
+add_library(OpenInMpv MODULE ${OpenInMpv_SRCS} ${RSCS})
+install(TARGETS OpenInMpv DESTINATION ${FALKON_INSTALL_PLUGINDIR})
+target_link_libraries(OpenInMpv FalkonPrivate)
diff --git a/src/plugins/OpenInMpv/Messages.sh b/src/plugins/OpenInMpv/Messages.sh
new file mode 100644
index 00000000..35ba0d26
--- /dev/null
+++ b/src/plugins/OpenInMpv/Messages.sh
@@ -0,0 +1,2 @@
+#! /bin/sh
+$EXTRACT_TR_STRINGS `find . -name '*.cpp' -o -name '*.h' -o -name '*.ui'` -o $podir/falkon_testplugin_qt.pot
diff --git a/src/plugins/OpenInMpv/data/icon-white.svg b/src/plugins/OpenInMpv/data/icon-white.svg
new file mode 100644
index 00000000..25718f8f
--- /dev/null
+++ b/src/plugins/OpenInMpv/data/icon-white.svg
@@ -0,0 +1,14 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 22 22">
+ <defs id="defs3051">
+ <style type="text/css" id="current-color-scheme">
+ .ColorScheme-Text {
+ color:#f2f2f2;
+ }
+ </style>
+ </defs>
+ <path
+ style="fill:currentColor;fill-opacity:1;stroke:none"
+ d="M 3 4 C 1.892 4 1 4.892 1 6 L 1 16 C 1 17.108 1.892 18 3 18 L 19 18 C 20.108 18 21 17.108 21 16 L 21 6 C 21 4.892 20.108 4 19 4 L 3 4 z M 9 8 L 14 11 L 9 14 L 9 8 z "
+ class="ColorScheme-Text"
+ />
+</svg>
diff --git a/src/plugins/OpenInMpv/data/icon.svg b/src/plugins/OpenInMpv/data/icon.svg
new file mode 100644
index 00000000..5a002c43
--- /dev/null
+++ b/src/plugins/OpenInMpv/data/icon.svg
@@ -0,0 +1,14 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 22 22">
+ <defs id="defs3051">
+ <style type="text/css" id="current-color-scheme">
+ .ColorScheme-Text {
+ color:#4d4d4d;
+ }
+ </style>
+ </defs>
+ <path
+ style="fill:currentColor;fill-opacity:1;stroke:none"
+ d="M 3 4 C 1.892 4 1 4.892 1 6 L 1 16 C 1 17.108 1.892 18 3 18 L 19 18 C 20.108 18 21 17.108 21 16 L 21 6 C 21 4.892 20.108 4 19 4 L 3 4 z M 9 8 L 14 11 L 9 14 L 9 8 z "
+ class="ColorScheme-Text"
+ />
+</svg>
diff --git a/src/plugins/OpenInMpv/icon.cpp b/src/plugins/OpenInMpv/icon.cpp
new file mode 100644
index 00000000..931e529a
--- /dev/null
+++ b/src/plugins/OpenInMpv/icon.cpp
@@ -0,0 +1,19 @@
+#include "icon.h"
+
+OpenInMpvIcon::OpenInMpvIcon(QObject *parent)
+ : AbstractButtonInterface(parent)
+{
+ setIcon(QIcon::fromTheme(QSL("openinmpv-icon"), QIcon(QSL(":openinmpv/data/icon.svg"))));
+ setTitle(tr("Open In Mpv"));
+ setToolTip(tr("Open In Mpv"));
+}
+
+QString OpenInMpvIcon::id() const
+{
+ return QSL("openinmpv");
+}
+
+QString OpenInMpvIcon::name() const
+{
+ return tr("Open In Mpv");
+}
diff --git a/src/plugins/OpenInMpv/icon.h b/src/plugins/OpenInMpv/icon.h
new file mode 100644
index 00000000..bf87c751
--- /dev/null
+++ b/src/plugins/OpenInMpv/icon.h
@@ -0,0 +1,21 @@
+#ifndef OPENINMPVICON_H
+#define OPENINMPVICON_H
+
+#include <abstractbuttoninterface.h>
+
+class OpenInMpvIcon : public AbstractButtonInterface
+{
+ Q_OBJECT
+
+public:
+ explicit OpenInMpvIcon(QObject *parent = nullptr);
+
+ QString id() const override;
+ QString name() const override;
+
+private:
+ void updateState();
+ void clicked(ClickController *controller);
+};
+
+#endif //OPENINMPVICON_H
diff --git a/src/plugins/OpenInMpv/metadata.desktop b/src/plugins/OpenInMpv/metadata.desktop
new file mode 100644
index 00000000..7956c63a
--- /dev/null
+++ b/src/plugins/OpenInMpv/metadata.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Name=Open in Mpv
+Comment=Open in Mpv
+
+Icon=configure
+Type=Service
+
+X-Falkon-Author=David Rosca
+X-Falkon-Email=nowrep@gmail.com
+X-Falkon-Version=0.1.7
+X-Falkon-Settings=false
diff --git a/src/plugins/OpenInMpv/openinmpv.cpp b/src/plugins/OpenInMpv/openinmpv.cpp
new file mode 100644
index 00000000..c4f82dc6
--- /dev/null
+++ b/src/plugins/OpenInMpv/openinmpv.cpp
@@ -0,0 +1,174 @@
+/* ============================================================
+* Falkon - Qt web browser
+* Copyright (C) 2010-2018 David Rosca <nowrep@gmail.com>
+*
+* 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 3 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, see <http://www.gnu.org/licenses/>.
+* ============================================================ */
+#include "openinmpv.h"
+#include "browserwindow.h"
+#include "webview.h"
+#include "pluginproxy.h"
+#include "mainapplication.h"
+#include "sidebar.h"
+#include "webhittestresult.h"
+#include "../config.h"
+#include "desktopfile.h"
+#include "navigationbar.h"
+
+#include <QMenu>
+#include <QPushButton>
+#include <QProcess>
+
+#include "icon.h"
+
+OpenInMpv::OpenInMpv()
+ : QObject()
+{
+ // Don't do anything expensive in constructor!
+ // It will be called even if user doesn't have the plugin allowed
+}
+
+DesktopFile OpenInMpv::metaData() const
+{
+ return DesktopFile(QSL(":openinmpv/metadata.desktop"));
+}
+
+void OpenInMpv::init(InitState state, const QString &)
+{
+ m_icon = new OpenInMpvIcon();
+ m_icon->setIcon(QIcon(QL1S(":openinmpv/data/icon.svg")));
+ connect(m_icon, SIGNAL(clicked(ClickController*)), this, SLOT(actionIconSlot()));
+ connect(mApp->plugins(), &PluginProxy::mainWindowCreated, this, &OpenInMpv::mainWindowCreated);
+ connect(mApp->plugins(), &PluginProxy::mainWindowDeleted, this, &OpenInMpv::mainWindowDeleted);
+
+ if (state == LateInitState) {
+ const auto windows = mApp->windows();
+ for (BrowserWindow *window : windows) {
+ mainWindowCreated(window);
+ }
+ }
+
+}
+
+void OpenInMpv::mainWindowCreated(BrowserWindow *window)
+{
+ window->navigationBar()->addToolButton(m_icon);
+}
+
+void OpenInMpv::mainWindowDeleted(BrowserWindow *window)
+{
+ window->navigationBar()->removeToolButton(m_icon);
+}
+
+void OpenInMpv::unload()
+{
+ const auto windows = mApp->windows();
+ for (BrowserWindow *window : windows) {
+ mainWindowDeleted(window);
+ }
+}
+
+bool OpenInMpv::testPlugin()
+{
+ // This function is called right after init()
+ // There should be some testing if plugin is loaded correctly
+ // If this function returns false, plugin is automatically unloaded
+
+ return (Qz::VERSION == QLatin1String(FALKON_VERSION));
+}
+
+//void OpenInMpv::showSettings(QWidget* parent)
+//{
+// // This function will be called from Preferences after clicking on Settings button.
+// // Settings button will be enabled if PluginSpec.hasSettings == true
+
+// if (!m_settings) {
+// m_settings = new QDialog(parent);
+// QPushButton* b = new QPushButton("Example Plugin v0.0.1");
+// QPushButton* closeButton = new QPushButton(tr("Close"));
+// QLabel* label = new QLabel();
+// label->setPixmap(QPixmap(":icons/other/about.svg"));
+
+// QVBoxLayout* l = new QVBoxLayout(m_settings.data());
+// l->addWidget(label);
+// l->addWidget(b);
+// l->addWidget(closeButton);
+// m_settings.data()->setLayout(l);
+
+// m_settings.data()->setAttribute(Qt::WA_DeleteOnClose);
+// m_settings.data()->setWindowTitle(tr("Example Plugin Settings"));
+// m_settings.data()->setWindowIcon(QIcon(":icons/falkon.svg"));
+// connect(closeButton, SIGNAL(clicked()), m_settings.data(), SLOT(close()));
+// }
+
+// m_settings.data()->show();
+// m_settings.data()->raise();
+//}
+
+void OpenInMpv::populateWebViewMenu(QMenu* menu, WebView*, const WebHitTestResult &r)
+{
+ // Called from WebView when creating context menu
+
+// m_view = view;
+
+ QUrl link;
+
+ if (!r.linkUrl().isEmpty()) {
+// qDebug() << __FUNCTION__ << "linkUrl";
+ link = r.linkUrl();
+ } else if (!r.mediaUrl().isEmpty()) {
+// qDebug() << __FUNCTION__ << "mediaUrl";
+ link = r.mediaUrl();
+ }
+
+ if (link.isEmpty()) {
+ return;
+ }
+
+ menu->addAction(tr("Open In Mpv"), this, SLOT(actionSlot()))->setData(link);
+}
+
+void OpenInMpv::work(const QUrl url) {
+ QStringList arguments;
+// arguments << "--player-operation-mode=pseudo-gui" << "--" << url.toString();
+ arguments << url.toString();
+// QProcess p;
+// p.setStandardInputFile(QProcess::nullDevice());
+// p.setStandardOutputFile(QProcess::nullDevice());
+// p.setProgram("/bin/mpv");
+// p.setArguments(arguments);
+// bool success = p.startDetached();
+
+ /*bool success = */QProcess::startDetached("/bin/mpv", arguments);
+// if (!success) {
+// QString info = "<ul><li><b>" + tr("Executable: ") + "</b>/bin/mpv</li><li><b>" + tr("Arguments: ") + "</b>" + arguments.join(" ") + "</li></ul>";
+// QMessageBox::critical(m_view, tr("Cannot start external viewer"), tr("Cannot start external viewer! %1").arg(info));
+// }
+}
+void OpenInMpv::actionSlot()
+{
+ const QUrl url = qobject_cast<QAction*>(sender())->data().toUrl();
+ work(url);
+}
+
+void OpenInMpv::actionIconSlot()
+{
+ WebView *view = m_icon->webView();
+ if (!view) {
+ return;
+ }
+
+ const QUrl pageUrl = view->url();
+ work(pageUrl);
+}
diff --git a/src/plugins/OpenInMpv/openinmpv.h b/src/plugins/OpenInMpv/openinmpv.h
new file mode 100644
index 00000000..1b4ab0d4
--- /dev/null
+++ b/src/plugins/OpenInMpv/openinmpv.h
@@ -0,0 +1,65 @@
+/* ============================================================
+* Falkon - Qt web browser
+* Copyright (C) 2010-2014 David Rosca <nowrep@gmail.com>
+*
+* 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 3 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, see <http://www.gnu.org/licenses/>.
+* ============================================================ */
+#ifndef OPENINMPVPLUGIN_H
+#define OPENINMPVPLUGIN_H
+
+// Include plugininterface.h for your version of Falkon
+#include "plugininterface.h"
+
+#include <QLabel>
+#include <QMessageBox>
+#include <QVBoxLayout>
+#include <QPointer>
+
+class BrowserWindow;
+class OpenInMpvIcon;
+
+class OpenInMpv : public QObject, public PluginInterface
+{
+ Q_OBJECT
+ Q_INTERFACES(PluginInterface)
+ Q_PLUGIN_METADATA(IID "Falkon.Browser.plugin.OpenInMpv")
+
+public:
+ explicit OpenInMpv();
+
+ DesktopFile metaData() const;
+ void init(InitState state, const QString &settingsPath) override;
+ void unload() override;
+ bool testPlugin() override;
+// void showSettings(QWidget *parent) override;
+
+ void populateWebViewMenu(QMenu *menu, WebView *view, const WebHitTestResult &r) override;
+// bool mousePress(Qz::ObjectName type, QObject *obj, QMouseEvent *event) override;
+
+public slots:
+ void mainWindowCreated(BrowserWindow *window);
+ void mainWindowDeleted(BrowserWindow *window);
+private Q_SLOTS:
+ void actionSlot();
+ void actionIconSlot();
+private:
+// QPointer<QDialog> m_settings;
+
+// WebView* m_view;
+ QString m_settingsPath;
+ OpenInMpvIcon* m_icon;
+ void work(const QUrl);
+};
+
+#endif // OPENINMPVPLUGIN_H
diff --git a/src/plugins/OpenInMpv/openinmpv.qrc b/src/plugins/OpenInMpv/openinmpv.qrc
new file mode 100644
index 00000000..7c448114
--- /dev/null
+++ b/src/plugins/OpenInMpv/openinmpv.qrc
@@ -0,0 +1,7 @@
+<RCC>
+ <qresource prefix="/openinmpv">
+ <file>metadata.desktop</file>
+ <file>data/icon-white.svg</file>
+ <file>data/icon.svg</file>
+ </qresource>
+</RCC>

View File

@ -1,4 +0,0 @@
https://github.com/KDE/falkon/archive/1cecd14fd069ff778224fe778b7117cb4e3bc0ee.tar.gz
patches/0001-falkon-no-karchive.patch
patches/0002-falkon-open-mpv.patch
files/falkon-privacy

View File

@ -1 +0,0 @@
git 1