Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Qt 6 Building Porting #1770

Draft
wants to merge 45 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
ae254e4
qt6: CMakeLists: hello qt6
Chiitoo Jul 3, 2024
b2496e0
qt6: remove instances of 'stream.setCodec("UTF-8");'
Chiitoo Jul 3, 2024
2859416
qt6: QtCore/QTextCodec--
Chiitoo Jul 3, 2024
009f15a
qt6: QtWidgets/QDesktopWidget--
Chiitoo Jul 3, 2024
96caeb5
qt6: QNetworkConfigurationManager--
Chiitoo Jul 3, 2024
003afce
qt6: move 'QWebEngineCertificateError' to 'QtWebEngineCore'
Chiitoo Jul 3, 2024
51e7f18
qt6: move 'QWebEngineFullScreenRequest' to 'QtWebEngineCore'
Chiitoo Jul 3, 2024
52d5a60
qt6: move 'QtWebEngineWidgets' to 'QtWebEngineCore'
Chiitoo Jul 3, 2024
a17718a
qt6: move 'QWebEngineDownloadItem' to 'QWebEngineDownloadRequest'
Chiitoo Jul 3, 2024
6e16db0
qt6: move 'QActionGroup' to 'QtGui'
Chiitoo Jul 3, 2024
dee2ba6
qt6: move 'QAction' to 'QtGui'
Chiitoo Jul 3, 2024
dc51978
qt6: move 'QFileSystemModel' to 'QtGui'
Chiitoo Jul 3, 2024
88a49ce
qt6: move 'QShortcut' to 'QtGui'
Chiitoo Jul 3, 2024
c423396
qt6: 's/setMargin/setContentsMargins/'
Chiitoo Jul 3, 2024
67371d5
qt6: 's/init()/initFrom()'
Chiitoo Jul 3, 2024
fd8329f
qt6: 's/QEvent/QEnterEvent/'
Chiitoo Jul 3, 2024
64533e9
qt6: 's/TextColorRole/ForegroundRole'
Chiitoo Jul 3, 2024
f064354
qt6: 's/toTime_t/toSecsSinceEpoch/'
Chiitoo Jul 3, 2024
c4434d5
qt6: 's/fromTime_t/fromSecsSinceEpoch'
Chiitoo Jul 3, 2024
71eba52
qt6: 's/QFontMetrics::width/QFontMetrics::horizontalAdvance/'
Chiitoo Jul 3, 2024
f2c67c9
qt6: 's/QWebEngineDownloadItem/QWebEngineDownloadRequest/'
Chiitoo Jul 3, 2024
1452efc
qt6: 's/QWebEngineSettings::globalSettings/QWebEngineSettings::defaul…
Chiitoo Jul 3, 2024
7d7a005
qt6: 's/QApplication::desktop()/QGuiApplication::primaryScreen()/'
Chiitoo Jul 3, 2024
2d8587a
qt6: 's/HighQualityAntialiasing/Antialiasing/'
Chiitoo Jul 3, 2024
efd96dd
qt6: 's/midRef/mid/'
Chiitoo Jul 3, 2024
25a8e3e
qt6: 'FollowRedirectsAttribute' has been removed
Chiitoo Jul 3, 2024
26e1596
qt6: rename downloadrequest members
Chiitoo Jul 3, 2024
034da23
qt6: use 'defaultProfile->settings' instead of 'defaultSettings'
Chiitoo Jul 3, 2024
e0ff535
qt6: include 'QtGui/QActionGroup'
Chiitoo Jul 3, 2024
b0427aa
qt6: include 'QtWebEngineCore/QWebEngineHttpRequest'
Chiitoo Jul 3, 2024
324a094
qt6: include 'QtCore/QFile'
Chiitoo Jul 3, 2024
183b3bc
qt6: 'topLevelDomain()' is no more; port to 'qIsEffectiveTLD()'?
Chiitoo Jul 3, 2024
106bca8
qt6: call to member function 'insert' is ambiguous
Chiitoo Jul 3, 2024
d5b51f1
qt6: call to member function 'mapTo' is ambiguous
Chiitoo Jul 3, 2024
bb30cc7
qt6: chosen constructor is explicit in copy-initialization
Chiitoo Jul 3, 2024
eb25add
qt6: conversion from 'int' to 'QChar' is ambiguous
Chiitoo Jul 3, 2024
2b61918
qt6: invalid operands to binary expression
Chiitoo Jul 3, 2024
c256df3
qt6: no matching member function for call to 'icon'
Chiitoo Jul 3, 2024
6997f0c
qt6: no member named 'print' in 'Otter::QtWebEnginePage'
Chiitoo Jul 3, 2024
1c6823a
qt6: no type named 'PromiseType' in 'QtPrivate::ArgResolver<Otter::Ad…
Chiitoo Jul 3, 2024
45de1b3
qt6: no viable conversion from 'QPixmap' to 'const QCursor'
Chiitoo Jul 3, 2024
29f0c30
qt6: non-virtual member function marked 'override' hides virtual memb…
Chiitoo Jul 3, 2024
0aa337e
qt6: reference to non-static member function must be called; did you …
Chiitoo Jul 3, 2024
6b46a75
qt6: use of overloaded operator '!=' is ambiguous (with operand types…
Chiitoo Jul 3, 2024
af2dab4
qt6: linktime undefined reference to `Otter::Utils::createLocale(QStr…
Chiitoo Jul 3, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
126 changes: 64 additions & 62 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -68,21 +68,21 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
include(FeatureSummary)
include(GNUInstallDirs)

option(ENABLE_QTWEBENGINE "Enable QtWebEngine backend (requires QtWebEngine 5.15)" ON)
option(ENABLE_QTWEBKIT "Enable QtWebKit backend (requires QtWebKit 5.212)" ON)
option(ENABLE_QTWEBENGINE "Enable QtWebEngine backend (requires QtWebEngine 6.5.3)" ON)
#option(ENABLE_QTWEBKIT "Enable QtWebKit backend (requires QtWebKit 5.212)" ON)
option(ENABLE_CRASHREPORTS "Enable built-in crash reporting (only for official builds)" OFF)
option(ENABLE_DBUS "Enable D-Bus based integration for notifications (only freedesktop.org compatible platforms)" ON)
option(ENABLE_SPELLCHECK "Enable Hunspell based spell checking" ON)

find_package(Qt5 5.15.0 REQUIRED COMPONENTS Core Gui Multimedia Network PrintSupport Qml Svg Widgets)
find_package(Qt5 5.15.0 QUIET COMPONENTS WebEngineWidgets)
find_package(Qt5WebKitWidgets 5.212.0 QUIET)
find_package(Qt6 6.5.3 REQUIRED COMPONENTS Core Gui Multimedia Network PrintSupport Qml Svg Widgets)
find_package(Qt6 6.5.3 QUIET COMPONENTS WebEngineWidgets)
#find_package(Qt5WebKitWidgets 5.212.0 QUIET)
find_package(Hunspell 1.5.0 QUIET)

set_package_properties(Qt5WebEngineCore PROPERTIES URL "https://www.qt.io/" DESCRIPTION "QtWebEngine based backend (core)" TYPE OPTIONAL)
set_package_properties(Qt5WebEngineWidgets PROPERTIES URL "https://www.qt.io/" DESCRIPTION "QtWebEngine based backend (widgets)" TYPE OPTIONAL)
set_package_properties(Qt5WebKit PROPERTIES URL "https://qtwebkit.github.io/" DESCRIPTION "QtWebKit based backend (core)" TYPE OPTIONAL)
set_package_properties(Qt5WebKitWidgets PROPERTIES URL "https://qtwebkit.github.io/" DESCRIPTION "QtWebKit based backend (widgets)" TYPE OPTIONAL)
set_package_properties(Qt6WebEngineCore PROPERTIES URL "https://www.qt.io/" DESCRIPTION "QtWebEngine based backend (core)" TYPE OPTIONAL)
set_package_properties(Qt6WebEngineWidgets PROPERTIES URL "https://www.qt.io/" DESCRIPTION "QtWebEngine based backend (widgets)" TYPE OPTIONAL)
#set_package_properties(Qt5WebKit PROPERTIES URL "https://qtwebkit.github.io/" DESCRIPTION "QtWebKit based backend (core)" TYPE OPTIONAL)
#set_package_properties(Qt5WebKitWidgets PROPERTIES URL "https://qtwebkit.github.io/" DESCRIPTION "QtWebKit based backend (widgets)" TYPE OPTIONAL)
set_package_properties(Hunspell PROPERTIES URL "https://hunspell.github.io/" DESCRIPTION "Generic spell checking support" TYPE OPTIONAL)

set(otter_src
Expand Down Expand Up @@ -295,11 +295,11 @@ set(otter_src
3rdparty/qrcodegen/qrcodegen.cpp
)

qt5_add_resources(otter_res
qt6_add_resources(otter_res
resources/resources.qrc
)

qt5_wrap_ui(otter_ui
qt6_wrap_ui(otter_ui
src/ui/AcceptCookieDialog.ui
src/ui/ActionParametersDialog.ui
src/ui/AuthenticationDialog.ui
Expand Down Expand Up @@ -373,16 +373,16 @@ qt5_wrap_ui(otter_ui
src/modules/windows/windows/WindowsContentsWidget.ui
)

foreach (_current_dir ${Qt5Widgets_PRIVATE_INCLUDE_DIRS})
foreach (_current_dir ${Qt6Widgets_PRIVATE_INCLUDE_DIRS})
if (EXISTS "${_current_dir}/private/qpixmapfilter_p.h")
add_definitions(-DOTTER_ENABLE_STARTPAGEBLUR)
include_directories(${Qt5Widgets_PRIVATE_INCLUDE_DIRS})
include_directories(${Qt6Widgets_PRIVATE_INCLUDE_DIRS})

break ()
endif ()
endforeach ()

if (TARGET Qt5::WebEngineWidgets AND ENABLE_QTWEBENGINE)
if (TARGET Qt6::WebEngineWidgets AND ENABLE_QTWEBENGINE)
add_definitions(-DOTTER_ENABLE_QTWEBENGINE)

list(APPEND OTTER_BACKENDS_WEB "QtWebEngine (experimental)")
Expand All @@ -396,44 +396,44 @@ if (TARGET Qt5::WebEngineWidgets AND ENABLE_QTWEBENGINE)
src/modules/backends/web/qtwebengine/QtWebEngineWebWidget.cpp
)

qt5_add_resources(otter_res
qt6_add_resources(otter_res
src/modules/backends/web/qtwebengine/QtWebEngineResources.qrc
)
endif ()

if (TARGET Qt5::WebKitWidgets AND ENABLE_QTWEBKIT)
add_definitions(-DOTTER_ENABLE_QTWEBKIT -DOTTER_QTWEBKIT_PLUGINS_AVAILABLE -DQT_STATICPLUGIN)

list(APPEND OTTER_BACKENDS_WEB "QtWebKit")

set(otter_src
${otter_src}
src/modules/backends/web/qtwebkit/qwebkitplatformplugin.h
src/modules/backends/web/qtwebkit/QtWebKitCookieJar.cpp
src/modules/backends/web/qtwebkit/QtWebKitFtpListingNetworkReply.cpp
src/modules/backends/web/qtwebkit/QtWebKitHistoryInterface.cpp
src/modules/backends/web/qtwebkit/QtWebKitNetworkManager.cpp
src/modules/backends/web/qtwebkit/QtWebKitNotificationPresenter.cpp
src/modules/backends/web/qtwebkit/QtWebKitPage.cpp
src/modules/backends/web/qtwebkit/QtWebKitPlugin.cpp
src/modules/backends/web/qtwebkit/QtWebKitPluginFactory.cpp
src/modules/backends/web/qtwebkit/QtWebKitWebBackend.cpp
src/modules/backends/web/qtwebkit/QtWebKitWebWidget.cpp
src/modules/backends/web/qtwebkit/3rdparty/qtftp/qftp.cpp
src/modules/backends/web/qtwebkit/3rdparty/qtftp/qurlinfo.cpp
)

if (TARGET Hunspell::Hunspell AND ENABLE_SPELLCHECK)
set(otter_src
${otter_src}
src/modules/backends/web/qtwebkit/QtWebKitSpellChecker.cpp
)
endif ()

qt5_add_resources(otter_res
src/modules/backends/web/qtwebkit/QtWebKitResources.qrc
)
endif ()
#if (TARGET Qt5::WebKitWidgets AND ENABLE_QTWEBKIT)
# add_definitions(-DOTTER_ENABLE_QTWEBKIT -DOTTER_QTWEBKIT_PLUGINS_AVAILABLE -DQT_STATICPLUGIN)
#
# list(APPEND OTTER_BACKENDS_WEB "QtWebKit")
#
# set(otter_src
# ${otter_src}
# src/modules/backends/web/qtwebkit/qwebkitplatformplugin.h
# src/modules/backends/web/qtwebkit/QtWebKitCookieJar.cpp
# src/modules/backends/web/qtwebkit/QtWebKitFtpListingNetworkReply.cpp
# src/modules/backends/web/qtwebkit/QtWebKitHistoryInterface.cpp
# src/modules/backends/web/qtwebkit/QtWebKitNetworkManager.cpp
# src/modules/backends/web/qtwebkit/QtWebKitNotificationPresenter.cpp
# src/modules/backends/web/qtwebkit/QtWebKitPage.cpp
# src/modules/backends/web/qtwebkit/QtWebKitPlugin.cpp
# src/modules/backends/web/qtwebkit/QtWebKitPluginFactory.cpp
# src/modules/backends/web/qtwebkit/QtWebKitWebBackend.cpp
# src/modules/backends/web/qtwebkit/QtWebKitWebWidget.cpp
# src/modules/backends/web/qtwebkit/3rdparty/qtftp/qftp.cpp
# src/modules/backends/web/qtwebkit/3rdparty/qtftp/qurlinfo.cpp
# )
#
# if (TARGET Hunspell::Hunspell AND ENABLE_SPELLCHECK)
# set(otter_src
# ${otter_src}
# src/modules/backends/web/qtwebkit/QtWebKitSpellChecker.cpp
# )
# endif ()
#
# qt5_add_resources(otter_res
# src/modules/backends/web/qtwebkit/QtWebKitResources.qrc
# )
#endif ()

if (ENABLE_CRASHREPORTS)
add_definitions(-DOTTER_ENABLE_CRASHREPORTS)
Expand Down Expand Up @@ -498,7 +498,7 @@ endif ()
if (WIN32)
add_definitions(-DUNICODE -D_UNICODE)

find_package(Qt5 5.15.0 QUIET COMPONENTS WinExtras)
# find_package(Qt5 5.15.0 QUIET COMPONENTS WinExtras)

if (MSVC)
set(CMAKE_PREFIX_PATH $ENV{QTDIR})
Expand All @@ -520,7 +520,7 @@ if (WIN32)
src/modules/platforms/windows/WindowsPlatformStyle.cpp
)
elseif (APPLE)
find_package(Qt5 5.15.0 QUIET COMPONENTS MacExtras)
# find_package(Qt5 5.15.0 QUIET COMPONENTS MacExtras)

set(CMAKE_OSX_DEPLOYMENT_TARGET 10.13)
set(MACOSX_BUNDLE_BUNDLE_NAME "Otter Browser")
Expand All @@ -539,9 +539,9 @@ elseif (APPLE)

set_source_files_properties(resources/icons/otter-browser.icns PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
elseif (UNIX)
find_package(Qt5 5.15.0 QUIET COMPONENTS DBus)
find_package(Qt6 6.5.3 QUIET COMPONENTS DBus)

if (TARGET Qt5::DBus AND ENABLE_DBUS)
if (TARGET Qt6::DBus AND ENABLE_DBUS)
add_definitions(-DOTTER_ENABLE_DBUS)
endif ()

Expand Down Expand Up @@ -605,38 +605,40 @@ add_executable(otter-browser WIN32 MACOSX_BUNDLE
${otter_src}
)

if (TARGET Qt5::WebEngineWidgets AND ENABLE_QTWEBENGINE)
target_link_libraries(otter-browser Qt5::WebEngineCore Qt5::WebEngineWidgets)
if (TARGET Qt6::WebEngineWidgets AND ENABLE_QTWEBENGINE)
target_link_libraries(otter-browser Qt6::WebEngineCore Qt6::WebEngineWidgets)
endif ()

if (TARGET Qt5::WebKitWidgets AND ENABLE_QTWEBKIT)
target_link_libraries(otter-browser Qt5::WebKit Qt5::WebKitWidgets)
endif ()
#if (TARGET Qt5::WebKitWidgets AND ENABLE_QTWEBKIT)
# target_link_libraries(otter-browser Qt5::WebKit Qt5::WebKitWidgets)
#endif ()

if (TARGET Hunspell::Hunspell AND ENABLE_SPELLCHECK)
target_link_libraries(otter-browser Hunspell::Hunspell)
endif ()

if (WIN32)
target_link_libraries(otter-browser Qt5::WinExtras ole32 shell32 advapi32 user32)
# target_link_libraries(otter-browser Qt5::WinExtras ole32 shell32 advapi32 user32)
target_link_libraries(otter-browser ole32 shell32 advapi32 user32)
elseif (APPLE)
find_library(FRAMEWORK_Cocoa Cocoa)
find_library(FRAMEWORK_Foundation Foundation)

set_target_properties(otter-browser PROPERTIES OUTPUT_NAME "Otter Browser")

target_link_libraries(otter-browser Qt5::MacExtras ${FRAMEWORK_Cocoa} ${FRAMEWORK_Foundation})
# target_link_libraries(otter-browser Qt5::MacExtras ${FRAMEWORK_Cocoa} ${FRAMEWORK_Foundation})
target_link_libraries(otter-browser ${FRAMEWORK_Cocoa} ${FRAMEWORK_Foundation})
elseif (UNIX)
if (TARGET Qt5::DBus AND ENABLE_DBUS)
target_link_libraries(otter-browser Qt5::DBus)
if (TARGET Qt6::DBus AND ENABLE_DBUS)
target_link_libraries(otter-browser Qt6::DBus)
endif ()

if (ENABLE_CRASHREPORTS)
target_link_libraries(otter-browser -lpthread)
endif ()
endif ()

target_link_libraries(otter-browser Qt5::Core Qt5::Gui Qt5::Multimedia Qt5::Network Qt5::PrintSupport Qt5::Qml Qt5::Svg Qt5::Widgets)
target_link_libraries(otter-browser Qt6::Core Qt6::Gui Qt6::Multimedia Qt6::Network Qt6::PrintSupport Qt6::Qml Qt6::Svg Qt6::Widgets)

set(XDG_APPS_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/share/applications CACHE FILEPATH "Install path for .desktop files")

Expand Down
4 changes: 2 additions & 2 deletions src/core/ActionsManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,6 @@ bool KeyboardProfile::save()
JsonSettings settings(SessionsManager::getWritableDataPath(QLatin1String("keyboard/") + m_identifier + QLatin1String(".json")));
QString comment;
QTextStream stream(&comment);
stream.setCodec("UTF-8");
stream << QLatin1String("Title: ") << (m_title.isEmpty() ? QT_TR_NOOP("(Untitled)") : m_title) << QLatin1Char('\n');
stream << QLatin1String("Description: ") << m_description << QLatin1Char('\n');
stream << QLatin1String("Type: keyboard-profile\n");
Expand Down Expand Up @@ -803,11 +802,12 @@ bool ActionsManager::isShortcutAllowed(const QKeySequence &shortcut, ShortcutChe
return false;
}

/* qt6: use of overloaded operator '!=' is ambiguous (with operand types 'QKeyCombination' and 'Qt::Key')
if ((check == AllChecks || check == DisallowSingleKeyShortcutCheck) && (!areSingleKeyShortcutsAllowed && (shortcut[0] == Qt::Key_Plus || !shortcut.toString(QKeySequence::PortableText).contains(QLatin1Char('+'))) && shortcut[0] != Qt::Key_Delete && !(shortcut[0] >= Qt::Key_F1 && shortcut[0] <= Qt::Key_F35)))
{
return false;
}

*/
if (check == AllChecks || check == DisallowStandardShortcutCheck)
{
if (m_disallowedShortcuts.isEmpty())
Expand Down
10 changes: 5 additions & 5 deletions src/core/AdblockContentFiltersProfile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,12 @@ void AdblockContentFiltersProfile::clear()
return;
}

/* qt6: no type named 'PromiseType' in 'QtPrivate::ArgResolver<Otter::AdblockContentFiltersProfile *>'
if (m_root)
{
QtConcurrent::run(this, &AdblockContentFiltersProfile::deleteNode, m_root);
}

*/
m_cosmeticFiltersRules.clear();
m_cosmeticFiltersDomainExceptions.clear();
m_cosmeticFiltersDomainRules.clear();
Expand Down Expand Up @@ -295,14 +296,16 @@ void AdblockContentFiltersProfile::parseRuleLine(const QString &rule)
Node *newNode(new Node());
newNode->value = value;

/* qt6: call to member function 'insert' is ambiguous
if (value == QLatin1Char('^'))
{
node->children.insert(0, newNode);
}
else
{
*/
node->children.append(newNode);
}
// }

node = newNode;
}
Expand Down Expand Up @@ -786,7 +789,6 @@ AdblockContentFiltersProfile::HeaderInformation AdblockContentFiltersProfile::lo
{
HeaderInformation information;
QTextStream stream(rulesDevice);
stream.setCodec("UTF-8");

const QString header(stream.readLine());

Expand Down Expand Up @@ -826,7 +828,6 @@ QHash<AdblockContentFiltersProfile::RuleType, quint32> AdblockContentFiltersProf
{
QHash<RuleType, quint32> information({{AnyRule, 0}, {ActiveRule, 0}, {CosmeticRule, 0}, {WildcardRule, 0}});
QTextStream stream(rulesDevice);
stream.setCodec("UTF-8");
stream.readLine();

while (!stream.atEnd())
Expand Down Expand Up @@ -1051,7 +1052,6 @@ bool AdblockContentFiltersProfile::loadRules()
file.open(QIODevice::ReadOnly | QIODevice::Text);

QTextStream stream(&file);
stream.setCodec("UTF-8");
stream.readLine(); // skip header

m_root = new Node();
Expand Down
2 changes: 1 addition & 1 deletion src/core/AdblockContentFiltersProfile.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ class AdblockContentFiltersProfile final : public ContentFiltersProfile
bool needsDomainCheck = false;
};

QChar value = 0;
QChar value;
QVarLengthArray<Node*, 1> children;
QVarLengthArray<Rule*, 1> rules;
};
Expand Down
2 changes: 2 additions & 0 deletions src/core/Application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1275,7 +1275,9 @@ void Application::setLocale(const QString &locale)
m_qtTranslator->load(QLatin1String("qt_") + (useSystemLocale ? QLocale::system().name() : identifier), QLibraryInfo::location(QLibraryInfo::TranslationsPath));
m_applicationTranslator->load((locale.endsWith(QLatin1String(".qm")) ? locale : QLatin1String("otter-browser_") + (useSystemLocale ? QLocale::system().name() : locale)), m_localePath);

/* qt6: linktime undefined reference to `Otter::Utils::createLocale(QString const&)'
QLocale::setDefault(Utils::createLocale(identifier));
*/
}

MainWindow* Application::createWindow(const QVariantMap &parameters, const Session::MainWindow &session)
Expand Down
4 changes: 2 additions & 2 deletions src/core/BookmarksManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,12 +158,12 @@ BookmarksModel::Bookmark* BookmarksManager::getBookmark(const QString &text)

if (text.startsWith(QLatin1Char('#')))
{
return m_model->getBookmark(text.midRef(1).toULongLong());
return m_model->getBookmark(text.mid(1).toULongLong());
}

if (text.startsWith(QLatin1String("bookmarks:")))
{
return (text.startsWith(QLatin1String("bookmarks:/")) ? m_model->getBookmarkByPath(text.mid(11)) : getBookmark(text.midRef(10).toULongLong()));
return (text.startsWith(QLatin1String("bookmarks:/")) ? m_model->getBookmarkByPath(text.mid(11)) : getBookmark(text.mid(10).toULongLong()));
}

return m_model->getBookmarkByKeyword(text);
Expand Down
2 changes: 1 addition & 1 deletion src/core/BookmarksModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1168,7 +1168,7 @@ BookmarksModel::Bookmark* BookmarksModel::getBookmarkByPath(const QString &path,

if (path.startsWith(QLatin1Char('#')))
{
return getBookmark(path.midRef(1).toULongLong());
return getBookmark(path.mid(1).toULongLong());
}

Bookmark *bookmark(m_rootItem);
Expand Down
3 changes: 3 additions & 0 deletions src/core/CookieJar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,7 @@ bool CookieJar::hasCookie(const QNetworkCookie &cookie) const

bool CookieJar::isDomainTheSame(const QUrl &first, const QUrl &second)
{
/* qt6: 'topLevelDomain()' is no more; port to 'qIsEffectiveTLD()'?
const QString firstTld(first.topLevelDomain());
const QString secondTld(second.topLevelDomain());

Expand All @@ -385,6 +386,8 @@ bool CookieJar::isDomainTheSame(const QUrl &first, const QUrl &second)
secondDomain.remove((secondDomain.length() - secondTld.length()), secondTld.length());

return firstDomain.section(QLatin1Char('.'), -1) == secondDomain.section(QLatin1Char('.'), -1);
*/
return false; // qt6
}

}
1 change: 0 additions & 1 deletion src/core/GesturesManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,6 @@ bool MouseProfile::save()
JsonSettings settings(SessionsManager::getWritableDataPath(QLatin1String("mouse/") + m_identifier + QLatin1String(".json")));
QString comment;
QTextStream stream(&comment);
stream.setCodec("UTF-8");
stream << QLatin1String("Title: ") << (m_title.isEmpty() ? QT_TR_NOOP("(Untitled)") : m_title) << QLatin1Char('\n');
stream << QLatin1String("Description: ") << m_description << QLatin1Char('\n');
stream << QLatin1String("Type: mouse-profile\n");
Expand Down
2 changes: 0 additions & 2 deletions src/core/IniSettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ IniSettings::IniSettings(const QString &path, QObject *parent) : QObject(parent)
QStringList comment;
bool isHeader(true);
QTextStream stream(&file);
stream.setCodec("UTF-8");

while (!stream.atEnd())
{
Expand Down Expand Up @@ -227,7 +226,6 @@ bool IniSettings::save(const QString &path, bool isAtomic)

bool canAddNewLine(false);
QTextStream stream(file);
stream.setCodec("UTF-8");

if (!m_comment.isEmpty())
{
Expand Down
2 changes: 1 addition & 1 deletion src/core/InputInterpreter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ InputInterpreter::InterpreterResult InputInterpreter::interpret(const QString &t

if (text.startsWith(QLatin1String("bookmarks:")))
{
BookmarksModel::Bookmark *bookmark(text.startsWith(QLatin1String("bookmarks:/")) ? BookmarksManager::getModel()->getBookmarkByPath(text.mid(11)) : BookmarksManager::getBookmark(text.midRef(10).toULongLong()));
BookmarksModel::Bookmark *bookmark(text.startsWith(QLatin1String("bookmarks:/")) ? BookmarksManager::getModel()->getBookmarkByPath(text.mid(11)) : BookmarksManager::getBookmark(text.mid(10).toULongLong()));

if (bookmark)
{
Expand Down
Loading