mirror of
https://invent.kde.org/network/falkon.git
synced 2024-11-11 01:22:10 +01:00
Initial support for building with Qt6/KF6.
This commit is contained in:
parent
b52c1e3655
commit
632cd4c4ba
|
@ -26,6 +26,15 @@ include(ECMSetupVersion)
|
||||||
include(ECMAddAppIcon)
|
include(ECMAddAppIcon)
|
||||||
include(ECMQtDeclareLoggingCategory)
|
include(ECMQtDeclareLoggingCategory)
|
||||||
include(ECMPoQmTools)
|
include(ECMPoQmTools)
|
||||||
|
if (QT_MAJOR_VERSION STREQUAL "6")
|
||||||
|
set(QT_MIN_VERSION "6.4.0")
|
||||||
|
set(KF_MIN_VERSION "5.240.0")
|
||||||
|
set(KF_MAJOR_VERSION "6")
|
||||||
|
else()
|
||||||
|
set(QT_MIN_VERSION "5.15.0")
|
||||||
|
set(KF_MIN_VERSION "5.78.0")
|
||||||
|
set(KF_MAJOR_VERSION "5")
|
||||||
|
endif()
|
||||||
|
|
||||||
# Output dirs (like ECM 5.38 does)
|
# Output dirs (like ECM 5.38 does)
|
||||||
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib")
|
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib")
|
||||||
|
@ -49,26 +58,30 @@ endif()
|
||||||
# Defines that are always set
|
# Defines that are always set
|
||||||
add_definitions(-DQT_NO_URL_CAST_FROM_STRING -DQT_USE_QSTRINGBUILDER -DQT_NO_CAST_TO_ASCII)
|
add_definitions(-DQT_NO_URL_CAST_FROM_STRING -DQT_USE_QSTRINGBUILDER -DQT_NO_CAST_TO_ASCII)
|
||||||
|
|
||||||
# Mandatory: Qt5
|
# Mandatory: Qt5/6
|
||||||
set(QT_MIN_VERSION "5.15.0")
|
find_package(Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} REQUIRED COMPONENTS Core Widgets Network Sql QuickWidgets PrintSupport WebChannel)
|
||||||
find_package(Qt5 ${QT_MIN_VERSION} REQUIRED COMPONENTS Core Widgets Network Sql QuickWidgets PrintSupport WebChannel)
|
if (QT_MAJOR_VERSION STREQUAL "6")
|
||||||
find_package(Qt5WebEngine ${QT_MIN_VERSION} REQUIRED)
|
find_package(Qt6WebEngineCore ${QT_MIN_VERSION} REQUIRED)
|
||||||
find_package(Qt5WebEngineWidgets ${QT_MIN_VERSION} REQUIRED)
|
find_package(Qt6WebEngineWidgets ${QT_MIN_VERSION} REQUIRED)
|
||||||
|
else()
|
||||||
|
find_package(Qt5WebEngine ${QT_MIN_VERSION} REQUIRED)
|
||||||
|
find_package(Qt5WebEngineWidgets ${QT_MIN_VERSION} REQUIRED)
|
||||||
|
endif()
|
||||||
if (BUILD_TESTING)
|
if (BUILD_TESTING)
|
||||||
find_package(Qt5 ${QT_MIN_VERSION} REQUIRED COMPONENTS Test)
|
find_package(Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} REQUIRED COMPONENTS Test)
|
||||||
endif()
|
endif()
|
||||||
if (NOT DISABLE_DBUS)
|
if (NOT DISABLE_DBUS)
|
||||||
find_package(Qt5 ${QT_MIN_VERSION} REQUIRED COMPONENTS DBus)
|
find_package(Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} REQUIRED COMPONENTS DBus)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (UNIX AND NOT APPLE AND NOT NO_X11)
|
if (UNIX AND NOT APPLE AND NOT NO_X11)
|
||||||
add_definitions(-DQZ_WS_X11)
|
add_definitions(-DQZ_WS_X11)
|
||||||
find_package(XCB REQUIRED COMPONENTS XCB UTIL)
|
find_package(XCB REQUIRED COMPONENTS XCB UTIL)
|
||||||
find_package(Qt5 ${QT_MIN_VERSION} REQUIRED COMPONENTS X11Extras)
|
find_package(Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} REQUIRED COMPONENTS X11Extras)
|
||||||
endif()
|
endif()
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
add_definitions(-DW7API)
|
add_definitions(-DW7API)
|
||||||
find_package(Qt5 ${QT_MIN_VERSION} REQUIRED COMPONENTS WinExtras)
|
find_package(Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} REQUIRED COMPONENTS WinExtras)
|
||||||
|
|
||||||
# taken from https://stackoverflow.com/a/40217291
|
# taken from https://stackoverflow.com/a/40217291
|
||||||
macro(get_WIN32_WINNT version)
|
macro(get_WIN32_WINNT version)
|
||||||
|
@ -93,15 +106,19 @@ if (WIN32)
|
||||||
add_definitions(-D_WIN32_WINNT=${ver})
|
add_definitions(-D_WIN32_WINNT=${ver})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if (QT_MAJOR_VERSION STREQUAL "6")
|
||||||
|
find_package(Qt6Core5Compat)
|
||||||
|
endif()
|
||||||
|
|
||||||
# Mandatory: OpenSSL
|
# Mandatory: OpenSSL
|
||||||
find_package(OpenSSL REQUIRED)
|
find_package(OpenSSL REQUIRED)
|
||||||
|
|
||||||
# Mandatory: KF5
|
# Mandatory: KF5/6
|
||||||
find_package(KF5 REQUIRED COMPONENTS Archive)
|
find_package(KF${KF_MAJOR_VERSION} REQUIRED COMPONENTS Archive)
|
||||||
|
|
||||||
# KF5I18n: Mandatory with downloaded translations (only for ki18n_install)
|
# KF5I18n: Mandatory with downloaded translations (only for ki18n_install)
|
||||||
if (EXISTS "${CMAKE_SOURCE_DIR}/po")
|
if (EXISTS "${CMAKE_SOURCE_DIR}/po")
|
||||||
find_package(KF5I18n REQUIRED)
|
find_package(KF${KF_MAJOR_VERSION}I18n REQUIRED)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Optional: GnomeKeyring
|
# Optional: GnomeKeyring
|
||||||
|
@ -114,34 +131,47 @@ if (PKG_CONFIG_FOUND)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Optional: KWallet, KIO, KCrash, KCoreAddons
|
# Optional: KWallet, KIO, KCrash, KCoreAddons
|
||||||
set(KF5_MIN_VERSION "5.78.0")
|
find_package(KF${KF_MAJOR_VERSION}Wallet ${KF_MIN_VERSION} CONFIG)
|
||||||
find_package(KF5Wallet ${KF5_MIN_VERSION} CONFIG)
|
set_package_properties(KF${KF_MAJOR_VERSION}Wallet PROPERTIES DESCRIPTION "KDE Frameworks Integration plugin" TYPE OPTIONAL)
|
||||||
set_package_properties(KF5Wallet PROPERTIES DESCRIPTION "KDE Frameworks Integration plugin" TYPE OPTIONAL)
|
find_package(KF${KF_MAJOR_VERSION}KIO ${KF_MIN_VERSION} CONFIG)
|
||||||
find_package(KF5KIO ${KF5_MIN_VERSION} CONFIG)
|
set_package_properties(KF${KF_MAJOR_VERSION}KIO PROPERTIES DESCRIPTION "KDE Frameworks Integration plugin" TYPE OPTIONAL)
|
||||||
set_package_properties(KF5KIO PROPERTIES DESCRIPTION "KDE Frameworks Integration plugin" TYPE OPTIONAL)
|
find_package(KF${KF_MAJOR_VERSION}Crash ${KF_MIN_VERSION} CONFIG)
|
||||||
find_package(KF5Crash ${KF5_MIN_VERSION} CONFIG)
|
set_package_properties(KF${KF_MAJOR_VERSION}Crash PROPERTIES DESCRIPTION "KDE Frameworks Integration plugin" TYPE OPTIONAL)
|
||||||
set_package_properties(KF5Crash PROPERTIES DESCRIPTION "KDE Frameworks Integration plugin" TYPE OPTIONAL)
|
find_package(KF${KF_MAJOR_VERSION}CoreAddons ${KF_MIN_VERSION} CONFIG)
|
||||||
find_package(KF5CoreAddons ${KF5_MIN_VERSION} CONFIG)
|
set_package_properties(KF${KF_MAJOR_VERSION}CoreAddons PROPERTIES DESCRIPTION "KDE Frameworks Integration plugin" TYPE OPTIONAL)
|
||||||
set_package_properties(KF5CoreAddons PROPERTIES DESCRIPTION "KDE Frameworks Integration plugin" TYPE OPTIONAL)
|
find_package(KF${KF_MAJOR_VERSION}Purpose ${KF_MIN_VERSION} CONFIG)
|
||||||
find_package(KF5Purpose ${KF5_MIN_VERSION} CONFIG)
|
set_package_properties(KF${KF_MAJOR_VERSION}Purpose PROPERTIES DESCRIPTION "KDE Frameworks Integration plugin" TYPE OPTIONAL)
|
||||||
find_package(KF5JobWidgets ${KF5_MIN_VERSION} CONFIG)
|
find_package(KF${KF_MAJOR_VERSION}JobWidgets ${KF_MIN_VERSION} CONFIG)
|
||||||
set_package_properties(KF5JobWidgets PROPERTIES DESCRIPTION "KDE Frameworks Integration plugin" TYPE OPTIONAL)
|
set_package_properties(KF${KF_MAJOR_VERSION}JobWidgets PROPERTIES DESCRIPTION "KDE Frameworks Integration plugin" TYPE OPTIONAL)
|
||||||
set_package_properties(KF5Purpose PROPERTIES DESCRIPTION "KDE Frameworks Integration plugin" TYPE OPTIONAL)
|
if (KF${KF_MAJOR_VERSION}Wallet_FOUND AND KF${KF_MAJOR_VERSION}KIO_FOUND AND KF${KF_MAJOR_VERSION}Crash_FOUND AND KF${KF_MAJOR_VERSION}CoreAddons_FOUND AND KF${KF_MAJOR_VERSION}Purpose_FOUND AND KF${KF_MAJOR_VERSION}JobWidgets_FOUND)
|
||||||
if (KF5Wallet_FOUND AND KF5KIO_FOUND AND KF5Crash_FOUND AND KF5CoreAddons_FOUND AND KF5Purpose_FOUND AND KF5JobWidgets_FOUND)
|
|
||||||
set(ENABLE_KDE_FRAMEWORKS_INTEGRATION_PLUGIN TRUE)
|
set(ENABLE_KDE_FRAMEWORKS_INTEGRATION_PLUGIN TRUE)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Optional: PySide2
|
# Optional: PySide2
|
||||||
option(BUILD_PYTHON_SUPPORT "Support for Python plugins" ON)
|
option(BUILD_PYTHON_SUPPORT "Support for Python plugins" ON)
|
||||||
if (BUILD_PYTHON_SUPPORT)
|
if (BUILD_PYTHON_SUPPORT)
|
||||||
find_package(PySide2 "2.0.0")
|
if (QT_MAJOR_VERSION STREQUAL "6")
|
||||||
find_package(Shiboken2 "2.0.0")
|
# Optional: PySide6
|
||||||
find_package(Python3 COMPONENTS Development)
|
find_package(PySide6 "6.4.0")
|
||||||
set_package_properties(PySide2 PROPERTIES DESCRIPTION "Python plugins" TYPE OPTIONAL)
|
find_package(Shiboken6 "6.4.0")
|
||||||
set_package_properties(Shiboken2 PROPERTIES DESCRIPTION "Python plugins" TYPE OPTIONAL)
|
find_package(Python3 COMPONENTS Development)
|
||||||
set_package_properties(Python3 PROPERTIES DESCRIPTION "Python plugins" TYPE OPTIONAL)
|
set_package_properties(PySide6 PROPERTIES DESCRIPTION "Python plugins" TYPE OPTIONAL)
|
||||||
if (PySide2_FOUND AND Shiboken2_FOUND AND Python3_FOUND)
|
set_package_properties(Shiboken6 PROPERTIES DESCRIPTION "Python plugins" TYPE OPTIONAL)
|
||||||
set(ENABLE_PYTHON_PLUGINS TRUE)
|
set_package_properties(Python3 PROPERTIES DESCRIPTION "Python plugins" TYPE OPTIONAL)
|
||||||
|
if (PySide6_FOUND AND Shiboken6_FOUND AND Python3_FOUND)
|
||||||
|
set(ENABLE_PYTHON_PLUGINS TRUE)
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
# Optional: PySide2
|
||||||
|
find_package(PySide2 "2.0.0")
|
||||||
|
find_package(Shiboken2 "2.0.0")
|
||||||
|
find_package(Python3 COMPONENTS Development)
|
||||||
|
set_package_properties(PySide2 PROPERTIES DESCRIPTION "Python plugins" TYPE OPTIONAL)
|
||||||
|
set_package_properties(Shiboken2 PROPERTIES DESCRIPTION "Python plugins" TYPE OPTIONAL)
|
||||||
|
set_package_properties(Python3 PROPERTIES DESCRIPTION "Python plugins" TYPE OPTIONAL)
|
||||||
|
if (PySide2_FOUND AND Shiboken2_FOUND AND Python3_FOUND)
|
||||||
|
set(ENABLE_PYTHON_PLUGINS TRUE)
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
|
@ -41,7 +41,7 @@ void QmlUserScriptApiTest::testCount()
|
||||||
void QmlUserScriptApiTest::testSize()
|
void QmlUserScriptApiTest::testSize()
|
||||||
{
|
{
|
||||||
int size = m_testHelper.evaluate("Falkon.UserScripts.size").toInt();
|
int size = m_testHelper.evaluate("Falkon.UserScripts.size").toInt();
|
||||||
QCOMPARE(size, mApp->webProfile()->scripts()->size());
|
QCOMPARE(size, mApp->webProfile()->scripts()->count());
|
||||||
}
|
}
|
||||||
|
|
||||||
void QmlUserScriptApiTest::testEmpty()
|
void QmlUserScriptApiTest::testEmpty()
|
||||||
|
|
7
src/lib/3rdparty/fancytabwidget.cpp
vendored
7
src/lib/3rdparty/fancytabwidget.cpp
vendored
|
@ -39,10 +39,11 @@
|
||||||
#include <QSignalMapper>
|
#include <QSignalMapper>
|
||||||
#include <QSplitter>
|
#include <QSplitter>
|
||||||
#include <QStackedLayout>
|
#include <QStackedLayout>
|
||||||
#include <QStyleOptionTabV3>
|
#include <QStyleOptionTab>
|
||||||
#include <QToolButton>
|
#include <QToolButton>
|
||||||
#include <QToolTip>
|
#include <QToolTip>
|
||||||
#include <QVBoxLayout>
|
#include <QVBoxLayout>
|
||||||
|
#include <QActionGroup>
|
||||||
//#include <QWindowsStyle>
|
//#include <QWindowsStyle>
|
||||||
|
|
||||||
using namespace Core;
|
using namespace Core;
|
||||||
|
@ -306,7 +307,11 @@ void FancyTabBar::paintEvent(QPaintEvent* event)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||||
void FancyTab::enterEvent(QEvent*)
|
void FancyTab::enterEvent(QEvent*)
|
||||||
|
#else
|
||||||
|
void FancyTab::enterEvent(QEnterEvent*)
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
fadeIn();
|
fadeIn();
|
||||||
}
|
}
|
||||||
|
|
6
src/lib/3rdparty/fancytabwidget.h
vendored
6
src/lib/3rdparty/fancytabwidget.h
vendored
|
@ -86,7 +86,11 @@ public:
|
||||||
QString text;
|
QString text;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void enterEvent(QEvent*) override;
|
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||||
|
void enterEvent(QEvent *event) override;
|
||||||
|
#else
|
||||||
|
void enterEvent(QEnterEvent *event) override;
|
||||||
|
#endif
|
||||||
void leaveEvent(QEvent*) override;
|
void leaveEvent(QEvent*) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -44,6 +44,10 @@
|
||||||
#include <QDataStream>
|
#include <QDataStream>
|
||||||
#include <QTime>
|
#include <QTime>
|
||||||
|
|
||||||
|
#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
|
||||||
|
#include <QRegExp>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "../config.h"
|
#include "../config.h"
|
||||||
#if defined(Q_OS_LINUX) && !defined(DISABLE_DBUS)
|
#if defined(Q_OS_LINUX) && !defined(DISABLE_DBUS)
|
||||||
#define USE_DBUS
|
#define USE_DBUS
|
||||||
|
@ -110,7 +114,11 @@ QtLocalPeer::QtLocalPeer(QObject* parent, const QString &appId)
|
||||||
#endif
|
#endif
|
||||||
prefix = id.section(QLatin1Char('/'), -1);
|
prefix = id.section(QLatin1Char('/'), -1);
|
||||||
}
|
}
|
||||||
|
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||||
prefix.remove(QRegExp("[^a-zA-Z]"));
|
prefix.remove(QRegExp("[^a-zA-Z]"));
|
||||||
|
#else
|
||||||
|
prefix = QRegExp("[^a-zA-Z]").removeIn(prefix);
|
||||||
|
#endif
|
||||||
prefix.truncate(6);
|
prefix.truncate(6);
|
||||||
|
|
||||||
QByteArray idc = id.toUtf8();
|
QByteArray idc = id.toUtf8();
|
||||||
|
|
8
src/lib/3rdparty/stylehelper.cpp
vendored
8
src/lib/3rdparty/stylehelper.cpp
vendored
|
@ -160,7 +160,11 @@ void StyleHelper::verticalGradient(QPainter* painter, const QRect &spanRect, con
|
||||||
clipRect.height(), keyColor.rgb());
|
clipRect.height(), keyColor.rgb());
|
||||||
|
|
||||||
QPixmap pixmap;
|
QPixmap pixmap;
|
||||||
|
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||||
if (!QPixmapCache::find(key, pixmap)) {
|
if (!QPixmapCache::find(key, pixmap)) {
|
||||||
|
#else
|
||||||
|
if (!QPixmapCache::find(key, &pixmap)) {
|
||||||
|
#endif
|
||||||
pixmap = QPixmap(clipRect.size());
|
pixmap = QPixmap(clipRect.size());
|
||||||
QPainter p(&pixmap);
|
QPainter p(&pixmap);
|
||||||
QRect rect(0, 0, clipRect.width(), clipRect.height());
|
QRect rect(0, 0, clipRect.width(), clipRect.height());
|
||||||
|
@ -183,7 +187,11 @@ void StyleHelper::drawIconWithShadow(const QIcon &icon, const QRect &rect,
|
||||||
QPixmap cache;
|
QPixmap cache;
|
||||||
QString pixmapName = QSL("icon %0 %1 %2").arg(icon.cacheKey()).arg(iconMode).arg(rect.height());
|
QString pixmapName = QSL("icon %0 %1 %2").arg(icon.cacheKey()).arg(iconMode).arg(rect.height());
|
||||||
|
|
||||||
|
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||||
if (!QPixmapCache::find(pixmapName, cache)) {
|
if (!QPixmapCache::find(pixmapName, cache)) {
|
||||||
|
#else
|
||||||
|
if (!QPixmapCache::find(pixmapName, &cache)) {
|
||||||
|
#endif
|
||||||
QPixmap px = icon.pixmap(rect.size(), iconMode);
|
QPixmap px = icon.pixmap(rect.size(), iconMode);
|
||||||
px.setDevicePixelRatio(qApp->devicePixelRatio());
|
px.setDevicePixelRatio(qApp->devicePixelRatio());
|
||||||
cache = QPixmap(px.size() + QSize(radius * 2, radius * 2));
|
cache = QPixmap(px.size() + QSize(radius * 2, radius * 2));
|
||||||
|
|
|
@ -577,20 +577,41 @@ qt_add_resources(SRCS
|
||||||
|
|
||||||
add_library(FalkonPrivate SHARED ${SRCS} ${LOGGING_SRCS})
|
add_library(FalkonPrivate SHARED ${SRCS} ${LOGGING_SRCS})
|
||||||
|
|
||||||
get_property(QT_WEBENGINE_INCLUDE_DIRS TARGET Qt::WebEngine PROPERTY INTERFACE_INCLUDE_DIRECTORIES)
|
if (QT_MAJOR_VERSION STREQUAL "6")
|
||||||
|
get_property(QT_WEBENGINE_INCLUDE_DIRS TARGET Qt6::WebEngineCore PROPERTY INTERFACE_INCLUDE_DIRECTORIES)
|
||||||
|
else()
|
||||||
|
get_property(QT_WEBENGINE_INCLUDE_DIRS TARGET Qt::WebEngine PROPERTY INTERFACE_INCLUDE_DIRECTORIES)
|
||||||
|
endif()
|
||||||
|
|
||||||
target_include_directories(FalkonPrivate SYSTEM PUBLIC ${QT_WEBENGINE_INCLUDE_DIRS})
|
target_include_directories(FalkonPrivate SYSTEM PUBLIC ${QT_WEBENGINE_INCLUDE_DIRS})
|
||||||
|
|
||||||
target_link_libraries(FalkonPrivate
|
if (QT_MAJOR_VERSION STREQUAL "6")
|
||||||
Qt::Widgets
|
target_link_libraries(FalkonPrivate
|
||||||
Qt::WebEngineWidgets
|
Qt6::Widgets
|
||||||
Qt::Network
|
Qt6::WebEngineWidgets
|
||||||
Qt::Sql
|
Qt6::Network
|
||||||
Qt::PrintSupport
|
Qt6::NetworkPrivate
|
||||||
Qt::QuickWidgets
|
Qt6::Sql
|
||||||
Qt::WebChannel
|
Qt6::PrintSupport
|
||||||
KF5::Archive
|
Qt6::QuickWidgets
|
||||||
${OPENSSL_CRYPTO_LIBRARY}
|
Qt6::WebChannel
|
||||||
)
|
Qt6::Core5Compat
|
||||||
|
KF6::Archive
|
||||||
|
${OPENSSL_CRYPTO_LIBRARY}
|
||||||
|
)
|
||||||
|
else()
|
||||||
|
target_link_libraries(FalkonPrivate
|
||||||
|
Qt::Widgets
|
||||||
|
Qt::WebEngineWidgets
|
||||||
|
Qt::Network
|
||||||
|
Qt::Sql
|
||||||
|
Qt::PrintSupport
|
||||||
|
Qt::QuickWidgets
|
||||||
|
Qt::WebChannel
|
||||||
|
KF5::Archive
|
||||||
|
${OPENSSL_CRYPTO_LIBRARY}
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
if (HAVE_LIBINTL)
|
if (HAVE_LIBINTL)
|
||||||
target_include_directories(FalkonPrivate SYSTEM PUBLIC ${Intl_INCLUDE_DIRS})
|
target_include_directories(FalkonPrivate SYSTEM PUBLIC ${Intl_INCLUDE_DIRS})
|
||||||
|
|
|
@ -296,7 +296,11 @@ void AdBlockManager::load()
|
||||||
}
|
}
|
||||||
|
|
||||||
QTextStream textStream(&file);
|
QTextStream textStream(&file);
|
||||||
|
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||||
textStream.setCodec("UTF-8");
|
textStream.setCodec("UTF-8");
|
||||||
|
#else
|
||||||
|
textStream.setEncoding(QStringConverter::Utf8);
|
||||||
|
#endif
|
||||||
QString title = textStream.readLine(1024).remove(QLatin1String("Title: "));
|
QString title = textStream.readLine(1024).remove(QLatin1String("Title: "));
|
||||||
QUrl url = QUrl(textStream.readLine(1024).remove(QLatin1String("Url: ")));
|
QUrl url = QUrl(textStream.readLine(1024).remove(QLatin1String("Url: ")));
|
||||||
|
|
||||||
|
|
|
@ -53,9 +53,40 @@
|
||||||
#include <QWebEnginePage>
|
#include <QWebEnginePage>
|
||||||
#include <QWebEngineUrlRequestInfo>
|
#include <QWebEngineUrlRequestInfo>
|
||||||
|
|
||||||
|
#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
|
||||||
|
#include <QtCore/private/qurl_p.h>
|
||||||
|
#include <QtNetwork/private/qtldurl_p.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
static QString getTopLevelDomain(const QUrl &url)
|
||||||
|
{
|
||||||
|
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||||
|
return url.topLevelDomain();
|
||||||
|
#else
|
||||||
|
// QUrl::topLevelDomain() was removed in Qt6.
|
||||||
|
// The following is copied from the old "qTopLevelDomain" code in Qt6::Network.
|
||||||
|
// It was removed in this commit: https://github.com/qt/qtbase/commit/50b30976837be0969efdccced68cfb584d99981a
|
||||||
|
const QString domainLower = url.host().toLower();
|
||||||
|
QVector<QStringView> sections = QStringView{domainLower}.split(QLatin1Char('.'), Qt::SkipEmptyParts);
|
||||||
|
if (sections.isEmpty())
|
||||||
|
return QString();
|
||||||
|
|
||||||
|
QString level, tld;
|
||||||
|
for (int j = sections.count() - 1; j >= 0; --j) {
|
||||||
|
level.prepend(QLatin1Char('.') + sections.at(j));
|
||||||
|
if (qIsEffectiveTLD(QStringView{level}.right(level.size() - 1)))
|
||||||
|
tld = level;
|
||||||
|
}
|
||||||
|
|
||||||
|
//return qt_ACE_do(tld, ToAceOnly, AllowLeadingDot, {});
|
||||||
|
// TODO - QUrl::toAce() uses ForbidLeadingDot, while the old QUrl::topLevelDomain() used AllowLeadingDot. Does this matter?
|
||||||
|
return QString(QUrl::toAce(tld));
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
static QString toSecondLevelDomain(const QUrl &url)
|
static QString toSecondLevelDomain(const QUrl &url)
|
||||||
{
|
{
|
||||||
const QString topLevelDomain = url.topLevelDomain();
|
const QString topLevelDomain = getTopLevelDomain(url);
|
||||||
const QString urlHost = url.host();
|
const QString urlHost = url.host();
|
||||||
|
|
||||||
if (topLevelDomain.isEmpty() || urlHost.isEmpty()) {
|
if (topLevelDomain.isEmpty() || urlHost.isEmpty()) {
|
||||||
|
|
|
@ -103,7 +103,11 @@ void AdBlockSubscription::loadSubscription(const QStringList &disabledRules)
|
||||||
}
|
}
|
||||||
|
|
||||||
QTextStream textStream(&file);
|
QTextStream textStream(&file);
|
||||||
textStream.setCodec("UTF-8");
|
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||||
|
textStream.setCodec("UTF-8");
|
||||||
|
#else
|
||||||
|
textStream.setEncoding(QStringConverter::Utf8);
|
||||||
|
#endif
|
||||||
// Header is on 3rd line
|
// Header is on 3rd line
|
||||||
textStream.readLine(1024);
|
textStream.readLine(1024);
|
||||||
textStream.readLine(1024);
|
textStream.readLine(1024);
|
||||||
|
@ -306,7 +310,11 @@ void AdBlockCustomList::loadSubscription(const QStringList &disabledRules)
|
||||||
|
|
||||||
if (file.open(QFile::WriteOnly | QFile::Append)) {
|
if (file.open(QFile::WriteOnly | QFile::Append)) {
|
||||||
QTextStream stream(&file);
|
QTextStream stream(&file);
|
||||||
|
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||||
stream.setCodec("UTF-8");
|
stream.setCodec("UTF-8");
|
||||||
|
#else
|
||||||
|
stream.setEncoding(QStringConverter::Utf8);
|
||||||
|
#endif
|
||||||
|
|
||||||
if (!rules.contains(ddg1 + QL1S("\n")))
|
if (!rules.contains(ddg1 + QL1S("\n")))
|
||||||
stream << ddg1 << Qt::endl;
|
stream << ddg1 << Qt::endl;
|
||||||
|
@ -329,7 +337,11 @@ void AdBlockCustomList::saveSubscription()
|
||||||
}
|
}
|
||||||
|
|
||||||
QTextStream textStream(&file);
|
QTextStream textStream(&file);
|
||||||
|
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||||
textStream.setCodec("UTF-8");
|
textStream.setCodec("UTF-8");
|
||||||
|
#else
|
||||||
|
textStream.setEncoding(QStringConverter::Utf8);
|
||||||
|
#endif
|
||||||
textStream << "Title: " << title() << Qt::endl;
|
textStream << "Title: " << title() << Qt::endl;
|
||||||
textStream << "Url: " << url().toString() << Qt::endl;
|
textStream << "Url: " << url().toString() << Qt::endl;
|
||||||
textStream << "[Adblock Plus 1.1.1]" << Qt::endl;
|
textStream << "[Adblock Plus 1.1.1]" << Qt::endl;
|
||||||
|
|
|
@ -72,11 +72,14 @@
|
||||||
#include <QWebEngineHistory>
|
#include <QWebEngineHistory>
|
||||||
#include <QWebEngineSettings>
|
#include <QWebEngineSettings>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
|
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||||
#include <QDesktopWidget>
|
#include <QDesktopWidget>
|
||||||
|
#endif
|
||||||
#include <QToolTip>
|
#include <QToolTip>
|
||||||
#include <QScrollArea>
|
#include <QScrollArea>
|
||||||
#include <QCollator>
|
#include <QCollator>
|
||||||
#include <QTemporaryFile>
|
#include <QTemporaryFile>
|
||||||
|
#include <QActionGroup>
|
||||||
|
|
||||||
#ifdef QZ_WS_X11
|
#ifdef QZ_WS_X11
|
||||||
#include <QX11Info>
|
#include <QX11Info>
|
||||||
|
@ -400,7 +403,11 @@ void BrowserWindow::setupUi()
|
||||||
m_statusBar->addButton(downloadsButton);
|
m_statusBar->addButton(downloadsButton);
|
||||||
m_navigationToolbar->addToolButton(downloadsButton);
|
m_navigationToolbar->addToolButton(downloadsButton);
|
||||||
|
|
||||||
|
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||||
QDesktopWidget* desktop = mApp->desktop();
|
QDesktopWidget* desktop = mApp->desktop();
|
||||||
|
#else
|
||||||
|
auto desktop = QGuiApplication::primaryScreen();
|
||||||
|
#endif
|
||||||
int windowWidth = desktop->availableGeometry().width() / 1.3;
|
int windowWidth = desktop->availableGeometry().width() / 1.3;
|
||||||
int windowHeight = desktop->availableGeometry().height() / 1.3;
|
int windowHeight = desktop->availableGeometry().height() / 1.3;
|
||||||
|
|
||||||
|
@ -1341,7 +1348,7 @@ void BrowserWindow::keyPressEvent(QKeyEvent* event)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Qt::Key_Backtab:
|
case Qt::Key_Backtab:
|
||||||
if (event->modifiers() == (Qt::ControlModifier + Qt::ShiftModifier)) {
|
if (event->modifiers() == (Qt::ControlModifier | Qt::ShiftModifier)) {
|
||||||
static_cast<QObject*>(m_tabWidget)->event(event);
|
static_cast<QObject*>(m_tabWidget)->event(event);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -62,7 +62,9 @@
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QStandardPaths>
|
#include <QStandardPaths>
|
||||||
#include <QWebEngineProfile>
|
#include <QWebEngineProfile>
|
||||||
|
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||||
#include <QWebEngineDownloadItem>
|
#include <QWebEngineDownloadItem>
|
||||||
|
#endif
|
||||||
#include <QWebEngineScriptCollection>
|
#include <QWebEngineScriptCollection>
|
||||||
#include <QRegularExpression>
|
#include <QRegularExpression>
|
||||||
#include <QtWebEngineWidgetsVersion>
|
#include <QtWebEngineWidgetsVersion>
|
||||||
|
@ -930,7 +932,11 @@ void MainApplication::runDeferredPostLaunchActions()
|
||||||
checkOptimizeDatabase();
|
checkOptimizeDatabase();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||||
void MainApplication::downloadRequested(QWebEngineDownloadItem *download)
|
void MainApplication::downloadRequested(QWebEngineDownloadItem *download)
|
||||||
|
#else
|
||||||
|
void MainApplication::downloadRequested(QWebEngineDownloadRequest *download)
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
downloadManager()->download(download);
|
downloadManager()->download(download);
|
||||||
}
|
}
|
||||||
|
@ -1187,10 +1193,16 @@ void MainApplication::setUserStyleSheet(const QString &filePath)
|
||||||
|
|
||||||
const QString name = QStringLiteral("_falkon_userstylesheet");
|
const QString name = QStringLiteral("_falkon_userstylesheet");
|
||||||
|
|
||||||
|
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||||
QWebEngineScript oldScript = m_webProfile->scripts()->findScript(name);
|
QWebEngineScript oldScript = m_webProfile->scripts()->findScript(name);
|
||||||
if (!oldScript.isNull()) {
|
if (!oldScript.isNull()) {
|
||||||
m_webProfile->scripts()->remove(oldScript);
|
m_webProfile->scripts()->remove(oldScript);
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
for (const QWebEngineScript &oldScript : m_webProfile->scripts()->find(name)) {
|
||||||
|
m_webProfile->scripts()->remove(oldScript);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if (userCss.isEmpty())
|
if (userCss.isEmpty())
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -31,7 +31,11 @@ class QMenu;
|
||||||
class QWebEngineProfile;
|
class QWebEngineProfile;
|
||||||
class QWebEngineSettings;
|
class QWebEngineSettings;
|
||||||
class QNetworkAccessManager;
|
class QNetworkAccessManager;
|
||||||
|
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||||
class QWebEngineDownloadItem;
|
class QWebEngineDownloadItem;
|
||||||
|
#else
|
||||||
|
class QWebEngineDownloadRequest;
|
||||||
|
#endif
|
||||||
|
|
||||||
class History;
|
class History;
|
||||||
class AutoFill;
|
class AutoFill;
|
||||||
|
@ -146,7 +150,11 @@ private Q_SLOTS:
|
||||||
void onFocusChanged();
|
void onFocusChanged();
|
||||||
void runDeferredPostLaunchActions();
|
void runDeferredPostLaunchActions();
|
||||||
|
|
||||||
|
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||||
void downloadRequested(QWebEngineDownloadItem *download);
|
void downloadRequested(QWebEngineDownloadItem *download);
|
||||||
|
#else
|
||||||
|
void downloadRequested(QWebEngineDownloadRequest *download);
|
||||||
|
#endif
|
||||||
|
|
||||||
private:
|
private:
|
||||||
enum PostLaunchAction {
|
enum PostLaunchAction {
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
|
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QFlags>
|
#include <QFlags>
|
||||||
#include <QtWebEngine/QtWebEngineVersion>
|
#include <QtWebEngineCore/QtWebEngineCoreVersion>
|
||||||
|
|
||||||
#ifdef FALKON_SHAREDLIBRARY
|
#ifdef FALKON_SHAREDLIBRARY
|
||||||
#define FALKON_EXPORT Q_DECL_EXPORT
|
#define FALKON_EXPORT Q_DECL_EXPORT
|
||||||
|
|
|
@ -249,7 +249,11 @@ QByteArray AutoFill::exportPasswords()
|
||||||
QByteArray output;
|
QByteArray output;
|
||||||
|
|
||||||
QXmlStreamWriter stream(&output);
|
QXmlStreamWriter stream(&output);
|
||||||
stream.setCodec("UTF-8");
|
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||||
|
stream.setCodec("UTF-8");
|
||||||
|
#else
|
||||||
|
stream.setEncoding(QStringConverter::Utf8);
|
||||||
|
#endif
|
||||||
stream.setAutoFormatting(true);
|
stream.setAutoFormatting(true);
|
||||||
|
|
||||||
stream.writeStartDocument();
|
stream.writeStartDocument();
|
||||||
|
|
|
@ -49,7 +49,11 @@ bool HtmlExporter::exportBookmarks(BookmarkItem* root)
|
||||||
}
|
}
|
||||||
|
|
||||||
QTextStream stream(&file);
|
QTextStream stream(&file);
|
||||||
stream.setCodec("UTF-8");
|
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||||
|
stream.setCodec("UTF-8");
|
||||||
|
#else
|
||||||
|
stream.setEncoding(QStringConverter::Utf8);
|
||||||
|
#endif
|
||||||
|
|
||||||
stream << "<!DOCTYPE NETSCAPE-Bookmark-file-1>" << Qt::endl;
|
stream << "<!DOCTYPE NETSCAPE-Bookmark-file-1>" << Qt::endl;
|
||||||
stream << "<!-- This is an automatically generated file." << Qt::endl;
|
stream << "<!-- This is an automatically generated file." << Qt::endl;
|
||||||
|
|
|
@ -25,7 +25,11 @@
|
||||||
OperaImporter::OperaImporter(QObject* parent)
|
OperaImporter::OperaImporter(QObject* parent)
|
||||||
: BookmarksImporter(parent)
|
: BookmarksImporter(parent)
|
||||||
{
|
{
|
||||||
m_stream.setCodec("UTF-8");
|
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||||
|
m_stream.setCodec("UTF-8");
|
||||||
|
#else
|
||||||
|
m_stream.setEncoding(QStringConverter::Utf8);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
QString OperaImporter::description() const
|
QString OperaImporter::description() const
|
||||||
|
|
|
@ -23,6 +23,8 @@
|
||||||
|
|
||||||
#include "qzcommon.h"
|
#include "qzcommon.h"
|
||||||
|
|
||||||
|
#include "bookmarkitem.h"
|
||||||
|
|
||||||
namespace Ui
|
namespace Ui
|
||||||
{
|
{
|
||||||
class BookmarksManager;
|
class BookmarksManager;
|
||||||
|
@ -32,7 +34,6 @@ class QUrl;
|
||||||
|
|
||||||
class BrowserWindow;
|
class BrowserWindow;
|
||||||
class Bookmarks;
|
class Bookmarks;
|
||||||
class BookmarkItem;
|
|
||||||
|
|
||||||
class FALKON_EXPORT BookmarksManager : public QWidget
|
class FALKON_EXPORT BookmarksManager : public QWidget
|
||||||
{
|
{
|
||||||
|
|
|
@ -22,6 +22,7 @@
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
#include <QStyle>
|
#include <QStyle>
|
||||||
|
#include <QIODevice>
|
||||||
|
|
||||||
//#define BOOKMARKSMODEL_DEBUG
|
//#define BOOKMARKSMODEL_DEBUG
|
||||||
|
|
||||||
|
|
|
@ -44,8 +44,9 @@ BookmarksToolbar::BookmarksToolbar(BrowserWindow* window, QWidget* parent)
|
||||||
setContextMenuPolicy(Qt::CustomContextMenu);
|
setContextMenuPolicy(Qt::CustomContextMenu);
|
||||||
|
|
||||||
m_layout = new QHBoxLayout(this);
|
m_layout = new QHBoxLayout(this);
|
||||||
m_layout->setMargin(style()->pixelMetric(QStyle::PM_ToolBarItemMargin, 0, this)
|
auto contentsMargin = style()->pixelMetric(QStyle::PM_ToolBarItemMargin, 0, this)
|
||||||
+ style()->pixelMetric(QStyle::PM_ToolBarFrameWidth, 0, this));
|
+ style()->pixelMetric(QStyle::PM_ToolBarFrameWidth, 0, this);
|
||||||
|
m_layout->setContentsMargins(contentsMargin, contentsMargin, contentsMargin, contentsMargin);
|
||||||
m_layout->setSpacing(style()->pixelMetric(QStyle::PM_ToolBarItemSpacing, 0, this));
|
m_layout->setSpacing(style()->pixelMetric(QStyle::PM_ToolBarItemSpacing, 0, this));
|
||||||
setLayout(m_layout);
|
setLayout(m_layout);
|
||||||
|
|
||||||
|
|
|
@ -256,7 +256,11 @@ QString BookmarksToolbarButton::createTooltip() const
|
||||||
return m_bookmark->urlString();
|
return m_bookmark->urlString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||||
void BookmarksToolbarButton::enterEvent(QEvent* event)
|
void BookmarksToolbarButton::enterEvent(QEvent* event)
|
||||||
|
#else
|
||||||
|
void BookmarksToolbarButton::enterEvent(QEnterEvent* event)
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
QPushButton::enterEvent(event);
|
QPushButton::enterEvent(event);
|
||||||
|
|
||||||
|
|
|
@ -63,7 +63,11 @@ private:
|
||||||
void init();
|
void init();
|
||||||
QString createTooltip() const;
|
QString createTooltip() const;
|
||||||
|
|
||||||
void enterEvent(QEvent* event) override;
|
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||||
|
void enterEvent(QEvent *event) override;
|
||||||
|
#else
|
||||||
|
void enterEvent(QEnterEvent *event) override;
|
||||||
|
#endif
|
||||||
void leaveEvent(QEvent* event) override;
|
void leaveEvent(QEvent* event) override;
|
||||||
void mousePressEvent(QMouseEvent* event) override;
|
void mousePressEvent(QMouseEvent* event) override;
|
||||||
void mouseReleaseEvent(QMouseEvent* event) override;
|
void mouseReleaseEvent(QMouseEvent* event) override;
|
||||||
|
|
|
@ -35,7 +35,11 @@
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include <QFileIconProvider>
|
#include <QFileIconProvider>
|
||||||
#include <QDesktopServices>
|
#include <QDesktopServices>
|
||||||
|
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||||
#include <QWebEngineDownloadItem>
|
#include <QWebEngineDownloadItem>
|
||||||
|
#else
|
||||||
|
#include <QWebEngineDownloadRequest>
|
||||||
|
#endif
|
||||||
#include <QtWebEngineWidgetsVersion>
|
#include <QtWebEngineWidgetsVersion>
|
||||||
|
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
|
@ -45,7 +49,7 @@
|
||||||
|
|
||||||
//#define DOWNMANAGER_DEBUG
|
//#define DOWNMANAGER_DEBUG
|
||||||
|
|
||||||
DownloadItem::DownloadItem(QListWidgetItem *item, QWebEngineDownloadItem* downloadItem, const QString &path, const QString &fileName, bool openFile, DownloadManager* manager)
|
DownloadItem::DownloadItem(QListWidgetItem *item, Q_WEB_ENGINE_DOWNLOAD_ITEM_CLASS* downloadItem, const QString &path, const QString &fileName, bool openFile, DownloadManager* manager)
|
||||||
: QWidget()
|
: QWidget()
|
||||||
, ui(new Ui::DownloadItem)
|
, ui(new Ui::DownloadItem)
|
||||||
, m_item(item)
|
, m_item(item)
|
||||||
|
@ -81,11 +85,17 @@ DownloadItem::DownloadItem(QListWidgetItem *item, QWebEngineDownloadItem* downlo
|
||||||
|
|
||||||
void DownloadItem::startDownloading()
|
void DownloadItem::startDownloading()
|
||||||
{
|
{
|
||||||
|
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||||
connect(m_download, &QWebEngineDownloadItem::finished, this, &DownloadItem::finished);
|
connect(m_download, &QWebEngineDownloadItem::finished, this, &DownloadItem::finished);
|
||||||
connect(m_download, &QWebEngineDownloadItem::downloadProgress, this, &DownloadItem::downloadProgress);
|
connect(m_download, &QWebEngineDownloadItem::downloadProgress, this, &DownloadItem::downloadProgress);
|
||||||
|
#else
|
||||||
|
connect(m_download, &QWebEngineDownloadRequest::isFinishedChanged, this, &DownloadItem::finished);
|
||||||
|
connect(m_download, &QWebEngineDownloadRequest::receivedBytesChanged, this, &DownloadItem::receivedOrTotalBytesChanged);
|
||||||
|
connect(m_download, &QWebEngineDownloadRequest::totalBytesChanged, this, &DownloadItem::receivedOrTotalBytesChanged);
|
||||||
|
#endif
|
||||||
|
|
||||||
m_downloading = true;
|
m_downloading = true;
|
||||||
if (m_downTimer.elapsed() < 1) {
|
if (!m_downTimer.isValid()) {
|
||||||
m_downTimer.start();
|
m_downTimer.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -123,16 +133,16 @@ void DownloadItem::finished()
|
||||||
QString host = m_download->url().host();
|
QString host = m_download->url().host();
|
||||||
|
|
||||||
switch (m_download->state()) {
|
switch (m_download->state()) {
|
||||||
case QWebEngineDownloadItem::DownloadCompleted:
|
case Q_WEB_ENGINE_DOWNLOAD_ITEM_CLASS::DownloadCompleted:
|
||||||
success = true;
|
success = true;
|
||||||
ui->downloadInfo->setText(tr("Done - %1 (%2)").arg(host, QDateTime::currentDateTime().toString(Qt::DefaultLocaleShortDate)));
|
ui->downloadInfo->setText(tr("Done - %1 (%2)").arg(host, QLocale().toString(QDateTime::currentDateTime(), QLocale::ShortFormat)));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case QWebEngineDownloadItem::DownloadInterrupted:
|
case Q_WEB_ENGINE_DOWNLOAD_ITEM_CLASS::DownloadInterrupted:
|
||||||
ui->downloadInfo->setText(tr("Error - %1").arg(host));
|
ui->downloadInfo->setText(tr("Error - %1").arg(host));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case QWebEngineDownloadItem::DownloadCancelled:
|
case Q_WEB_ENGINE_DOWNLOAD_ITEM_CLASS::DownloadCancelled:
|
||||||
ui->downloadInfo->setText(tr("Cancelled - %1").arg(host));
|
ui->downloadInfo->setText(tr("Cancelled - %1").arg(host));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -154,8 +164,15 @@ void DownloadItem::finished()
|
||||||
Q_EMIT downloadFinished(true);
|
Q_EMIT downloadFinished(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||||
void DownloadItem::downloadProgress(qint64 received, qint64 total)
|
void DownloadItem::downloadProgress(qint64 received, qint64 total)
|
||||||
{
|
{
|
||||||
|
#else
|
||||||
|
void DownloadItem::receivedOrTotalBytesChanged()
|
||||||
|
{
|
||||||
|
qint64 received = m_download->receivedBytes();
|
||||||
|
qint64 total = m_download->totalBytes();
|
||||||
|
#endif
|
||||||
#ifdef DOWNMANAGER_DEBUG
|
#ifdef DOWNMANAGER_DEBUG
|
||||||
qDebug() << __FUNCTION__ << received << total;
|
qDebug() << __FUNCTION__ << received << total;
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -25,6 +25,7 @@
|
||||||
#include <QNetworkReply>
|
#include <QNetworkReply>
|
||||||
#include <QElapsedTimer>
|
#include <QElapsedTimer>
|
||||||
#include <QTime>
|
#include <QTime>
|
||||||
|
#include <QElapsedTimer>
|
||||||
|
|
||||||
#include "qzcommon.h"
|
#include "qzcommon.h"
|
||||||
|
|
||||||
|
@ -34,7 +35,13 @@ class DownloadItem;
|
||||||
}
|
}
|
||||||
|
|
||||||
class QListWidgetItem;
|
class QListWidgetItem;
|
||||||
|
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||||
class QWebEngineDownloadItem;
|
class QWebEngineDownloadItem;
|
||||||
|
#define Q_WEB_ENGINE_DOWNLOAD_ITEM_CLASS QWebEngineDownloadItem
|
||||||
|
#else
|
||||||
|
class QWebEngineDownloadRequest;
|
||||||
|
#define Q_WEB_ENGINE_DOWNLOAD_ITEM_CLASS QWebEngineDownloadRequest
|
||||||
|
#endif
|
||||||
|
|
||||||
class DownloadManager;
|
class DownloadManager;
|
||||||
|
|
||||||
|
@ -43,7 +50,7 @@ class FALKON_EXPORT DownloadItem : public QWidget
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit DownloadItem(QListWidgetItem* item, QWebEngineDownloadItem* downloadItem, const QString &path, const QString &fileName, bool openFile, DownloadManager* manager);
|
explicit DownloadItem(QListWidgetItem* item, Q_WEB_ENGINE_DOWNLOAD_ITEM_CLASS* downloadItem, const QString &path, const QString &fileName, bool openFile, DownloadManager* manager);
|
||||||
bool isDownloading() const { return m_downloading; }
|
bool isDownloading() const { return m_downloading; }
|
||||||
bool isCancelled();
|
bool isCancelled();
|
||||||
QTime remainingTime() const { return m_remTime; }
|
QTime remainingTime() const { return m_remTime; }
|
||||||
|
@ -68,7 +75,11 @@ Q_SIGNALS:
|
||||||
private Q_SLOTS:
|
private Q_SLOTS:
|
||||||
void parentResized(const QSize &size);
|
void parentResized(const QSize &size);
|
||||||
void finished();
|
void finished();
|
||||||
|
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||||
void downloadProgress(qint64 received, qint64 total);
|
void downloadProgress(qint64 received, qint64 total);
|
||||||
|
#else
|
||||||
|
void receivedOrTotalBytesChanged();
|
||||||
|
#endif
|
||||||
void stop();
|
void stop();
|
||||||
void pauseResume();
|
void pauseResume();
|
||||||
void openFile();
|
void openFile();
|
||||||
|
@ -85,7 +96,7 @@ private:
|
||||||
Ui::DownloadItem* ui;
|
Ui::DownloadItem* ui;
|
||||||
|
|
||||||
QListWidgetItem* m_item;
|
QListWidgetItem* m_item;
|
||||||
QWebEngineDownloadItem* m_download;
|
Q_WEB_ENGINE_DOWNLOAD_ITEM_CLASS* m_download;
|
||||||
QString m_path;
|
QString m_path;
|
||||||
QString m_fileName;
|
QString m_fileName;
|
||||||
QElapsedTimer m_downTimer;
|
QElapsedTimer m_downTimer;
|
||||||
|
|
|
@ -40,7 +40,11 @@
|
||||||
#include <QShortcut>
|
#include <QShortcut>
|
||||||
#include <QStandardPaths>
|
#include <QStandardPaths>
|
||||||
#include <QWebEngineHistory>
|
#include <QWebEngineHistory>
|
||||||
|
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||||
#include <QWebEngineDownloadItem>
|
#include <QWebEngineDownloadItem>
|
||||||
|
#else
|
||||||
|
#include <QWebEngineDownloadRequest>
|
||||||
|
#endif
|
||||||
#include <QtWebEngineWidgetsVersion>
|
#include <QtWebEngineWidgetsVersion>
|
||||||
|
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
|
@ -123,7 +127,11 @@ void DownloadManager::keyPressEvent(QKeyEvent* e)
|
||||||
QWidget::keyPressEvent(e);
|
QWidget::keyPressEvent(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||||
void DownloadManager::closeDownloadTab(QWebEngineDownloadItem *item) const
|
void DownloadManager::closeDownloadTab(QWebEngineDownloadItem *item) const
|
||||||
|
#else
|
||||||
|
void DownloadManager::closeDownloadTab(QWebEngineDownloadRequest *item) const
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
// Attempt to close empty tab that was opened only for loading the download url
|
// Attempt to close empty tab that was opened only for loading the download url
|
||||||
auto testWebView = [](TabbedWebView *view, const QUrl &url) {
|
auto testWebView = [](TabbedWebView *view, const QUrl &url) {
|
||||||
|
@ -258,7 +266,7 @@ void DownloadManager::clearList()
|
||||||
Q_EMIT downloadsCountChanged();
|
Q_EMIT downloadsCountChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
void DownloadManager::download(QWebEngineDownloadItem *downloadItem)
|
void DownloadManager::download(Q_WEB_ENGINE_DOWNLOAD_ITEM_CLASS *downloadItem)
|
||||||
{
|
{
|
||||||
QElapsedTimer downloadTimer;
|
QElapsedTimer downloadTimer;
|
||||||
downloadTimer.start();
|
downloadTimer.start();
|
||||||
|
@ -268,10 +276,14 @@ void DownloadManager::download(QWebEngineDownloadItem *downloadItem)
|
||||||
QString downloadPath;
|
QString downloadPath;
|
||||||
bool openFile = false;
|
bool openFile = false;
|
||||||
|
|
||||||
|
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||||
const QString fileName = QFileInfo(downloadItem->path()).fileName();
|
const QString fileName = QFileInfo(downloadItem->path()).fileName();
|
||||||
|
#else
|
||||||
|
const QString fileName = downloadItem->downloadFileName();
|
||||||
|
#endif
|
||||||
|
|
||||||
const bool forceAsk = downloadItem->savePageFormat() != QWebEngineDownloadItem::UnknownSaveFormat
|
const bool forceAsk = downloadItem->savePageFormat() != Q_WEB_ENGINE_DOWNLOAD_ITEM_CLASS::UnknownSaveFormat
|
||||||
|| downloadItem->type() == QWebEngineDownloadItem::UserRequested;
|
|| downloadItem->isSavePageDownload();
|
||||||
|
|
||||||
if (m_useExternalManager) {
|
if (m_useExternalManager) {
|
||||||
startExternalManager(downloadItem->url());
|
startExternalManager(downloadItem->url());
|
||||||
|
@ -279,10 +291,10 @@ void DownloadManager::download(QWebEngineDownloadItem *downloadItem)
|
||||||
enum Result { Open = 1, Save = 2, ExternalManager = 3, SavePage = 4, Unknown = 0 };
|
enum Result { Open = 1, Save = 2, ExternalManager = 3, SavePage = 4, Unknown = 0 };
|
||||||
Result result = Unknown;
|
Result result = Unknown;
|
||||||
|
|
||||||
if (downloadItem->savePageFormat() != QWebEngineDownloadItem::UnknownSaveFormat) {
|
if (downloadItem->savePageFormat() != Q_WEB_ENGINE_DOWNLOAD_ITEM_CLASS::UnknownSaveFormat) {
|
||||||
// Save Page requested
|
// Save Page requested
|
||||||
result = SavePage;
|
result = SavePage;
|
||||||
} else if (downloadItem->type() == QWebEngineDownloadItem::UserRequested) {
|
} else if (downloadItem->isSavePageDownload()) {
|
||||||
// Save x as... requested
|
// Save x as... requested
|
||||||
result = Save;
|
result = Save;
|
||||||
} else {
|
} else {
|
||||||
|
@ -326,17 +338,17 @@ void DownloadManager::download(QWebEngineDownloadItem *downloadItem)
|
||||||
Settings().setValue(QSL("DownloadManager/lastDownloadPath"), m_lastDownloadPath);
|
Settings().setValue(QSL("DownloadManager/lastDownloadPath"), m_lastDownloadPath);
|
||||||
m_lastDownloadOption = SaveFile;
|
m_lastDownloadOption = SaveFile;
|
||||||
|
|
||||||
QWebEngineDownloadItem::SavePageFormat format = QWebEngineDownloadItem::UnknownSaveFormat;
|
Q_WEB_ENGINE_DOWNLOAD_ITEM_CLASS::SavePageFormat format = Q_WEB_ENGINE_DOWNLOAD_ITEM_CLASS::UnknownSaveFormat;
|
||||||
|
|
||||||
if (selectedFilter == mhtml) {
|
if (selectedFilter == mhtml) {
|
||||||
format = QWebEngineDownloadItem::MimeHtmlSaveFormat;
|
format = Q_WEB_ENGINE_DOWNLOAD_ITEM_CLASS::MimeHtmlSaveFormat;
|
||||||
} else if (selectedFilter == htmlSingle) {
|
} else if (selectedFilter == htmlSingle) {
|
||||||
format = QWebEngineDownloadItem::SingleHtmlSaveFormat;
|
format = Q_WEB_ENGINE_DOWNLOAD_ITEM_CLASS::SingleHtmlSaveFormat;
|
||||||
} else if (selectedFilter == htmlComplete) {
|
} else if (selectedFilter == htmlComplete) {
|
||||||
format = QWebEngineDownloadItem::CompleteHtmlSaveFormat;
|
format = Q_WEB_ENGINE_DOWNLOAD_ITEM_CLASS::CompleteHtmlSaveFormat;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (format != QWebEngineDownloadItem::UnknownSaveFormat) {
|
if (format != Q_WEB_ENGINE_DOWNLOAD_ITEM_CLASS::UnknownSaveFormat) {
|
||||||
downloadItem->setSavePageFormat(format);
|
downloadItem->setSavePageFormat(format);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -361,7 +373,12 @@ void DownloadManager::download(QWebEngineDownloadItem *downloadItem)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set download path and accept
|
// Set download path and accept
|
||||||
|
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||||
downloadItem->setPath(downloadPath);
|
downloadItem->setPath(downloadPath);
|
||||||
|
#else
|
||||||
|
downloadItem->setDownloadDirectory(QFileInfo(downloadPath).absoluteDir().absolutePath());
|
||||||
|
downloadItem->setDownloadFileName(QFileInfo(downloadPath).fileName());
|
||||||
|
#endif
|
||||||
downloadItem->accept();
|
downloadItem->accept();
|
||||||
|
|
||||||
// Create download item
|
// Create download item
|
||||||
|
|
|
@ -32,7 +32,11 @@ class DownloadManager;
|
||||||
class QUrl;
|
class QUrl;
|
||||||
class QNetworkAccessManager;
|
class QNetworkAccessManager;
|
||||||
class QListWidgetItem;
|
class QListWidgetItem;
|
||||||
|
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||||
class QWebEngineDownloadItem;
|
class QWebEngineDownloadItem;
|
||||||
|
#else
|
||||||
|
class QWebEngineDownloadRequest;
|
||||||
|
#endif
|
||||||
class QWinTaskbarButton;
|
class QWinTaskbarButton;
|
||||||
|
|
||||||
class DownloadItem;
|
class DownloadItem;
|
||||||
|
@ -65,7 +69,11 @@ public:
|
||||||
|
|
||||||
void loadSettings();
|
void loadSettings();
|
||||||
|
|
||||||
|
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||||
void download(QWebEngineDownloadItem *downloadItem);
|
void download(QWebEngineDownloadItem *downloadItem);
|
||||||
|
#else
|
||||||
|
void download(QWebEngineDownloadRequest *downloadItem);
|
||||||
|
#endif
|
||||||
|
|
||||||
int downloadsCount() const;
|
int downloadsCount() const;
|
||||||
int activeDownloadsCount() const;
|
int activeDownloadsCount() const;
|
||||||
|
@ -98,7 +106,11 @@ private:
|
||||||
void resizeEvent(QResizeEvent* e) override;
|
void resizeEvent(QResizeEvent* e) override;
|
||||||
void keyPressEvent(QKeyEvent* e) override;
|
void keyPressEvent(QKeyEvent* e) override;
|
||||||
|
|
||||||
|
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||||
void closeDownloadTab(QWebEngineDownloadItem *item) const;
|
void closeDownloadTab(QWebEngineDownloadItem *item) const;
|
||||||
|
#else
|
||||||
|
void closeDownloadTab(QWebEngineDownloadRequest *item) const;
|
||||||
|
#endif
|
||||||
QWinTaskbarButton *taskbarButton();
|
QWinTaskbarButton *taskbarButton();
|
||||||
|
|
||||||
Ui::DownloadManager* ui;
|
Ui::DownloadManager* ui;
|
||||||
|
|
|
@ -21,9 +21,13 @@
|
||||||
|
|
||||||
#include <QClipboard>
|
#include <QClipboard>
|
||||||
#include <QMimeDatabase>
|
#include <QMimeDatabase>
|
||||||
|
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||||
#include <QWebEngineDownloadItem>
|
#include <QWebEngineDownloadItem>
|
||||||
|
#else
|
||||||
|
#include <QWebEngineDownloadRequest>
|
||||||
|
#endif
|
||||||
|
|
||||||
DownloadOptionsDialog::DownloadOptionsDialog(const QString &fileName, QWebEngineDownloadItem *downloadItem, QWidget *parent)
|
DownloadOptionsDialog::DownloadOptionsDialog(const QString &fileName, Q_WEB_ENGINE_DOWNLOAD_ITEM_CLASS *downloadItem, QWidget *parent)
|
||||||
: QDialog(parent)
|
: QDialog(parent)
|
||||||
, ui(new Ui::DownloadOptionsDialog)
|
, ui(new Ui::DownloadOptionsDialog)
|
||||||
, m_downloadItem(downloadItem)
|
, m_downloadItem(downloadItem)
|
||||||
|
|
|
@ -23,20 +23,25 @@
|
||||||
|
|
||||||
#include "qzcommon.h"
|
#include "qzcommon.h"
|
||||||
#include "downloadmanager.h"
|
#include "downloadmanager.h"
|
||||||
|
#include "downloaditem.h"
|
||||||
|
|
||||||
namespace Ui
|
namespace Ui
|
||||||
{
|
{
|
||||||
class DownloadOptionsDialog;
|
class DownloadOptionsDialog;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||||
class QWebEngineDownloadItem;
|
class QWebEngineDownloadItem;
|
||||||
|
#else
|
||||||
|
class QWebEngineDownloadRequest;
|
||||||
|
#endif
|
||||||
|
|
||||||
class FALKON_EXPORT DownloadOptionsDialog : public QDialog
|
class FALKON_EXPORT DownloadOptionsDialog : public QDialog
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit DownloadOptionsDialog(const QString &fileName, QWebEngineDownloadItem *downloadItem, QWidget* parent = nullptr);
|
explicit DownloadOptionsDialog(const QString &fileName, Q_WEB_ENGINE_DOWNLOAD_ITEM_CLASS *downloadItem, QWidget* parent = nullptr);
|
||||||
~DownloadOptionsDialog() override;
|
~DownloadOptionsDialog() override;
|
||||||
|
|
||||||
void showExternalManagerOption(bool show);
|
void showExternalManagerOption(bool show);
|
||||||
|
@ -56,7 +61,7 @@ Q_SIGNALS:
|
||||||
private:
|
private:
|
||||||
Ui::DownloadOptionsDialog* ui;
|
Ui::DownloadOptionsDialog* ui;
|
||||||
|
|
||||||
QWebEngineDownloadItem *m_downloadItem;
|
Q_WEB_ENGINE_DOWNLOAD_ITEM_CLASS *m_downloadItem;
|
||||||
bool m_signalEmited;
|
bool m_signalEmited;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -242,10 +242,10 @@ void HistoryMenu::init()
|
||||||
act->setShortcut(QzTools::actionShortcut(QKeySequence::Forward, Qt::ALT + Qt::Key_Right, QKeySequence::Back, Qt::ALT + Qt::Key_Left));
|
act->setShortcut(QzTools::actionShortcut(QKeySequence::Forward, Qt::ALT + Qt::Key_Right, QKeySequence::Back, Qt::ALT + Qt::Key_Left));
|
||||||
|
|
||||||
act = addAction(QIcon::fromTheme("go-home"), tr("&Home"), this, &HistoryMenu::goHome);
|
act = addAction(QIcon::fromTheme("go-home"), tr("&Home"), this, &HistoryMenu::goHome);
|
||||||
act->setShortcut(QKeySequence(Qt::ALT + Qt::Key_Home));
|
act->setShortcut(QKeySequence(Qt::ALT | Qt::Key_Home));
|
||||||
|
|
||||||
act = addAction(QIcon::fromTheme("deep-history", QIcon(":/icons/menu/history.svg")), tr("Show &All History"), this, &HistoryMenu::showHistoryManager);
|
act = addAction(QIcon::fromTheme("deep-history", QIcon(":/icons/menu/history.svg")), tr("Show &All History"), this, &HistoryMenu::showHistoryManager);
|
||||||
act->setShortcut(QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_H));
|
act->setShortcut(QKeySequence(Qt::CTRL | Qt::SHIFT | Qt::Key_H));
|
||||||
|
|
||||||
addSeparator();
|
addSeparator();
|
||||||
|
|
||||||
|
|
|
@ -324,7 +324,11 @@ int LocationCompleterDelegate::viewItemDrawText(QPainter *p, const QStyleOptionV
|
||||||
highlightParts << highlightedPart;
|
highlightParts << highlightedPart;
|
||||||
}
|
}
|
||||||
|
|
||||||
textLayout.setAdditionalFormats(highlightParts);
|
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||||
|
textLayout.setFormats(QVector<QTextLayout::FormatRange>::fromList(highlightParts));
|
||||||
|
#else
|
||||||
|
textLayout.setFormats(highlightParts);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -40,7 +40,11 @@ LocationCompleterRefreshJob::LocationCompleterRefreshJob(const QString &searchSt
|
||||||
m_watcher = new QFutureWatcher<void>(this);
|
m_watcher = new QFutureWatcher<void>(this);
|
||||||
connect(m_watcher, &QFutureWatcherBase::finished, this, &LocationCompleterRefreshJob::slotFinished);
|
connect(m_watcher, &QFutureWatcherBase::finished, this, &LocationCompleterRefreshJob::slotFinished);
|
||||||
|
|
||||||
|
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||||
QFuture<void> future = QtConcurrent::run(this, &LocationCompleterRefreshJob::runJob);
|
QFuture<void> future = QtConcurrent::run(this, &LocationCompleterRefreshJob::runJob);
|
||||||
|
#else
|
||||||
|
QFuture<void> future = QtConcurrent::run(&LocationCompleterRefreshJob::runJob, this);
|
||||||
|
#endif
|
||||||
m_watcher->setFuture(future);
|
m_watcher->setFuture(future);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -41,7 +41,7 @@
|
||||||
#include <QCompleter>
|
#include <QCompleter>
|
||||||
#include <QStringListModel>
|
#include <QStringListModel>
|
||||||
#include <QContextMenuEvent>
|
#include <QContextMenuEvent>
|
||||||
#include <QStyleOptionFrameV3>
|
#include <QStyleOptionFrame>
|
||||||
|
|
||||||
LocationBar::LocationBar(QWidget *parent)
|
LocationBar::LocationBar(QWidget *parent)
|
||||||
: LineEdit(parent)
|
: LineEdit(parent)
|
||||||
|
|
|
@ -66,8 +66,9 @@ NavigationBar::NavigationBar(BrowserWindow* window)
|
||||||
setObjectName(QSL("navigationbar"));
|
setObjectName(QSL("navigationbar"));
|
||||||
|
|
||||||
m_layout = new QHBoxLayout(this);
|
m_layout = new QHBoxLayout(this);
|
||||||
m_layout->setMargin(style()->pixelMetric(QStyle::PM_ToolBarItemMargin, 0, this)
|
auto contentsMargin = style()->pixelMetric(QStyle::PM_ToolBarItemMargin, 0, this)
|
||||||
+ style()->pixelMetric(QStyle::PM_ToolBarFrameWidth, 0, this));
|
+ style()->pixelMetric(QStyle::PM_ToolBarFrameWidth, 0, this);
|
||||||
|
m_layout->setContentsMargins(contentsMargin, contentsMargin, contentsMargin, contentsMargin);
|
||||||
m_layout->setSpacing(style()->pixelMetric(QStyle::PM_ToolBarItemSpacing, 0, this));
|
m_layout->setSpacing(style()->pixelMetric(QStyle::PM_ToolBarItemSpacing, 0, this));
|
||||||
setLayout(m_layout);
|
setLayout(m_layout);
|
||||||
|
|
||||||
|
@ -281,12 +282,13 @@ void NavigationBar::setSuperMenuVisible(bool visible)
|
||||||
|
|
||||||
int NavigationBar::layoutMargin() const
|
int NavigationBar::layoutMargin() const
|
||||||
{
|
{
|
||||||
return m_layout->margin();
|
// NOTE: This assumes margins are always the same.
|
||||||
|
return m_layout->contentsMargins().left();
|
||||||
}
|
}
|
||||||
|
|
||||||
void NavigationBar::setLayoutMargin(int margin)
|
void NavigationBar::setLayoutMargin(int margin)
|
||||||
{
|
{
|
||||||
m_layout->setMargin(margin);
|
m_layout->setContentsMargins(margin, margin, margin, margin);
|
||||||
}
|
}
|
||||||
|
|
||||||
int NavigationBar::layoutSpacing() const
|
int NavigationBar::layoutSpacing() const
|
||||||
|
|
|
@ -178,7 +178,11 @@ void WebSearchBar::setupEngines()
|
||||||
item.icon = en.icon;
|
item.icon = en.icon;
|
||||||
item.text = en.name;
|
item.text = en.name;
|
||||||
QVariant v;
|
QVariant v;
|
||||||
|
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||||
v.setValue<SearchEngine>(en);
|
v.setValue<SearchEngine>(en);
|
||||||
|
#else
|
||||||
|
v.setValue(en);
|
||||||
|
#endif
|
||||||
item.userData = v;
|
item.userData = v;
|
||||||
|
|
||||||
m_boxSearchType->addItem(item);
|
m_boxSearchType->addItem(item);
|
||||||
|
|
|
@ -70,24 +70,45 @@ NetworkManager::NetworkManager(QObject *parent)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||||
bool NetworkManager::certificateError(const QWebEngineCertificateError &error, QWidget *parent)
|
bool NetworkManager::certificateError(const QWebEngineCertificateError &error, QWidget *parent)
|
||||||
|
#else
|
||||||
|
bool NetworkManager::certificateError(QWebEngineCertificateError &error, QWidget *parent)
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
const QString &host = error.url().host();
|
const QString &host = error.url().host();
|
||||||
|
|
||||||
if (m_rejectedSslErrors.contains(host) && m_rejectedSslErrors.value(host) == error.error()) {
|
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||||
|
const auto errorType = error.error();
|
||||||
|
#else
|
||||||
|
const auto errorType = error.type();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if (m_rejectedSslErrors.contains(host) && m_rejectedSslErrors.value(host) == errorType) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((m_ignoredSslErrors.contains(host) && m_ignoredSslErrors.value(host) == error.error())
|
if ((m_ignoredSslErrors.contains(host) && m_ignoredSslErrors.value(host) == errorType)
|
||||||
|| m_ignoredSslHosts.contains(host)) {
|
|| m_ignoredSslHosts.contains(host)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
|
||||||
|
// Defer loading the URL until the user prompt has completed.
|
||||||
|
if (error.isOverridable())
|
||||||
|
error.defer();
|
||||||
|
#endif
|
||||||
|
|
||||||
QString title = tr("SSL Certificate Error!");
|
QString title = tr("SSL Certificate Error!");
|
||||||
QString text1 = tr("The page you are trying to access has the following errors in the SSL certificate:");
|
QString text1 = tr("The page you are trying to access has the following errors in the SSL certificate:");
|
||||||
QString text2 = tr("Would you like to make an exception for this certificate?");
|
QString text2 = tr("Would you like to make an exception for this certificate?");
|
||||||
|
|
||||||
QString message = QSL("<b>%1</b><p>%2</p><ul><li>%3</li></ul><p>%4</p>").arg(title, text1, error.errorDescription(), text2);
|
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||||
|
const auto errorDescription = error.errorDescription();
|
||||||
|
#else
|
||||||
|
const auto errorDescription = error.description();
|
||||||
|
#endif
|
||||||
|
QString message = QSL("<b>%1</b><p>%2</p><ul><li>%3</li></ul><p>%4</p>").arg(title, text1, errorDescription, text2);
|
||||||
|
|
||||||
SslErrorDialog dialog(parent);
|
SslErrorDialog dialog(parent);
|
||||||
dialog.setText(message);
|
dialog.setText(message);
|
||||||
|
@ -100,11 +121,11 @@ bool NetworkManager::certificateError(const QWebEngineCertificateError &error, Q
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
case SslErrorDialog::OnlyForThisSession:
|
case SslErrorDialog::OnlyForThisSession:
|
||||||
m_ignoredSslErrors[host] = error.error();
|
m_ignoredSslErrors[host] = errorType;
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
case SslErrorDialog::NoForThisSession:
|
case SslErrorDialog::NoForThisSession:
|
||||||
m_rejectedSslErrors[host] = error.error();
|
m_rejectedSslErrors[host] = errorType;
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
@ -329,8 +350,11 @@ void NetworkManager::registerSchemes()
|
||||||
QNetworkReply *NetworkManager::createRequest(QNetworkAccessManager::Operation op, const QNetworkRequest &request, QIODevice *outgoingData)
|
QNetworkReply *NetworkManager::createRequest(QNetworkAccessManager::Operation op, const QNetworkRequest &request, QIODevice *outgoingData)
|
||||||
{
|
{
|
||||||
QNetworkRequest req = request;
|
QNetworkRequest req = request;
|
||||||
|
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||||
|
// These have either been removed or changed to the default in Qt 6.
|
||||||
req.setAttribute(QNetworkRequest::SpdyAllowedAttribute, true);
|
req.setAttribute(QNetworkRequest::SpdyAllowedAttribute, true);
|
||||||
req.setAttribute(QNetworkRequest::FollowRedirectsAttribute, true);
|
req.setAttribute(QNetworkRequest::FollowRedirectsAttribute, true);
|
||||||
|
#endif
|
||||||
|
|
||||||
return QNetworkAccessManager::createRequest(op, req, outgoingData);
|
return QNetworkAccessManager::createRequest(op, req, outgoingData);
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,7 +35,11 @@ class FALKON_EXPORT NetworkManager : public QNetworkAccessManager
|
||||||
public:
|
public:
|
||||||
explicit NetworkManager(QObject *parent = nullptr);
|
explicit NetworkManager(QObject *parent = nullptr);
|
||||||
|
|
||||||
|
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||||
bool certificateError(const QWebEngineCertificateError &error, QWidget *parent = nullptr);
|
bool certificateError(const QWebEngineCertificateError &error, QWidget *parent = nullptr);
|
||||||
|
#else
|
||||||
|
bool certificateError(QWebEngineCertificateError &error, QWidget *parent = nullptr);
|
||||||
|
#endif
|
||||||
void authentication(const QUrl &url, QAuthenticator *auth, QWidget *parent = nullptr);
|
void authentication(const QUrl &url, QAuthenticator *auth, QWidget *parent = nullptr);
|
||||||
void proxyAuthentication(const QString &proxyHost, QAuthenticator *auth, QWidget *parent = nullptr);
|
void proxyAuthentication(const QString &proxyHost, QAuthenticator *auth, QWidget *parent = nullptr);
|
||||||
|
|
||||||
|
@ -58,8 +62,13 @@ private:
|
||||||
|
|
||||||
NetworkUrlInterceptor *m_urlInterceptor;
|
NetworkUrlInterceptor *m_urlInterceptor;
|
||||||
ExtensionSchemeManager *m_extensionScheme;
|
ExtensionSchemeManager *m_extensionScheme;
|
||||||
|
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||||
QHash<QString, QWebEngineCertificateError::Error> m_ignoredSslErrors;
|
QHash<QString, QWebEngineCertificateError::Error> m_ignoredSslErrors;
|
||||||
QHash<QString, QWebEngineCertificateError::Error> m_rejectedSslErrors;
|
QHash<QString, QWebEngineCertificateError::Error> m_rejectedSslErrors;
|
||||||
|
#else
|
||||||
|
QHash<QString, QWebEngineCertificateError::Type> m_ignoredSslErrors;
|
||||||
|
QHash<QString, QWebEngineCertificateError::Type> m_rejectedSslErrors;
|
||||||
|
#endif
|
||||||
QStringList m_ignoredSslHosts;
|
QStringList m_ignoredSslHosts;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -81,7 +81,11 @@ void EditSearchEngine::setShortcut(const QString &shortcut)
|
||||||
|
|
||||||
QIcon EditSearchEngine::icon()
|
QIcon EditSearchEngine::icon()
|
||||||
{
|
{
|
||||||
|
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||||
return QIcon(*ui->icon->pixmap());
|
return QIcon(*ui->icon->pixmap());
|
||||||
|
#else
|
||||||
|
return QIcon(ui->icon->pixmap());
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void EditSearchEngine::setIcon(const QIcon &icon)
|
void EditSearchEngine::setIcon(const QIcon &icon)
|
||||||
|
|
|
@ -173,7 +173,11 @@ SearchEngine SearchEnginesDialog::getEngine(QTreeWidgetItem* item)
|
||||||
void SearchEnginesDialog::setEngine(QTreeWidgetItem* item, const SearchEngine &engine)
|
void SearchEnginesDialog::setEngine(QTreeWidgetItem* item, const SearchEngine &engine)
|
||||||
{
|
{
|
||||||
QVariant v;
|
QVariant v;
|
||||||
|
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||||
v.setValue<SearchEngine>(engine);
|
v.setValue<SearchEngine>(engine);
|
||||||
|
#else
|
||||||
|
v.setValue(engine);
|
||||||
|
#endif
|
||||||
item->setData(0, EngineRole, v);
|
item->setData(0, EngineRole, v);
|
||||||
item->setText(0, engine.name);
|
item->setText(0, engine.name);
|
||||||
}
|
}
|
||||||
|
|
|
@ -138,7 +138,7 @@ void TipLabel::paintEvent(QPaintEvent* ev)
|
||||||
{
|
{
|
||||||
QStylePainter p(this);
|
QStylePainter p(this);
|
||||||
QStyleOptionFrame opt;
|
QStyleOptionFrame opt;
|
||||||
opt.init(this);
|
opt.initFrom(this);
|
||||||
p.drawPrimitive(QStyle::PE_PanelTipLabel, opt);
|
p.drawPrimitive(QStyle::PE_PanelTipLabel, opt);
|
||||||
p.end();
|
p.end();
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,11 @@
|
||||||
#include <QUrlQuery>
|
#include <QUrlQuery>
|
||||||
#include <QNetworkReply>
|
#include <QNetworkReply>
|
||||||
|
|
||||||
|
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||||
#include <KArchive/KZip>
|
#include <KArchive/KZip>
|
||||||
|
#else
|
||||||
|
#include <KZip>
|
||||||
|
#endif
|
||||||
|
|
||||||
Q_GLOBAL_STATIC(OcsSupport, qz_ocs_support)
|
Q_GLOBAL_STATIC(OcsSupport, qz_ocs_support)
|
||||||
|
|
||||||
|
|
|
@ -342,7 +342,7 @@ Plugins::Plugin Plugins::loadPlugin(const QString &id)
|
||||||
|
|
||||||
const int colon = id.indexOf(QL1C(':'));
|
const int colon = id.indexOf(QL1C(':'));
|
||||||
if (colon > -1) {
|
if (colon > -1) {
|
||||||
const auto t = id.leftRef(colon);
|
const auto t = QStringView{id}.left(colon);
|
||||||
if (t == QL1S("internal")) {
|
if (t == QL1S("internal")) {
|
||||||
type = Plugin::InternalPlugin;
|
type = Plugin::InternalPlugin;
|
||||||
} else if (t == QL1S("lib")) {
|
} else if (t == QL1S("lib")) {
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QVariant>
|
#include <QVariant>
|
||||||
#include <QPointer>
|
#include <QPointer>
|
||||||
|
#include <QPixmap>
|
||||||
|
|
||||||
#include "qzcommon.h"
|
#include "qzcommon.h"
|
||||||
#include "plugininterface.h"
|
#include "plugininterface.h"
|
||||||
|
|
|
@ -18,6 +18,8 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
#include "bookmarkitem.h"
|
#include "bookmarkitem.h"
|
||||||
|
|
||||||
|
#include <QObject>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief The class exposing the bookmark item to QML
|
* @brief The class exposing the bookmark item to QML
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -69,7 +69,7 @@ int QmlWheelEvent::globalY() const
|
||||||
if (!m_wheelEvent) {
|
if (!m_wheelEvent) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
return m_wheelEvent->globalPosition().toPoint().x();
|
return m_wheelEvent->globalPosition().toPoint().y();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool QmlWheelEvent::inverted() const
|
bool QmlWheelEvent::inverted() const
|
||||||
|
|
|
@ -20,6 +20,9 @@
|
||||||
|
|
||||||
QmlUserScript::QmlUserScript(QObject *parent)
|
QmlUserScript::QmlUserScript(QObject *parent)
|
||||||
: QObject(parent)
|
: QObject(parent)
|
||||||
|
#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
|
||||||
|
, m_isNull(true)
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -35,12 +38,17 @@ QWebEngineScript QmlUserScript::webEngineScript() const
|
||||||
|
|
||||||
void QmlUserScript::setWebEngineScript(const QWebEngineScript &script)
|
void QmlUserScript::setWebEngineScript(const QWebEngineScript &script)
|
||||||
{
|
{
|
||||||
|
setNotNull();
|
||||||
m_webEngineScript = script;
|
m_webEngineScript = script;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool QmlUserScript::null() const
|
bool QmlUserScript::null() const
|
||||||
{
|
{
|
||||||
|
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||||
return m_webEngineScript.isNull();
|
return m_webEngineScript.isNull();
|
||||||
|
#else
|
||||||
|
return m_isNull;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
QString QmlUserScript::name() const
|
QString QmlUserScript::name() const
|
||||||
|
@ -50,6 +58,7 @@ QString QmlUserScript::name() const
|
||||||
|
|
||||||
void QmlUserScript::setName(const QString &name)
|
void QmlUserScript::setName(const QString &name)
|
||||||
{
|
{
|
||||||
|
setNotNull();
|
||||||
m_webEngineScript.setName(name);
|
m_webEngineScript.setName(name);
|
||||||
Q_EMIT nameChanged(name);
|
Q_EMIT nameChanged(name);
|
||||||
aboutToUpdateUnderlyingScript();
|
aboutToUpdateUnderlyingScript();
|
||||||
|
@ -62,6 +71,7 @@ bool QmlUserScript::runsOnSubFrames() const
|
||||||
|
|
||||||
void QmlUserScript::setRunsOnSubFrames(bool runsOnSubFrames)
|
void QmlUserScript::setRunsOnSubFrames(bool runsOnSubFrames)
|
||||||
{
|
{
|
||||||
|
setNotNull();
|
||||||
m_webEngineScript.setRunsOnSubFrames(runsOnSubFrames);
|
m_webEngineScript.setRunsOnSubFrames(runsOnSubFrames);
|
||||||
Q_EMIT runsOnSubFramesChanged(runsOnSubFrames);
|
Q_EMIT runsOnSubFramesChanged(runsOnSubFrames);
|
||||||
aboutToUpdateUnderlyingScript();
|
aboutToUpdateUnderlyingScript();
|
||||||
|
@ -74,6 +84,7 @@ int QmlUserScript::worldId() const
|
||||||
|
|
||||||
void QmlUserScript::setWorldId(int worldId)
|
void QmlUserScript::setWorldId(int worldId)
|
||||||
{
|
{
|
||||||
|
setNotNull();
|
||||||
switch (worldId) {
|
switch (worldId) {
|
||||||
case QWebEngineScript::MainWorld:
|
case QWebEngineScript::MainWorld:
|
||||||
m_webEngineScript.setWorldId(QWebEngineScript::MainWorld);
|
m_webEngineScript.setWorldId(QWebEngineScript::MainWorld);
|
||||||
|
@ -98,6 +109,7 @@ QString QmlUserScript::sourceCode() const
|
||||||
|
|
||||||
void QmlUserScript::setSourceCode(const QString &sourceCode)
|
void QmlUserScript::setSourceCode(const QString &sourceCode)
|
||||||
{
|
{
|
||||||
|
setNotNull();
|
||||||
m_webEngineScript.setSourceCode(sourceCode);
|
m_webEngineScript.setSourceCode(sourceCode);
|
||||||
Q_EMIT sourceCodeChanged(sourceCode);
|
Q_EMIT sourceCodeChanged(sourceCode);
|
||||||
aboutToUpdateUnderlyingScript();
|
aboutToUpdateUnderlyingScript();
|
||||||
|
@ -110,6 +122,7 @@ QmlUserScript::InjectionPoint QmlUserScript::injectionPoint() const
|
||||||
|
|
||||||
void QmlUserScript::setInjectionPoint(InjectionPoint injectionPoint)
|
void QmlUserScript::setInjectionPoint(InjectionPoint injectionPoint)
|
||||||
{
|
{
|
||||||
|
setNotNull();
|
||||||
switch (static_cast<QWebEngineScript::InjectionPoint>(injectionPoint)) {
|
switch (static_cast<QWebEngineScript::InjectionPoint>(injectionPoint)) {
|
||||||
case QWebEngineScript::DocumentCreation:
|
case QWebEngineScript::DocumentCreation:
|
||||||
m_webEngineScript.setInjectionPoint(QWebEngineScript::DocumentCreation);
|
m_webEngineScript.setInjectionPoint(QWebEngineScript::DocumentCreation);
|
||||||
|
|
|
@ -100,6 +100,9 @@ Q_SIGNALS:
|
||||||
void injectionPointChanged(int injectionPoint);
|
void injectionPointChanged(int injectionPoint);
|
||||||
private:
|
private:
|
||||||
QWebEngineScript m_webEngineScript;
|
QWebEngineScript m_webEngineScript;
|
||||||
|
#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
|
||||||
|
bool m_isNull;
|
||||||
|
#endif
|
||||||
QBasicTimer m_basicTimer;
|
QBasicTimer m_basicTimer;
|
||||||
|
|
||||||
bool null() const;
|
bool null() const;
|
||||||
|
@ -116,4 +119,12 @@ private:
|
||||||
|
|
||||||
void timerEvent(QTimerEvent *e) override;
|
void timerEvent(QTimerEvent *e) override;
|
||||||
void aboutToUpdateUnderlyingScript();
|
void aboutToUpdateUnderlyingScript();
|
||||||
|
|
||||||
|
void setNotNull()
|
||||||
|
{
|
||||||
|
#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
|
||||||
|
// TODO: This is a really hacky way of keeping track of whether the script has been initialized - and is it even necessary?
|
||||||
|
m_isNull = false;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -33,7 +33,7 @@ int QmlUserScripts::count() const
|
||||||
|
|
||||||
int QmlUserScripts::size() const
|
int QmlUserScripts::size() const
|
||||||
{
|
{
|
||||||
return mApp->webProfile()->scripts()->size();
|
return mApp->webProfile()->scripts()->count();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool QmlUserScripts::empty() const
|
bool QmlUserScripts::empty() const
|
||||||
|
@ -65,15 +65,28 @@ bool QmlUserScripts::contains(QObject *object) const
|
||||||
|
|
||||||
QObject *QmlUserScripts::findScript(const QString &name) const
|
QObject *QmlUserScripts::findScript(const QString &name) const
|
||||||
{
|
{
|
||||||
QWebEngineScript webEngineScript = mApp->webProfile()->scripts()->findScript(name);
|
|
||||||
auto *qmlUserScript = new QmlUserScript();
|
auto *qmlUserScript = new QmlUserScript();
|
||||||
|
|
||||||
|
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||||
|
QWebEngineScript webEngineScript = mApp->webProfile()->scripts()->findScript(name);
|
||||||
qmlUserScript->setWebEngineScript(webEngineScript);
|
qmlUserScript->setWebEngineScript(webEngineScript);
|
||||||
|
#else
|
||||||
|
auto scripts = mApp->webProfile()->scripts()->find(name);
|
||||||
|
if (!scripts.empty()) {
|
||||||
|
qmlUserScript->setWebEngineScript(scripts.first());
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
return qmlUserScript;
|
return qmlUserScript;
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<QObject*> QmlUserScripts::findScripts(const QString &name) const
|
QList<QObject*> QmlUserScripts::findScripts(const QString &name) const
|
||||||
{
|
{
|
||||||
|
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||||
QList<QWebEngineScript> list = mApp->webProfile()->scripts()->findScripts(name);
|
QList<QWebEngineScript> list = mApp->webProfile()->scripts()->findScripts(name);
|
||||||
|
#else
|
||||||
|
QList<QWebEngineScript> list = mApp->webProfile()->scripts()->find(name);
|
||||||
|
#endif
|
||||||
return toQObjectList(list);
|
return toQObjectList(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -42,7 +42,7 @@ public:
|
||||||
return !url.isEmpty();
|
return !url.isEmpty();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool operator==(const Page &other) {
|
bool operator==(const Page &other) const {
|
||||||
return (this->title == other.title &&
|
return (this->title == other.title &&
|
||||||
this->url == other.url);
|
this->url == other.url);
|
||||||
}
|
}
|
||||||
|
|
|
@ -92,7 +92,11 @@ void AutoFillManager::loadPasswords()
|
||||||
item->setText(2, "*****");
|
item->setText(2, "*****");
|
||||||
|
|
||||||
QVariant v;
|
QVariant v;
|
||||||
|
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||||
v.setValue<PasswordEntry>(entry);
|
v.setValue<PasswordEntry>(entry);
|
||||||
|
#else
|
||||||
|
v.setValue(entry);
|
||||||
|
#endif
|
||||||
item->setData(0, Qt::UserRole + 10, v);
|
item->setData(0, Qt::UserRole + 10, v);
|
||||||
ui->treePass->addTopLevelItem(item);
|
ui->treePass->addTopLevelItem(item);
|
||||||
}
|
}
|
||||||
|
@ -253,12 +257,17 @@ void AutoFillManager::editPass()
|
||||||
|
|
||||||
if (ok && !text.isEmpty() && text != entry.password) {
|
if (ok && !text.isEmpty() && text != entry.password) {
|
||||||
QByteArray oldPass = "=" + PasswordManager::urlEncodePassword(entry.password);
|
QByteArray oldPass = "=" + PasswordManager::urlEncodePassword(entry.password);
|
||||||
entry.data.replace(oldPass, "=" + PasswordManager::urlEncodePassword(text));
|
QByteArray newPass = "=" + PasswordManager::urlEncodePassword(text);
|
||||||
|
entry.data.replace(oldPass, newPass);
|
||||||
entry.password = text;
|
entry.password = text;
|
||||||
|
|
||||||
if (mApp->autoFill()->updateEntry(entry)) {
|
if (mApp->autoFill()->updateEntry(entry)) {
|
||||||
QVariant v;
|
QVariant v;
|
||||||
|
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||||
v.setValue<PasswordEntry>(entry);
|
v.setValue<PasswordEntry>(entry);
|
||||||
|
#else
|
||||||
|
v.setValue(entry);
|
||||||
|
#endif
|
||||||
curItem->setData(0, Qt::UserRole + 10, v);
|
curItem->setData(0, Qt::UserRole + 10, v);
|
||||||
|
|
||||||
if (m_passwordsShown) {
|
if (m_passwordsShown) {
|
||||||
|
|
|
@ -72,9 +72,9 @@ void PluginListDelegate::paint(QPainter* painter, const QStyleOptionViewItem &op
|
||||||
const int checkboxYPos = center - (checkboxSize / 2);
|
const int checkboxYPos = center - (checkboxSize / 2);
|
||||||
QStyleOptionViewItem opt2 = opt;
|
QStyleOptionViewItem opt2 = opt;
|
||||||
opt2.checkState == Qt::Checked ? opt2.state |= QStyle::State_On : opt2.state |= QStyle::State_Off;
|
opt2.checkState == Qt::Checked ? opt2.state |= QStyle::State_On : opt2.state |= QStyle::State_Off;
|
||||||
QRect styleCheckBoxRect = style->subElementRect(QStyle::SE_ViewItemCheckIndicator, &opt2, w);
|
QRect styleCheckBoxRect = style->subElementRect(QStyle::SE_ItemViewItemCheckIndicator, &opt2, w);
|
||||||
opt2.rect = QRect(leftPosition, checkboxYPos, styleCheckBoxRect.width(), styleCheckBoxRect.height());
|
opt2.rect = QRect(leftPosition, checkboxYPos, styleCheckBoxRect.width(), styleCheckBoxRect.height());
|
||||||
style->drawPrimitive(QStyle::PE_IndicatorViewItemCheck, &opt2, painter, w);
|
style->drawPrimitive(QStyle::PE_IndicatorItemViewItemCheck, &opt2, painter, w);
|
||||||
leftPosition = opt2.rect.right() + m_padding;
|
leftPosition = opt2.rect.right() + m_padding;
|
||||||
|
|
||||||
// Draw icon
|
// Draw icon
|
||||||
|
|
|
@ -57,7 +57,9 @@
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include <QCloseEvent>
|
#include <QCloseEvent>
|
||||||
#include <QColorDialog>
|
#include <QColorDialog>
|
||||||
|
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||||
#include <QDesktopWidget>
|
#include <QDesktopWidget>
|
||||||
|
#endif
|
||||||
#include <QWebEngineProfile>
|
#include <QWebEngineProfile>
|
||||||
#include <QWebEngineSettings>
|
#include <QWebEngineSettings>
|
||||||
#include <QLibraryInfo>
|
#include <QLibraryInfo>
|
||||||
|
@ -530,13 +532,17 @@ Preferences::Preferences(BrowserWindow* window)
|
||||||
|
|
||||||
ui->listWidget->setCurrentRow(currentSettingsPage);
|
ui->listWidget->setCurrentRow(currentSettingsPage);
|
||||||
|
|
||||||
QDesktopWidget* desktop = QApplication::desktop();
|
|
||||||
QSize s = size();
|
QSize s = size();
|
||||||
if (desktop->availableGeometry(this).size().width() < s.width()) {
|
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||||
s.setWidth(desktop->availableGeometry(this).size().width() - 50);
|
const QRect &availableGeometryForScreen = QApplication::desktop()->availableGeometry(this);
|
||||||
|
#else
|
||||||
|
const QRect &availableGeometryForScreen = screen()->availableGeometry();
|
||||||
|
#endif
|
||||||
|
if (availableGeometryForScreen.size().width() < s.width()) {
|
||||||
|
s.setWidth(availableGeometryForScreen.size().width() - 50);
|
||||||
}
|
}
|
||||||
if (desktop->availableGeometry(this).size().height() < s.height()) {
|
if (availableGeometryForScreen.size().height() < s.height()) {
|
||||||
s.setHeight(desktop->availableGeometry(this).size().height() - 50);
|
s.setHeight(availableGeometryForScreen.size().height() - 50);
|
||||||
}
|
}
|
||||||
resize(s);
|
resize(s);
|
||||||
|
|
||||||
|
|
|
@ -25,6 +25,7 @@
|
||||||
#include "settings.h"
|
#include "settings.h"
|
||||||
|
|
||||||
#include <QAction>
|
#include <QAction>
|
||||||
|
#include <QActionGroup>
|
||||||
#include <QComboBox>
|
#include <QComboBox>
|
||||||
#include <QDateTime>
|
#include <QDateTime>
|
||||||
#include <QDialogButtonBox>
|
#include <QDialogButtonBox>
|
||||||
|
|
|
@ -114,7 +114,7 @@ void SessionManagerDialog::refresh()
|
||||||
for (const auto &session : sessions) {
|
for (const auto &session : sessions) {
|
||||||
auto *item = new QTreeWidgetItem;
|
auto *item = new QTreeWidgetItem;
|
||||||
item->setText(0, session.name);
|
item->setText(0, session.name);
|
||||||
item->setText(1, QFileInfo(session.filePath).lastModified().toString(Qt::DefaultLocaleShortDate));
|
item->setText(1, QLocale().toString(QFileInfo(session.filePath).lastModified(), QLocale::ShortFormat));
|
||||||
item->setData(0, SessionFileRole, session.filePath);
|
item->setData(0, SessionFileRole, session.filePath);
|
||||||
item->setData(0, IsBackupSessionRole, session.isBackup);
|
item->setData(0, IsBackupSessionRole, session.isBackup);
|
||||||
item->setData(0, IsActiveSessionRole, session.isActive);
|
item->setData(0, IsActiveSessionRole, session.isActive);
|
||||||
|
|
|
@ -25,6 +25,7 @@
|
||||||
#include "settings.h"
|
#include "settings.h"
|
||||||
|
|
||||||
#include <QMenu>
|
#include <QMenu>
|
||||||
|
#include <QActionGroup>
|
||||||
|
|
||||||
QHash<QString, QPointer<SideBarInterface> > s_sidebars;
|
QHash<QString, QPointer<SideBarInterface> > s_sidebars;
|
||||||
|
|
||||||
|
|
|
@ -27,8 +27,8 @@
|
||||||
#include <QIcon>
|
#include <QIcon>
|
||||||
#include <QHBoxLayout>
|
#include <QHBoxLayout>
|
||||||
#include <QStylePainter>
|
#include <QStylePainter>
|
||||||
#include <QStyleOptionTabV3>
|
#include <QStyleOptionTab>
|
||||||
#include <QStyleOptionTabBarBaseV2>
|
#include <QStyleOptionTabBarBase>
|
||||||
#include <QPropertyAnimation>
|
#include <QPropertyAnimation>
|
||||||
#include <QScrollArea>
|
#include <QScrollArea>
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
|
@ -682,7 +682,7 @@ void ComboTabBar::paintEvent(QPaintEvent* ev)
|
||||||
|
|
||||||
// This is needed to apply style sheets
|
// This is needed to apply style sheets
|
||||||
QStyleOption option;
|
QStyleOption option;
|
||||||
option.init(this);
|
option.initFrom(this);
|
||||||
QPainter p(this);
|
QPainter p(this);
|
||||||
style()->drawPrimitive(QStyle::PE_Widget, &option, &p, this);
|
style()->drawPrimitive(QStyle::PE_Widget, &option, &p, this);
|
||||||
|
|
||||||
|
@ -1230,7 +1230,7 @@ void TabBarHelper::initStyleBaseOption(QStyleOptionTabBarBase *optTabBase, QTabB
|
||||||
tabOverlap.shape = tabbar->shape();
|
tabOverlap.shape = tabbar->shape();
|
||||||
int overlap = tabbar->style()->pixelMetric(QStyle::PM_TabBarBaseOverlap, &tabOverlap, tabbar);
|
int overlap = tabbar->style()->pixelMetric(QStyle::PM_TabBarBaseOverlap, &tabOverlap, tabbar);
|
||||||
QWidget* theParent = tabbar->parentWidget();
|
QWidget* theParent = tabbar->parentWidget();
|
||||||
optTabBase->init(tabbar);
|
optTabBase->initFrom(tabbar);
|
||||||
optTabBase->shape = tabbar->shape();
|
optTabBase->shape = tabbar->shape();
|
||||||
optTabBase->documentMode = tabbar->documentMode();
|
optTabBase->documentMode = tabbar->documentMode();
|
||||||
if (theParent && overlap > 0) {
|
if (theParent && overlap > 0) {
|
||||||
|
@ -1359,7 +1359,9 @@ void TabBarHelper::paintEvent(QPaintEvent *)
|
||||||
grabImage.setDevicePixelRatio(devicePixelRatioF());
|
grabImage.setDevicePixelRatio(devicePixelRatioF());
|
||||||
grabImage.fill(Qt::transparent);
|
grabImage.fill(Qt::transparent);
|
||||||
QStylePainter p(&grabImage, this);
|
QStylePainter p(&grabImage, this);
|
||||||
|
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||||
p.initFrom(this);
|
p.initFrom(this);
|
||||||
|
#endif
|
||||||
if (tabDragOffset != 0) {
|
if (tabDragOffset != 0) {
|
||||||
tab.position = QStyleOptionTab::OnlyOneTab;
|
tab.position = QStyleOptionTab::OnlyOneTab;
|
||||||
}
|
}
|
||||||
|
@ -1537,7 +1539,7 @@ TabBarScrollWidget::TabBarScrollWidget(QTabBar* tabBar, QWidget* parent)
|
||||||
: QWidget(parent)
|
: QWidget(parent)
|
||||||
, m_tabBar(tabBar)
|
, m_tabBar(tabBar)
|
||||||
, m_usesScrollButtons(false)
|
, m_usesScrollButtons(false)
|
||||||
, m_totalDeltas(0)
|
, m_totalVerticalDeltas(0)
|
||||||
{
|
{
|
||||||
m_scrollArea = new QScrollArea(this);
|
m_scrollArea = new QScrollArea(this);
|
||||||
m_scrollArea->setFocusPolicy(Qt::NoFocus);
|
m_scrollArea->setFocusPolicy(Qt::NoFocus);
|
||||||
|
@ -1696,30 +1698,33 @@ void TabBarScrollWidget::scrollByWheel(QWheelEvent* event)
|
||||||
{
|
{
|
||||||
event->accept();
|
event->accept();
|
||||||
|
|
||||||
// Check if direction has changed from last time
|
// Process horizontal wheel scrolling first
|
||||||
if (m_totalDeltas * event->delta() < 0) {
|
// Slower scrolling for horizontal wheel scrolling
|
||||||
m_totalDeltas = 0;
|
if (event->angleDelta().x() > 0) {
|
||||||
|
scrollToLeft();
|
||||||
|
}
|
||||||
|
else if (event->angleDelta().x() < 0) {
|
||||||
|
scrollToRight();
|
||||||
}
|
}
|
||||||
|
|
||||||
m_totalDeltas += event->delta();
|
auto verticalDelta = event->angleDelta().y();
|
||||||
|
if (verticalDelta == 0) {
|
||||||
// Slower scrolling for horizontal wheel scrolling
|
|
||||||
if (event->orientation() == Qt::Horizontal) {
|
|
||||||
if (event->delta() > 0) {
|
|
||||||
scrollToLeft();
|
|
||||||
}
|
|
||||||
else if (event->delta() < 0) {
|
|
||||||
scrollToRight();
|
|
||||||
}
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check if vertical direction has changed from last time
|
||||||
|
if (m_totalVerticalDeltas * verticalDelta < 0) {
|
||||||
|
m_totalVerticalDeltas = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
m_totalVerticalDeltas += verticalDelta;
|
||||||
|
|
||||||
// Faster scrolling with control modifier
|
// Faster scrolling with control modifier
|
||||||
if (event->orientation() == Qt::Vertical && event->modifiers() == Qt::ControlModifier) {
|
if (event->modifiers() == Qt::ControlModifier) {
|
||||||
if (event->delta() > 0) {
|
if (verticalDelta > 0) {
|
||||||
scrollToLeft(10);
|
scrollToLeft(10);
|
||||||
}
|
}
|
||||||
else if (event->delta() < 0) {
|
else if (verticalDelta < 0) {
|
||||||
scrollToRight(10);
|
scrollToRight(10);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
@ -1731,7 +1736,7 @@ void TabBarScrollWidget::scrollByWheel(QWheelEvent* event)
|
||||||
factor = m_scrollBar->pageStep();
|
factor = m_scrollBar->pageStep();
|
||||||
}
|
}
|
||||||
|
|
||||||
int offset = (m_totalDeltas / 120) * factor;
|
int offset = (m_totalVerticalDeltas / 120) * factor;
|
||||||
if (offset != 0) {
|
if (offset != 0) {
|
||||||
if (isRightToLeft()) {
|
if (isRightToLeft()) {
|
||||||
m_scrollBar->animateToValue(m_scrollBar->value() + offset);
|
m_scrollBar->animateToValue(m_scrollBar->value() + offset);
|
||||||
|
@ -1740,7 +1745,7 @@ void TabBarScrollWidget::scrollByWheel(QWheelEvent* event)
|
||||||
m_scrollBar->animateToValue(m_scrollBar->value() - offset);
|
m_scrollBar->animateToValue(m_scrollBar->value() - offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
m_totalDeltas -= (offset / factor) * 120;
|
m_totalVerticalDeltas -= (offset / factor) * 120;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1809,7 +1814,11 @@ QSize CloseButton::sizeHint() const
|
||||||
return QSize(width, height);
|
return QSize(width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||||
void CloseButton::enterEvent(QEvent* event)
|
void CloseButton::enterEvent(QEvent* event)
|
||||||
|
#else
|
||||||
|
void CloseButton::enterEvent(QEnterEvent* event)
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
if (isEnabled()) {
|
if (isEnabled()) {
|
||||||
update();
|
update();
|
||||||
|
@ -1831,7 +1840,7 @@ void CloseButton::paintEvent(QPaintEvent*)
|
||||||
{
|
{
|
||||||
QPainter p(this);
|
QPainter p(this);
|
||||||
QStyleOption opt;
|
QStyleOption opt;
|
||||||
opt.init(this);
|
opt.initFrom(this);
|
||||||
opt.state |= QStyle::State_AutoRaise;
|
opt.state |= QStyle::State_AutoRaise;
|
||||||
|
|
||||||
// update raised state on scrolling
|
// update raised state on scrolling
|
||||||
|
|
|
@ -350,7 +350,7 @@ private:
|
||||||
ToolButton* m_rightScrollButton;
|
ToolButton* m_rightScrollButton;
|
||||||
ToolButton* m_leftScrollButton;
|
ToolButton* m_leftScrollButton;
|
||||||
bool m_usesScrollButtons;
|
bool m_usesScrollButtons;
|
||||||
int m_totalDeltas;
|
int m_totalVerticalDeltas;
|
||||||
};
|
};
|
||||||
|
|
||||||
// Class for close button on tabs
|
// Class for close button on tabs
|
||||||
|
@ -364,7 +364,11 @@ public:
|
||||||
|
|
||||||
QSize sizeHint() const override;
|
QSize sizeHint() const override;
|
||||||
|
|
||||||
|
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||||
void enterEvent(QEvent *event) override;
|
void enterEvent(QEvent *event) override;
|
||||||
|
#else
|
||||||
|
void enterEvent(QEnterEvent *event) override;
|
||||||
|
#endif
|
||||||
void leaveEvent(QEvent *event) override;
|
void leaveEvent(QEvent *event) override;
|
||||||
void paintEvent(QPaintEvent *event) override;
|
void paintEvent(QPaintEvent *event) override;
|
||||||
};
|
};
|
||||||
|
|
|
@ -24,6 +24,7 @@
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
#include <QToolTip>
|
#include <QToolTip>
|
||||||
#include <QMouseEvent>
|
#include <QMouseEvent>
|
||||||
|
#include <QPainter>
|
||||||
|
|
||||||
TabIcon::TabIcon(QWidget* parent)
|
TabIcon::TabIcon(QWidget* parent)
|
||||||
: QWidget(parent)
|
: QWidget(parent)
|
||||||
|
|
|
@ -160,7 +160,11 @@ void ButtonWithMenu::generateMenu()
|
||||||
|
|
||||||
for (const Item &item : qAsConst(m_items)) {
|
for (const Item &item : qAsConst(m_items)) {
|
||||||
QVariant variant;
|
QVariant variant;
|
||||||
|
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||||
variant.setValue<Item>(item);
|
variant.setValue<Item>(item);
|
||||||
|
#else
|
||||||
|
variant.setValue(item);
|
||||||
|
#endif
|
||||||
m_menu->addAction(item.icon, item.text, this, SLOT(setCurrentItem()))->setData(variant);
|
m_menu->addAction(item.icon, item.text, this, SLOT(setCurrentItem()))->setData(variant);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,7 +38,7 @@ public:
|
||||||
icon = b;
|
icon = b;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool operator==(const Item &a) {
|
bool operator==(const Item &a) const {
|
||||||
return (a.text == text) && (a.icon.pixmap(16).toImage() == icon.pixmap(16).toImage());
|
return (a.text == text) && (a.icon.pixmap(16).toImage() == icon.pixmap(16).toImage());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
|
|
||||||
#include <QSettings>
|
#include <QSettings>
|
||||||
#include <QStandardPaths>
|
#include <QStandardPaths>
|
||||||
|
#include <QLocale>
|
||||||
|
|
||||||
DesktopFile::DesktopFile()
|
DesktopFile::DesktopFile()
|
||||||
= default;
|
= default;
|
||||||
|
@ -26,7 +27,9 @@ DesktopFile::DesktopFile()
|
||||||
DesktopFile::DesktopFile(const QString &fileName)
|
DesktopFile::DesktopFile(const QString &fileName)
|
||||||
{
|
{
|
||||||
m_settings.reset(new QSettings(fileName, QSettings::IniFormat));
|
m_settings.reset(new QSettings(fileName, QSettings::IniFormat));
|
||||||
|
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||||
m_settings->setIniCodec("UTF-8");
|
m_settings->setIniCodec("UTF-8");
|
||||||
|
#endif
|
||||||
m_settings->beginGroup(QSL("Desktop Entry"));
|
m_settings->beginGroup(QSL("Desktop Entry"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -23,6 +23,7 @@
|
||||||
|
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
#include <QWebEnginePage>
|
#include <QWebEnginePage>
|
||||||
|
#include <QWebEngineView>
|
||||||
#include <QtWebEngineWidgetsVersion>
|
#include <QtWebEngineWidgetsVersion>
|
||||||
|
|
||||||
|
|
||||||
|
@ -100,7 +101,11 @@ void HTML5PermissionsNotification::grantPermissions()
|
||||||
QTimer::singleShot(0, this, [this]() {
|
QTimer::singleShot(0, this, [this]() {
|
||||||
// We need to have cursor inside view to correctly grab mouse
|
// We need to have cursor inside view to correctly grab mouse
|
||||||
if (m_feature == QWebEnginePage::MouseLock) {
|
if (m_feature == QWebEnginePage::MouseLock) {
|
||||||
|
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||||
QWidget *view = m_page->view();
|
QWidget *view = m_page->view();
|
||||||
|
#else
|
||||||
|
QWidget *view = QWebEngineView::forPage(m_page);
|
||||||
|
#endif
|
||||||
QCursor::setPos(view->mapToGlobal(view->rect().center()));
|
QCursor::setPos(view->mapToGlobal(view->rect().center()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
#include "progressbar.h"
|
#include "progressbar.h"
|
||||||
|
|
||||||
#include <QStylePainter>
|
#include <QStylePainter>
|
||||||
#include <QStyleOptionProgressBarV2>
|
#include <QStyleOptionProgressBar>
|
||||||
|
|
||||||
ProgressBar::ProgressBar(QWidget* parent)
|
ProgressBar::ProgressBar(QWidget* parent)
|
||||||
: QWidget(parent)
|
: QWidget(parent)
|
||||||
|
|
|
@ -32,7 +32,11 @@
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QSslCertificate>
|
#include <QSslCertificate>
|
||||||
|
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||||
#include <QDesktopWidget>
|
#include <QDesktopWidget>
|
||||||
|
#else
|
||||||
|
#include <QScreen>
|
||||||
|
#endif
|
||||||
#include <QUrl>
|
#include <QUrl>
|
||||||
#include <QIcon>
|
#include <QIcon>
|
||||||
#include <QFileIconProvider>
|
#include <QFileIconProvider>
|
||||||
|
@ -115,7 +119,11 @@ QByteArray QzTools::readAllFileByteContents(const QString &filename)
|
||||||
|
|
||||||
void QzTools::centerWidgetOnScreen(QWidget* w)
|
void QzTools::centerWidgetOnScreen(QWidget* w)
|
||||||
{
|
{
|
||||||
const QRect screen = QApplication::desktop()->screenGeometry(w);
|
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||||
|
QRect screen = QApplication::desktop()->screenGeometry(w);
|
||||||
|
#else
|
||||||
|
QRect screen = w->screen()->geometry();
|
||||||
|
#endif
|
||||||
const QRect size = w->geometry();
|
const QRect size = w->geometry();
|
||||||
w->move((screen.width() - size.width()) / 2, (screen.height() - size.height()) / 2);
|
w->move((screen.width() - size.width()) / 2, (screen.height() - size.height()) / 2);
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,7 +18,11 @@
|
||||||
#include "webhittestresult.h"
|
#include "webhittestresult.h"
|
||||||
#include "webpage.h"
|
#include "webpage.h"
|
||||||
|
|
||||||
|
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||||
#include <QWebEngineContextMenuData>
|
#include <QWebEngineContextMenuData>
|
||||||
|
#else
|
||||||
|
#include <QWebEngineContextMenuRequest>
|
||||||
|
#endif
|
||||||
|
|
||||||
WebHitTestResult::WebHitTestResult(const WebPage *page, const QPoint &pos)
|
WebHitTestResult::WebHitTestResult(const WebPage *page, const QPoint &pos)
|
||||||
: m_isNull(true)
|
: m_isNull(true)
|
||||||
|
@ -92,9 +96,14 @@ WebHitTestResult::WebHitTestResult(const WebPage *page, const QPoint &pos)
|
||||||
init(p->url(), p->execJavaScript(js, WebPage::SafeJsWorld).toMap());
|
init(p->url(), p->execJavaScript(js, WebPage::SafeJsWorld).toMap());
|
||||||
}
|
}
|
||||||
|
|
||||||
void WebHitTestResult::updateWithContextMenuData(const QWebEngineContextMenuData &data)
|
void WebHitTestResult::updateWithContextMenuData(const Q_WEB_ENGINE_CONTEXT_MENU_DATA_CLASS &data)
|
||||||
{
|
{
|
||||||
if (!data.isValid() || data.position() != m_pos) {
|
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||||
|
if (!data.isValid()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
if (data.position() != m_pos) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -104,12 +113,12 @@ void WebHitTestResult::updateWithContextMenuData(const QWebEngineContextMenuData
|
||||||
m_isContentSelected = !data.selectedText().isEmpty();
|
m_isContentSelected = !data.selectedText().isEmpty();
|
||||||
|
|
||||||
switch (data.mediaType()) {
|
switch (data.mediaType()) {
|
||||||
case QWebEngineContextMenuData::MediaTypeImage:
|
case Q_WEB_ENGINE_CONTEXT_MENU_DATA_CLASS::MediaTypeImage:
|
||||||
m_imageUrl = data.mediaUrl();
|
m_imageUrl = data.mediaUrl();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case QWebEngineContextMenuData::MediaTypeVideo:
|
case Q_WEB_ENGINE_CONTEXT_MENU_DATA_CLASS::MediaTypeVideo:
|
||||||
case QWebEngineContextMenuData::MediaTypeAudio:
|
case Q_WEB_ENGINE_CONTEXT_MENU_DATA_CLASS::MediaTypeAudio:
|
||||||
m_mediaUrl = data.mediaUrl();
|
m_mediaUrl = data.mediaUrl();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,13 @@
|
||||||
|
|
||||||
#include "qzcommon.h"
|
#include "qzcommon.h"
|
||||||
|
|
||||||
|
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||||
class QWebEngineContextMenuData;
|
class QWebEngineContextMenuData;
|
||||||
|
#define Q_WEB_ENGINE_CONTEXT_MENU_DATA_CLASS QWebEngineContextMenuData
|
||||||
|
#else
|
||||||
|
class QWebEngineContextMenuRequest;
|
||||||
|
#define Q_WEB_ENGINE_CONTEXT_MENU_DATA_CLASS QWebEngineContextMenuRequest
|
||||||
|
#endif
|
||||||
|
|
||||||
class WebPage;
|
class WebPage;
|
||||||
|
|
||||||
|
@ -34,7 +40,7 @@ class FALKON_EXPORT WebHitTestResult
|
||||||
public:
|
public:
|
||||||
explicit WebHitTestResult(const WebPage *page, const QPoint &pos);
|
explicit WebHitTestResult(const WebPage *page, const QPoint &pos);
|
||||||
|
|
||||||
void updateWithContextMenuData(const QWebEngineContextMenuData &data);
|
void updateWithContextMenuData(const Q_WEB_ENGINE_CONTEXT_MENU_DATA_CLASS &data);
|
||||||
|
|
||||||
QUrl baseUrl() const;
|
QUrl baseUrl() const;
|
||||||
QString alternateText() const;
|
QString alternateText() const;
|
||||||
|
|
|
@ -89,6 +89,9 @@ WebPage::WebPage(QObject* parent)
|
||||||
connect(this, &QWebEnginePage::windowCloseRequested, this, &WebPage::windowCloseRequested);
|
connect(this, &QWebEnginePage::windowCloseRequested, this, &WebPage::windowCloseRequested);
|
||||||
connect(this, &QWebEnginePage::fullScreenRequested, this, &WebPage::fullScreenRequested);
|
connect(this, &QWebEnginePage::fullScreenRequested, this, &WebPage::fullScreenRequested);
|
||||||
connect(this, &QWebEnginePage::renderProcessTerminated, this, &WebPage::renderProcessTerminated);
|
connect(this, &QWebEnginePage::renderProcessTerminated, this, &WebPage::renderProcessTerminated);
|
||||||
|
#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
|
||||||
|
connect(this, &QWebEnginePage::certificateError, this, &WebPage::onCertificateError);
|
||||||
|
#endif
|
||||||
|
|
||||||
connect(this, &QWebEnginePage::authenticationRequired, this, [this](const QUrl &url, QAuthenticator *auth) {
|
connect(this, &QWebEnginePage::authenticationRequired, this, [this](const QUrl &url, QAuthenticator *auth) {
|
||||||
mApp->networkManager()->authentication(url, auth, view());
|
mApp->networkManager()->authentication(url, auth, view());
|
||||||
|
@ -137,7 +140,11 @@ WebPage::~WebPage()
|
||||||
|
|
||||||
WebView *WebPage::view() const
|
WebView *WebPage::view() const
|
||||||
{
|
{
|
||||||
|
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||||
return static_cast<WebView*>(QWebEnginePage::view());
|
return static_cast<WebView*>(QWebEnginePage::view());
|
||||||
|
#else
|
||||||
|
return static_cast<WebView*>(QWebEngineView::forPage(this));
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
bool WebPage::execPrintPage(QPrinter *printer, int timeout)
|
bool WebPage::execPrintPage(QPrinter *printer, int timeout)
|
||||||
|
@ -146,12 +153,22 @@ bool WebPage::execPrintPage(QPrinter *printer, int timeout)
|
||||||
bool result = false;
|
bool result = false;
|
||||||
QTimer::singleShot(timeout, loop.data(), &QEventLoop::quit);
|
QTimer::singleShot(timeout, loop.data(), &QEventLoop::quit);
|
||||||
|
|
||||||
|
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||||
print(printer, [loop, &result](bool res) {
|
print(printer, [loop, &result](bool res) {
|
||||||
if (loop && loop->isRunning()) {
|
if (loop && loop->isRunning()) {
|
||||||
result = res;
|
result = res;
|
||||||
loop->quit();
|
loop->quit();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
#else
|
||||||
|
connect(view(), &QWebEngineView::printFinished, this, [loop, &result](bool res) {
|
||||||
|
if (loop && loop->isRunning()) {
|
||||||
|
result = res;
|
||||||
|
loop->quit();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
view()->print(printer);
|
||||||
|
#endif
|
||||||
|
|
||||||
loop->exec();
|
loop->exec();
|
||||||
delete loop;
|
delete loop;
|
||||||
|
@ -463,10 +480,21 @@ bool WebPage::acceptNavigationRequest(const QUrl &url, QWebEnginePage::Navigatio
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||||
bool WebPage::certificateError(const QWebEngineCertificateError &error)
|
bool WebPage::certificateError(const QWebEngineCertificateError &error)
|
||||||
{
|
{
|
||||||
return mApp->networkManager()->certificateError(error, view());
|
return mApp->networkManager()->certificateError(error, view());
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
void WebPage::onCertificateError(QWebEngineCertificateError error)
|
||||||
|
{
|
||||||
|
auto mutableError = const_cast<QWebEngineCertificateError&>(error);
|
||||||
|
if (mApp->networkManager()->certificateError(mutableError, view()))
|
||||||
|
mutableError.acceptCertificate();
|
||||||
|
else
|
||||||
|
mutableError.rejectCertificate();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
QStringList WebPage::chooseFiles(QWebEnginePage::FileSelectionMode mode, const QStringList &oldFiles, const QStringList &acceptedMimeTypes)
|
QStringList WebPage::chooseFiles(QWebEnginePage::FileSelectionMode mode, const QStringList &oldFiles, const QStringList &acceptedMimeTypes)
|
||||||
{
|
{
|
||||||
|
|
|
@ -21,6 +21,9 @@
|
||||||
#include <QWebEnginePage>
|
#include <QWebEnginePage>
|
||||||
#include <QWebEngineScript>
|
#include <QWebEngineScript>
|
||||||
#include <QWebEngineFullScreenRequest>
|
#include <QWebEngineFullScreenRequest>
|
||||||
|
#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
|
||||||
|
#include <QPrinter>
|
||||||
|
#endif
|
||||||
#include <QVector>
|
#include <QVector>
|
||||||
#include <QElapsedTimer>
|
#include <QElapsedTimer>
|
||||||
|
|
||||||
|
@ -93,10 +96,15 @@ private Q_SLOTS:
|
||||||
void fullScreenRequested(QWebEngineFullScreenRequest fullScreenRequest);
|
void fullScreenRequested(QWebEngineFullScreenRequest fullScreenRequest);
|
||||||
void featurePermissionRequested(const QUrl &origin, const QWebEnginePage::Feature &feature);
|
void featurePermissionRequested(const QUrl &origin, const QWebEnginePage::Feature &feature);
|
||||||
void renderProcessTerminated(QWebEnginePage::RenderProcessTerminationStatus terminationStatus, int exitCode);
|
void renderProcessTerminated(QWebEnginePage::RenderProcessTerminationStatus terminationStatus, int exitCode);
|
||||||
|
#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
|
||||||
|
void onCertificateError(QWebEngineCertificateError error);
|
||||||
|
#endif
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool acceptNavigationRequest(const QUrl &url, QWebEnginePage::NavigationType type, bool isMainFrame) override;
|
bool acceptNavigationRequest(const QUrl &url, QWebEnginePage::NavigationType type, bool isMainFrame) override;
|
||||||
|
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||||
bool certificateError(const QWebEngineCertificateError &error) override;
|
bool certificateError(const QWebEngineCertificateError &error) override;
|
||||||
|
#endif
|
||||||
QStringList chooseFiles(FileSelectionMode mode, const QStringList &oldFiles, const QStringList &acceptedMimeTypes) override;
|
QStringList chooseFiles(FileSelectionMode mode, const QStringList &oldFiles, const QStringList &acceptedMimeTypes) override;
|
||||||
QWebEnginePage* createWindow(QWebEnginePage::WebWindowType type) override;
|
QWebEnginePage* createWindow(QWebEnginePage::WebWindowType type) override;
|
||||||
|
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
#include "webpage.h"
|
#include "webpage.h"
|
||||||
|
|
||||||
#include <QPaintEvent>
|
#include <QPaintEvent>
|
||||||
|
#include <QPainter>
|
||||||
|
|
||||||
WebScrollBar::WebScrollBar(Qt::Orientation orientation, WebView *view)
|
WebScrollBar::WebScrollBar(Qt::Orientation orientation, WebView *view)
|
||||||
: QScrollBar(orientation)
|
: QScrollBar(orientation)
|
||||||
|
|
|
@ -26,6 +26,7 @@
|
||||||
|
|
||||||
#include <QPointer>
|
#include <QPointer>
|
||||||
#include <QPaintEvent>
|
#include <QPaintEvent>
|
||||||
|
#include <QPainter>
|
||||||
#include <QWebEngineProfile>
|
#include <QWebEngineProfile>
|
||||||
#include <QWebEngineScriptCollection>
|
#include <QWebEngineScriptCollection>
|
||||||
#include <QStyle>
|
#include <QStyle>
|
||||||
|
@ -210,8 +211,14 @@ void WebScrollBarManager::createUserScript(int thickness)
|
||||||
|
|
||||||
void WebScrollBarManager::removeUserScript()
|
void WebScrollBarManager::removeUserScript()
|
||||||
{
|
{
|
||||||
|
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||||
QWebEngineScript script = mApp->webProfile()->scripts()->findScript(QSL("_falkon_scrollbar"));
|
QWebEngineScript script = mApp->webProfile()->scripts()->findScript(QSL("_falkon_scrollbar"));
|
||||||
mApp->webProfile()->scripts()->remove(script);
|
mApp->webProfile()->scripts()->remove(script);
|
||||||
|
#else
|
||||||
|
for (const QWebEngineScript &script : mApp->webProfile()->scripts()->find(QSL("_falkon_scrollbar"))) {
|
||||||
|
mApp->webProfile()->scripts()->remove(script);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
QSize WebScrollBarManager::viewportSize(WebView *view, int thickness) const
|
QSize WebScrollBarManager::viewportSize(WebView *view, int thickness) const
|
||||||
|
|
|
@ -44,7 +44,11 @@
|
||||||
#include <QWebEngineHistory>
|
#include <QWebEngineHistory>
|
||||||
#include <QClipboard>
|
#include <QClipboard>
|
||||||
#include <QMimeData>
|
#include <QMimeData>
|
||||||
|
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||||
#include <QWebEngineContextMenuData>
|
#include <QWebEngineContextMenuData>
|
||||||
|
#else
|
||||||
|
#include <QWebEngineContextMenuRequest>
|
||||||
|
#endif
|
||||||
#include <QStackedLayout>
|
#include <QStackedLayout>
|
||||||
#include <QScrollBar>
|
#include <QScrollBar>
|
||||||
#include <QPrintDialog>
|
#include <QPrintDialog>
|
||||||
|
@ -146,7 +150,9 @@ void WebView::setPage(WebPage *page)
|
||||||
Q_EMIT m_page->loadFinished(true);
|
Q_EMIT m_page->loadFinished(true);
|
||||||
}
|
}
|
||||||
mApp->plugins()->emitWebPageDeleted(m_page);
|
mApp->plugins()->emitWebPageDeleted(m_page);
|
||||||
|
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||||
m_page->setView(nullptr);
|
m_page->setView(nullptr);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
page->setParent(this);
|
page->setParent(this);
|
||||||
|
@ -403,10 +409,17 @@ void WebView::printPage()
|
||||||
m_page->printToPdf(dialog->printer()->outputFileName(), dialog->printer()->pageLayout());
|
m_page->printToPdf(dialog->printer()->outputFileName(), dialog->printer()->pageLayout());
|
||||||
delete dialog;
|
delete dialog;
|
||||||
} else {
|
} else {
|
||||||
|
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||||
m_page->print(dialog->printer(), [=](bool success) {
|
m_page->print(dialog->printer(), [=](bool success) {
|
||||||
Q_UNUSED(success);
|
Q_UNUSED(success);
|
||||||
delete dialog;
|
delete dialog;
|
||||||
});
|
});
|
||||||
|
#else
|
||||||
|
connect(this, &QWebEngineView::printFinished, this, [&dialog](bool success) {
|
||||||
|
Q_UNUSED(success);
|
||||||
|
delete dialog;
|
||||||
|
});
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -670,7 +683,15 @@ void WebView::createContextMenu(QMenu *menu, WebHitTestResult &hitTest)
|
||||||
// cppcheck-suppress variableScope
|
// cppcheck-suppress variableScope
|
||||||
int spellCheckActionCount = 0;
|
int spellCheckActionCount = 0;
|
||||||
|
|
||||||
const QWebEngineContextMenuData &contextMenuData = page()->contextMenuData();
|
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||||
|
const Q_WEB_ENGINE_CONTEXT_MENU_DATA_CLASS &contextMenuData = page()->contextMenuData();
|
||||||
|
#else
|
||||||
|
const Q_WEB_ENGINE_CONTEXT_MENU_DATA_CLASS *contextMenuDataPtr = lastContextMenuRequest();
|
||||||
|
if (contextMenuDataPtr == NULL)
|
||||||
|
return;
|
||||||
|
const Q_WEB_ENGINE_CONTEXT_MENU_DATA_CLASS &contextMenuData = *contextMenuDataPtr;
|
||||||
|
#endif
|
||||||
|
|
||||||
hitTest.updateWithContextMenuData(contextMenuData);
|
hitTest.updateWithContextMenuData(contextMenuData);
|
||||||
|
|
||||||
if (!contextMenuData.misspelledWord().isEmpty()) {
|
if (!contextMenuData.misspelledWord().isEmpty()) {
|
||||||
|
|
|
@ -121,7 +121,12 @@ void SearchToolBar::searchText(const QString &text)
|
||||||
{
|
{
|
||||||
m_searchRequests++;
|
m_searchRequests++;
|
||||||
QPointer<SearchToolBar> guard = this;
|
QPointer<SearchToolBar> guard = this;
|
||||||
|
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||||
m_view->findText(text, m_findFlags, [=](bool found) {
|
m_view->findText(text, m_findFlags, [=](bool found) {
|
||||||
|
#else
|
||||||
|
m_view->findText(text, m_findFlags, [=](QWebEngineFindTextResult result) {
|
||||||
|
bool found = result.numberOfMatches() > 0;
|
||||||
|
#endif
|
||||||
if (!guard) {
|
if (!guard) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
#ifndef SEARCHTOOLBAR_H
|
#ifndef SEARCHTOOLBAR_H
|
||||||
#define SEARCHTOOLBAR_H
|
#define SEARCHTOOLBAR_H
|
||||||
|
|
||||||
|
#include <QWidget>
|
||||||
#include <QWebEnginePage>
|
#include <QWebEnginePage>
|
||||||
#include <QtWebEngineCoreVersion>
|
#include <QtWebEngineCoreVersion>
|
||||||
|
|
||||||
|
|
|
@ -32,10 +32,11 @@ endif()
|
||||||
if (UNIX AND NOT APPLE)
|
if (UNIX AND NOT APPLE)
|
||||||
install(TARGETS falkon ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
|
install(TARGETS falkon ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
|
||||||
install(DIRECTORY ${CMAKE_SOURCE_DIR}/themes DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/falkon)
|
install(DIRECTORY ${CMAKE_SOURCE_DIR}/themes DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/falkon)
|
||||||
if (KF5I18n_FOUND)
|
if (KF${KF_MAJOR_VERSION}I18n_FOUND)
|
||||||
ki18n_install(${CMAKE_SOURCE_DIR}/po)
|
ki18n_install(${CMAKE_SOURCE_DIR}/po)
|
||||||
endif()
|
endif()
|
||||||
ecm_install_po_files_as_qm(${CMAKE_SOURCE_DIR}/poqm)
|
# TODO Qt6 port ?
|
||||||
|
#ecm_install_po_files_as_qm(${CMAKE_SOURCE_DIR}/poqm)
|
||||||
|
|
||||||
install(PROGRAMS ../../linux/applications/org.kde.falkon.desktop DESTINATION ${KDE_INSTALL_APPDIR})
|
install(PROGRAMS ../../linux/applications/org.kde.falkon.desktop DESTINATION ${KDE_INSTALL_APPDIR})
|
||||||
|
|
||||||
|
|
|
@ -25,6 +25,7 @@
|
||||||
#include <QMouseEvent>
|
#include <QMouseEvent>
|
||||||
#include <QSettings>
|
#include <QSettings>
|
||||||
#include <QIcon>
|
#include <QIcon>
|
||||||
|
#include <QPainter>
|
||||||
|
|
||||||
ScrollIndicator::ScrollIndicator(QWidget *parent)
|
ScrollIndicator::ScrollIndicator(QWidget *parent)
|
||||||
: QLabel(parent)
|
: QLabel(parent)
|
||||||
|
|
|
@ -6,8 +6,8 @@ add_subdirectory(GreaseMonkey)
|
||||||
add_subdirectory(MouseGestures)
|
add_subdirectory(MouseGestures)
|
||||||
add_subdirectory(PIM)
|
add_subdirectory(PIM)
|
||||||
add_subdirectory(StatusBarIcons)
|
add_subdirectory(StatusBarIcons)
|
||||||
add_subdirectory(TabManager)
|
## TODO ## add_subdirectory(TabManager)
|
||||||
add_subdirectory(VerticalTabs)
|
## TODO ## add_subdirectory(VerticalTabs)
|
||||||
|
|
||||||
if (GNOME_KEYRING_FOUND)
|
if (GNOME_KEYRING_FOUND)
|
||||||
add_subdirectory(GnomeKeyringPasswords)
|
add_subdirectory(GnomeKeyringPasswords)
|
||||||
|
|
|
@ -37,7 +37,7 @@ struct FlashCookie {
|
||||||
QString contents;
|
QString contents;
|
||||||
QDateTime lastModification;
|
QDateTime lastModification;
|
||||||
|
|
||||||
bool operator ==(const FlashCookie &other) {
|
bool operator ==(const FlashCookie &other) const {
|
||||||
return (this->name == other.name && this->path == other.path);
|
return (this->name == other.name && this->path == other.path);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -182,7 +182,13 @@ void GM_Manager::disableScript(GM_Script* script)
|
||||||
m_disabledScripts.append(script->fullName());
|
m_disabledScripts.append(script->fullName());
|
||||||
|
|
||||||
QWebEngineScriptCollection *collection = mApp->webProfile()->scripts();
|
QWebEngineScriptCollection *collection = mApp->webProfile()->scripts();
|
||||||
|
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||||
collection->remove(collection->findScript(script->fullName()));
|
collection->remove(collection->findScript(script->fullName()));
|
||||||
|
#else
|
||||||
|
for (const auto &script : collection->find(script->fullName())) {
|
||||||
|
collection->remove(script);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
bool GM_Manager::addScript(GM_Script* script)
|
bool GM_Manager::addScript(GM_Script* script)
|
||||||
|
@ -210,7 +216,13 @@ bool GM_Manager::removeScript(GM_Script* script, bool removeFile)
|
||||||
m_scripts.removeOne(script);
|
m_scripts.removeOne(script);
|
||||||
|
|
||||||
QWebEngineScriptCollection *collection = mApp->webProfile()->scripts();
|
QWebEngineScriptCollection *collection = mApp->webProfile()->scripts();
|
||||||
|
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||||
collection->remove(collection->findScript(script->fullName()));
|
collection->remove(collection->findScript(script->fullName()));
|
||||||
|
#else
|
||||||
|
for (const auto &script : collection->find(script->fullName())) {
|
||||||
|
collection->remove(script);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
m_disabledScripts.removeOne(script->fullName());
|
m_disabledScripts.removeOne(script->fullName());
|
||||||
|
|
||||||
|
@ -279,7 +291,13 @@ void GM_Manager::scriptChanged()
|
||||||
return;
|
return;
|
||||||
|
|
||||||
QWebEngineScriptCollection *collection = mApp->webProfile()->scripts();
|
QWebEngineScriptCollection *collection = mApp->webProfile()->scripts();
|
||||||
|
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||||
collection->remove(collection->findScript(script->fullName()));
|
collection->remove(collection->findScript(script->fullName()));
|
||||||
|
#else
|
||||||
|
for (const auto &script : collection->find(script->fullName())) {
|
||||||
|
collection->remove(script);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
collection->insert(script->webScript());
|
collection->insert(script->webScript());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -90,9 +90,9 @@ void GM_SettingsListDelegate::paint(QPainter* painter, const QStyleOptionViewIte
|
||||||
const int checkboxYPos = center - (checkboxSize / 2);
|
const int checkboxYPos = center - (checkboxSize / 2);
|
||||||
QStyleOptionViewItem opt2 = opt;
|
QStyleOptionViewItem opt2 = opt;
|
||||||
opt2.checkState == Qt::Checked ? opt2.state |= QStyle::State_On : opt2.state |= QStyle::State_Off;
|
opt2.checkState == Qt::Checked ? opt2.state |= QStyle::State_On : opt2.state |= QStyle::State_Off;
|
||||||
QRect styleCheckBoxRect = style->subElementRect(QStyle::SE_ViewItemCheckIndicator, &opt2, w);
|
QRect styleCheckBoxRect = style->subElementRect(QStyle::SE_ItemViewItemCheckIndicator, &opt2, w);
|
||||||
opt2.rect = QRect(leftPosition, checkboxYPos, styleCheckBoxRect.width(), styleCheckBoxRect.height());
|
opt2.rect = QRect(leftPosition, checkboxYPos, styleCheckBoxRect.width(), styleCheckBoxRect.height());
|
||||||
style->drawPrimitive(QStyle::PE_IndicatorViewItemCheck, &opt2, painter, w);
|
style->drawPrimitive(QStyle::PE_IndicatorItemViewItemCheck, &opt2, painter, w);
|
||||||
leftPosition = opt2.rect.right() + m_padding;
|
leftPosition = opt2.rect.right() + m_padding;
|
||||||
|
|
||||||
// Draw icon
|
// Draw icon
|
||||||
|
|
|
@ -4,13 +4,13 @@ if(POLICY CMP0071)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Get all relevant Qt include dirs, to pass them on to shiboken.
|
# Get all relevant Qt include dirs, to pass them on to shiboken.
|
||||||
get_property(QT_CORE_INCLUDE_DIRS TARGET Qt5::Core PROPERTY INTERFACE_INCLUDE_DIRECTORIES)
|
get_property(QT_CORE_INCLUDE_DIRS TARGET Qt${QT_MAJOR_VERSION}::Core PROPERTY INTERFACE_INCLUDE_DIRECTORIES)
|
||||||
get_property(QT_GUI_INCLUDE_DIRS TARGET Qt5::Gui PROPERTY INTERFACE_INCLUDE_DIRECTORIES)
|
get_property(QT_GUI_INCLUDE_DIRS TARGET Qt${QT_MAJOR_VERSION}::Gui PROPERTY INTERFACE_INCLUDE_DIRECTORIES)
|
||||||
get_property(QT_SQL_INCLUDE_DIRS TARGET Qt5::Sql PROPERTY INTERFACE_INCLUDE_DIRECTORIES)
|
get_property(QT_SQL_INCLUDE_DIRS TARGET Qt${QT_MAJOR_VERSION}::Sql PROPERTY INTERFACE_INCLUDE_DIRECTORIES)
|
||||||
get_property(QT_WIDGETS_INCLUDE_DIRS TARGET Qt5::Widgets PROPERTY INTERFACE_INCLUDE_DIRECTORIES)
|
get_property(QT_WIDGETS_INCLUDE_DIRS TARGET Qt${QT_MAJOR_VERSION}::Widgets PROPERTY INTERFACE_INCLUDE_DIRECTORIES)
|
||||||
get_property(QT_NETWORK_INCLUDE_DIRS TARGET Qt5::Network PROPERTY INTERFACE_INCLUDE_DIRECTORIES)
|
get_property(QT_NETWORK_INCLUDE_DIRS TARGET Qt${QT_MAJOR_VERSION}::Network PROPERTY INTERFACE_INCLUDE_DIRECTORIES)
|
||||||
get_property(QT_WEBENGINECORE_INCLUDE_DIRS TARGET Qt5::WebEngineCore PROPERTY INTERFACE_INCLUDE_DIRECTORIES)
|
get_property(QT_WEBENGINECORE_INCLUDE_DIRS TARGET Qt${QT_MAJOR_VERSION}::WebEngineCore PROPERTY INTERFACE_INCLUDE_DIRECTORIES)
|
||||||
get_property(QT_WEBENGINEWIDGETS_INCLUDE_DIRS TARGET Qt5::WebEngineWidgets PROPERTY INTERFACE_INCLUDE_DIRECTORIES)
|
get_property(QT_WEBENGINEWIDGETS_INCLUDE_DIRS TARGET Qt${QT_MAJOR_VERSION}::WebEngineWidgets PROPERTY INTERFACE_INCLUDE_DIRECTORIES)
|
||||||
set(QT_INCLUDE_DIRS
|
set(QT_INCLUDE_DIRS
|
||||||
${QT_CORE_INCLUDE_DIRS}
|
${QT_CORE_INCLUDE_DIRS}
|
||||||
${QT_GUI_INCLUDE_DIRS}
|
${QT_GUI_INCLUDE_DIRS}
|
||||||
|
@ -134,9 +134,15 @@ set(GENERATED_SOURCES_DEPENDENCIES
|
||||||
${TYPESYSTEM_FILE}
|
${TYPESYSTEM_FILE}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if (QT_MAJOR_VERSION STREQUAL "6")
|
||||||
|
set(PYSIDE_VERSION "6")
|
||||||
|
else()
|
||||||
|
set(PYSIDE_VERSION "2")
|
||||||
|
endif()
|
||||||
|
|
||||||
# Add custom target to run shiboken.
|
# Add custom target to run shiboken.
|
||||||
add_custom_command(OUTPUT ${GENERATED_SOURCES}
|
add_custom_command(OUTPUT ${GENERATED_SOURCES}
|
||||||
COMMAND Shiboken2::shiboken2
|
COMMAND Shiboken${PYSIDE_VERSION}::shiboken${PYSIDE_VERSION}
|
||||||
${SHIBOKEN_OPTIONS} ${GLOBAL_HEADER} ${TYPESYSTEM_FILE}
|
${SHIBOKEN_OPTIONS} ${GLOBAL_HEADER} ${TYPESYSTEM_FILE}
|
||||||
DEPENDS ${GENERATED_SOURCES_DEPENDENCIES}
|
DEPENDS ${GENERATED_SOURCES_DEPENDENCIES}
|
||||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||||
|
@ -144,7 +150,7 @@ add_custom_command(OUTPUT ${GENERATED_SOURCES}
|
||||||
|
|
||||||
# We need to include the headers for the module bindings that we use.
|
# We need to include the headers for the module bindings that we use.
|
||||||
set(PYSIDE_ADDITIONAL_INCLUDES "")
|
set(PYSIDE_ADDITIONAL_INCLUDES "")
|
||||||
get_target_property(PYSIDE_INCLUDE_DIRS PySide2::pyside2 INTERFACE_INCLUDE_DIRECTORIES)
|
get_target_property(PYSIDE_INCLUDE_DIRS PySide${PYSIDE_VERSION}::pyside${PYSIDE_VERSION} INTERFACE_INCLUDE_DIRECTORIES)
|
||||||
foreach(INCLUDE_DIR ${PYSIDE_INCLUDE_DIRS})
|
foreach(INCLUDE_DIR ${PYSIDE_INCLUDE_DIRS})
|
||||||
list(APPEND PYSIDE_ADDITIONAL_INCLUDES "${INCLUDE_DIR}/QtCore")
|
list(APPEND PYSIDE_ADDITIONAL_INCLUDES "${INCLUDE_DIR}/QtCore")
|
||||||
list(APPEND PYSIDE_ADDITIONAL_INCLUDES "${INCLUDE_DIR}/QtGui")
|
list(APPEND PYSIDE_ADDITIONAL_INCLUDES "${INCLUDE_DIR}/QtGui")
|
||||||
|
@ -175,8 +181,8 @@ target_include_directories(PyFalkon
|
||||||
target_link_libraries(PyFalkon
|
target_link_libraries(PyFalkon
|
||||||
PRIVATE
|
PRIVATE
|
||||||
FalkonPrivate
|
FalkonPrivate
|
||||||
Shiboken2::libshiboken
|
Shiboken${PYSIDE_VERSION}::libshiboken
|
||||||
PySide2::pyside2
|
PySide${PYSIDE_VERSION}::pyside${PYSIDE_VERSION}
|
||||||
Python3::Python
|
Python3::Python
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@ macro(pyfalkon_tests)
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
add_executable(pyfalkontestrunner pyfalkontestrunner.cpp)
|
add_executable(pyfalkontestrunner pyfalkontestrunner.cpp)
|
||||||
target_link_libraries(pyfalkontestrunner FalkonPrivate Qt5::Test)
|
target_link_libraries(pyfalkontestrunner FalkonPrivate Qt${QT_MAJOR_VERSION}::Test)
|
||||||
|
|
||||||
pyfalkon_tests(
|
pyfalkon_tests(
|
||||||
basictest
|
basictest
|
||||||
|
|
|
@ -23,18 +23,26 @@
|
||||||
#include "browserwindow.h"
|
#include "browserwindow.h"
|
||||||
|
|
||||||
#include <QMenu>
|
#include <QMenu>
|
||||||
|
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||||
#include <QNetworkConfigurationManager>
|
#include <QNetworkConfigurationManager>
|
||||||
|
#endif
|
||||||
|
|
||||||
SBI_NetworkIcon::SBI_NetworkIcon(BrowserWindow* window)
|
SBI_NetworkIcon::SBI_NetworkIcon(BrowserWindow* window)
|
||||||
: SBI_Icon(window)
|
: SBI_Icon(window)
|
||||||
|
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||||
, m_networkConfiguration(new QNetworkConfigurationManager(this))
|
, m_networkConfiguration(new QNetworkConfigurationManager(this))
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
setObjectName(QSL("sbi_networkicon"));
|
setObjectName(QSL("sbi_networkicon"));
|
||||||
setCursor(Qt::PointingHandCursor);
|
setCursor(Qt::PointingHandCursor);
|
||||||
|
|
||||||
|
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||||
onlineStateChanged(m_networkConfiguration->isOnline());
|
onlineStateChanged(m_networkConfiguration->isOnline());
|
||||||
|
|
||||||
connect(m_networkConfiguration, &QNetworkConfigurationManager::onlineStateChanged, this, &SBI_NetworkIcon::onlineStateChanged);
|
connect(m_networkConfiguration, &QNetworkConfigurationManager::onlineStateChanged, this, &SBI_NetworkIcon::onlineStateChanged);
|
||||||
|
#else
|
||||||
|
onlineStateChanged(true);
|
||||||
|
#endif
|
||||||
connect(this, &ClickableLabel::clicked, this, &SBI_NetworkIcon::showMenu);
|
connect(this, &ClickableLabel::clicked, this, &SBI_NetworkIcon::showMenu);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -97,12 +105,16 @@ void SBI_NetworkIcon::updateToolTip()
|
||||||
{
|
{
|
||||||
QString tooltip = tr("Shows network status and manages proxy<br/><br/><b>Network:</b><br/>%1<br/><br/><b>Proxy:</b><br/>%2");
|
QString tooltip = tr("Shows network status and manages proxy<br/><br/><b>Network:</b><br/>%1<br/><br/><b>Proxy:</b><br/>%2");
|
||||||
|
|
||||||
|
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||||
if (m_networkConfiguration->isOnline()) {
|
if (m_networkConfiguration->isOnline()) {
|
||||||
tooltip = tooltip.arg(tr("Connected"));
|
tooltip = tooltip.arg(tr("Connected"));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
tooltip = tooltip.arg(tr("Offline"));
|
tooltip = tooltip.arg(tr("Offline"));
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
tooltip = tooltip.arg(tr("Connected"));
|
||||||
|
#endif
|
||||||
|
|
||||||
switch (QNetworkProxy::applicationProxy().type()) {
|
switch (QNetworkProxy::applicationProxy().type()) {
|
||||||
case QNetworkProxy::DefaultProxy:
|
case QNetworkProxy::DefaultProxy:
|
||||||
|
@ -125,7 +137,11 @@ void SBI_NetworkIcon::updateToolTip()
|
||||||
setToolTip(tooltip);
|
setToolTip(tooltip);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||||
void SBI_NetworkIcon::enterEvent(QEvent* event)
|
void SBI_NetworkIcon::enterEvent(QEvent* event)
|
||||||
|
#else
|
||||||
|
void SBI_NetworkIcon::enterEvent(QEnterEvent* event)
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
updateToolTip();
|
updateToolTip();
|
||||||
|
|
||||||
|
|
|
@ -40,9 +40,16 @@ private Q_SLOTS:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void updateToolTip();
|
void updateToolTip();
|
||||||
|
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||||
void enterEvent(QEvent* event) override;
|
void enterEvent(QEvent* event) override;
|
||||||
|
#else
|
||||||
|
void enterEvent(QEnterEvent* event) override;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||||
|
// TODO - should we try to replace the online status detection using Qt 6?
|
||||||
QNetworkConfigurationManager* m_networkConfiguration;
|
QNetworkConfigurationManager* m_networkConfiguration;
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // SBI_NETWORKICON_H
|
#endif // SBI_NETWORKICON_H
|
||||||
|
|
|
@ -34,7 +34,9 @@
|
||||||
#include "tabcontextmenu.h"
|
#include "tabcontextmenu.h"
|
||||||
#include "tabbar.h"
|
#include "tabbar.h"
|
||||||
|
|
||||||
|
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||||
#include <QDesktopWidget>
|
#include <QDesktopWidget>
|
||||||
|
#endif
|
||||||
#include <QDialogButtonBox>
|
#include <QDialogButtonBox>
|
||||||
#include <QStackedWidget>
|
#include <QStackedWidget>
|
||||||
#include <QDialog>
|
#include <QDialog>
|
||||||
|
@ -561,7 +563,12 @@ void TabManagerWidget::detachSelectedTabs(const QMultiHash<BrowserWindow*, WebTa
|
||||||
}
|
}
|
||||||
|
|
||||||
BrowserWindow* newWindow = mApp->createWindow(Qz::BW_OtherRestoredWindow);
|
BrowserWindow* newWindow = mApp->createWindow(Qz::BW_OtherRestoredWindow);
|
||||||
newWindow->move(mApp->desktop()->availableGeometry(this).topLeft() + QPoint(30, 30));
|
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||||
|
const QRect &availableGeometryForScreen = mApp->desktop()->availableGeometry(this);
|
||||||
|
#else
|
||||||
|
const QRect &availableGeometryForScreen = screen()->availableGeometry();
|
||||||
|
#endif
|
||||||
|
newWindow->move(availableGeometryForScreen.topLeft() + QPoint(30, 30));
|
||||||
|
|
||||||
detachTabsTo(newWindow, tabsHash);
|
detachTabsTo(newWindow, tabsHash);
|
||||||
}
|
}
|
||||||
|
@ -880,7 +887,11 @@ QStringList TabTreeWidget::mimeTypes() const
|
||||||
return types;
|
return types;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||||
QMimeData *TabTreeWidget::mimeData(const QList<QTreeWidgetItem*> items) const
|
QMimeData *TabTreeWidget::mimeData(const QList<QTreeWidgetItem*> items) const
|
||||||
|
#else
|
||||||
|
QMimeData *TabTreeWidget::mimeData(const QList<QTreeWidgetItem*> &items) const
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
auto* mimeData = new QMimeData();
|
auto* mimeData = new QMimeData();
|
||||||
QByteArray encodedData;
|
QByteArray encodedData;
|
||||||
|
|
|
@ -44,7 +44,11 @@ public:
|
||||||
|
|
||||||
Qt::DropActions supportedDropActions() const override;
|
Qt::DropActions supportedDropActions() const override;
|
||||||
QStringList mimeTypes() const override;
|
QStringList mimeTypes() const override;
|
||||||
|
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||||
QMimeData* mimeData(const QList<QTreeWidgetItem*> items) const override;
|
QMimeData* mimeData(const QList<QTreeWidgetItem*> items) const override;
|
||||||
|
#else
|
||||||
|
QMimeData* mimeData(const QList<QTreeWidgetItem*> &items) const override;
|
||||||
|
#endif
|
||||||
bool dropMimeData(QTreeWidgetItem *parent, int index, const QMimeData *data, Qt::DropAction action) override;
|
bool dropMimeData(QTreeWidgetItem *parent, int index, const QMimeData *data, Qt::DropAction action) override;
|
||||||
|
|
||||||
void setEnableDragTabs(bool enable);
|
void setEnableDragTabs(bool enable);
|
||||||
|
|
|
@ -25,7 +25,9 @@
|
||||||
#include "statusbar.h"
|
#include "statusbar.h"
|
||||||
#include "navigationbar.h"
|
#include "navigationbar.h"
|
||||||
|
|
||||||
|
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||||
#include <QDesktopWidget>
|
#include <QDesktopWidget>
|
||||||
|
#endif
|
||||||
#include <QAction>
|
#include <QAction>
|
||||||
#include <QStyle>
|
#include <QStyle>
|
||||||
|
|
||||||
|
@ -212,7 +214,12 @@ void TabManagerWidgetController::showSideBySide()
|
||||||
if (!defaultTabManager()) {
|
if (!defaultTabManager()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||||
const QRect &availableGeometry = mApp->desktop()->availableGeometry(defaultTabManager());
|
const QRect &availableGeometry = mApp->desktop()->availableGeometry(defaultTabManager());
|
||||||
|
#else
|
||||||
|
const QRect &availableGeometry = defaultTabManager()->screen()->availableGeometry();
|
||||||
|
#endif
|
||||||
static int frameWidth = (defaultTabManager()->frameGeometry().width() - defaultTabManager()->geometry().width()) / 2;
|
static int frameWidth = (defaultTabManager()->frameGeometry().width() - defaultTabManager()->geometry().width()) / 2;
|
||||||
static int titleBarHeight = defaultTabManager()->style()->pixelMetric(QStyle::PM_TitleBarHeight);
|
static int titleBarHeight = defaultTabManager()->style()->pixelMetric(QStyle::PM_TitleBarHeight);
|
||||||
|
|
||||||
|
|
|
@ -213,7 +213,7 @@ void TabTreeDelegate::paint(QPainter *painter, const QStyleOptionViewItem &optio
|
||||||
// Draw close button
|
// Draw close button
|
||||||
if (m_closeButton->isVisible(hovered, selected)) {
|
if (m_closeButton->isVisible(hovered, selected)) {
|
||||||
QStyleOptionButton o;
|
QStyleOptionButton o;
|
||||||
o.init(m_closeButton);
|
o.initFrom(m_closeButton);
|
||||||
|
|
||||||
const bool hovered = closeButtonRect(index).contains(m_view->viewport()->mapFromGlobal(QCursor::pos()));
|
const bool hovered = closeButtonRect(index).contains(m_view->viewport()->mapFromGlobal(QCursor::pos()));
|
||||||
const bool pressed = hovered && QApplication::mouseButtons() == Qt::LeftButton;
|
const bool pressed = hovered && QApplication::mouseButtons() == Qt::LeftButton;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user