diff --git a/.github/actions/setup-dependencies/action.yml b/.github/actions/setup-dependencies/action.yml index 686e3c63d..4c19474b7 100644 --- a/.github/actions/setup-dependencies/action.yml +++ b/.github/actions/setup-dependencies/action.yml @@ -79,5 +79,5 @@ runs: aqtversion: "==3.1.*" version: ${{ inputs.qt-version }} arch: ${{ inputs.qt-architecture }} - modules: qt5compat qtimageformats qtnetworkauth + modules: qtimageformats qtnetworkauth cache: ${{ inputs.build-type == 'Debug' }} diff --git a/.github/actions/setup-dependencies/windows/action.yml b/.github/actions/setup-dependencies/windows/action.yml index f2985fd1b..ada060d66 100644 --- a/.github/actions/setup-dependencies/windows/action.yml +++ b/.github/actions/setup-dependencies/windows/action.yml @@ -76,7 +76,6 @@ runs: qt6-base:p qt6-svg:p qt6-imageformats:p - qt6-5compat:p qt6-networkauth:p cmark:p qrencode:p diff --git a/CMakeLists.txt b/CMakeLists.txt index 27d5108ba..f0ba31368 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -323,10 +323,9 @@ endif() include(QtVersionlessBackport) if(Launcher_QT_VERSION_MAJOR EQUAL 6) set(QT_VERSION_MAJOR 6) - find_package(Qt6 REQUIRED COMPONENTS Core CoreTools Widgets Concurrent Network Test Xml Core5Compat NetworkAuth OpenGL) + find_package(Qt6 REQUIRED COMPONENTS Core CoreTools Widgets Concurrent Network Test Xml NetworkAuth OpenGL) find_package(Qt6 COMPONENTS DBus) list(APPEND Launcher_QT_DBUS Qt6::DBus) - list(APPEND Launcher_QT_LIBS Qt6::Core5Compat) else() message(FATAL_ERROR "Qt version ${Launcher_QT_VERSION_MAJOR} is not supported") endif() diff --git a/launcher/LoggedProcess.cpp b/launcher/LoggedProcess.cpp index b1efc8bd3..bae45ad88 100644 --- a/launcher/LoggedProcess.cpp +++ b/launcher/LoggedProcess.cpp @@ -36,10 +36,10 @@ #include "LoggedProcess.h" #include -#include +#include #include "MessageLevel.h" -LoggedProcess::LoggedProcess(const QTextCodec* output_codec, QObject* parent) +LoggedProcess::LoggedProcess(const QStringConverter::Encoding output_codec, QObject* parent) : QProcess(parent), m_err_decoder(output_codec), m_out_decoder(output_codec) { // QProcess has a strange interface... let's map a lot of those into a few. @@ -57,9 +57,9 @@ LoggedProcess::~LoggedProcess() } } -QStringList LoggedProcess::reprocess(const QByteArray& data, QTextDecoder& decoder) +QStringList LoggedProcess::reprocess(const QByteArray& data, QStringDecoder& decoder) { - auto str = decoder.toUnicode(data); + QString str = decoder(data); if (!m_leftover_line.isEmpty()) { str.prepend(m_leftover_line); diff --git a/launcher/LoggedProcess.h b/launcher/LoggedProcess.h index 75ba15dfd..c01d464d1 100644 --- a/launcher/LoggedProcess.h +++ b/launcher/LoggedProcess.h @@ -36,7 +36,7 @@ #pragma once #include -#include +#include #include "MessageLevel.h" /* @@ -49,7 +49,7 @@ class LoggedProcess : public QProcess { enum State { NotRunning, Starting, FailedToStart, Running, Finished, Crashed, Aborted }; public: - explicit LoggedProcess(const QTextCodec* output_codec = QTextCodec::codecForLocale(), QObject* parent = 0); + explicit LoggedProcess(QStringConverter::Encoding outputEncoding = QStringConverter::System, QObject* parent = nullptr); virtual ~LoggedProcess(); State state() const; @@ -77,11 +77,11 @@ class LoggedProcess : public QProcess { private: void changeState(LoggedProcess::State state); - QStringList reprocess(const QByteArray& data, QTextDecoder& decoder); + QStringList reprocess(const QByteArray& data, QStringDecoder& decoder); private: - QTextDecoder m_err_decoder; - QTextDecoder m_out_decoder; + QStringDecoder m_err_decoder; + QStringDecoder m_out_decoder; QString m_leftover_line; bool m_killed = false; State m_state = NotRunning; diff --git a/launcher/minecraft/launch/LauncherPartLaunch.cpp b/launcher/minecraft/launch/LauncherPartLaunch.cpp index 388d55628..d824c904b 100644 --- a/launcher/minecraft/launch/LauncherPartLaunch.cpp +++ b/launcher/minecraft/launch/LauncherPartLaunch.cpp @@ -50,7 +50,7 @@ LauncherPartLaunch::LauncherPartLaunch(LaunchTask* parent) : LaunchStep(parent) - , m_process(parent->instance()->getJavaVersion().defaultsToUtf8() ? QTextCodec::codecForName("UTF-8") : QTextCodec::codecForLocale()) + , m_process(parent->instance()->getJavaVersion().defaultsToUtf8() ? QStringConverter::Utf8 : QStringConverter::System) { if (parent->instance()->settings()->get("CloseAfterLaunch").toBool()) { static const QRegularExpression s_settingUser(".*Setting user.+", QRegularExpression::CaseInsensitiveOption); diff --git a/launcher/ui/dialogs/AboutDialog.cpp b/launcher/ui/dialogs/AboutDialog.cpp index 9dcda1832..ca5706d21 100644 --- a/launcher/ui/dialogs/AboutDialog.cpp +++ b/launcher/ui/dialogs/AboutDialog.cpp @@ -48,9 +48,12 @@ namespace { QString getCreditsHtml() { QFile dataFile(":/documents/credits.html"); - dataFile.open(QIODevice::ReadOnly); - + if (!dataFile.open(QIODevice::ReadOnly)) { + qWarning() << "Failed to open file '" << dataFile.fileName() << "' for reading!"; + return {}; + } QString fileContent = QString::fromUtf8(dataFile.readAll()); + dataFile.close(); return fileContent.arg(QObject::tr("%1 Developers").arg(BuildConfig.LAUNCHER_DISPLAYNAME), QObject::tr("MultiMC Developers"), QObject::tr("With special thanks to")); diff --git a/libraries/LocalPeer/CMakeLists.txt b/libraries/LocalPeer/CMakeLists.txt index dd78647c0..539cea135 100644 --- a/libraries/LocalPeer/CMakeLists.txt +++ b/libraries/LocalPeer/CMakeLists.txt @@ -2,8 +2,7 @@ cmake_minimum_required(VERSION 3.15) project(LocalPeer) if(Launcher_QT_VERSION_MAJOR EQUAL 6) - find_package(Qt6 COMPONENTS Core Network Core5Compat REQUIRED) - list(APPEND LocalPeer_LIBS Qt${QT_VERSION_MAJOR}::Core5Compat) + find_package(Qt6 COMPONENTS Core Network REQUIRED) endif() set(SINGLE_SOURCES diff --git a/libraries/qdcss/CMakeLists.txt b/libraries/qdcss/CMakeLists.txt index 7e497feca..d1c1078cd 100644 --- a/libraries/qdcss/CMakeLists.txt +++ b/libraries/qdcss/CMakeLists.txt @@ -2,8 +2,7 @@ cmake_minimum_required(VERSION 3.15) project(qdcss) if(Launcher_QT_VERSION_MAJOR EQUAL 6) - find_package(Qt6 COMPONENTS Core Core5Compat REQUIRED) - list(APPEND qdcss_LIBS Qt${QT_VERSION_MAJOR}::Core5Compat) + find_package(Qt6 COMPONENTS Core REQUIRED) endif() set(QDCSS_SOURCES diff --git a/libraries/systeminfo/CMakeLists.txt b/libraries/systeminfo/CMakeLists.txt index 80b6b8094..e091637cf 100644 --- a/libraries/systeminfo/CMakeLists.txt +++ b/libraries/systeminfo/CMakeLists.txt @@ -1,8 +1,7 @@ project(systeminfo) if(Launcher_QT_VERSION_MAJOR EQUAL 6) - find_package(Qt6 COMPONENTS Core Core5Compat REQUIRED) - list(APPEND systeminfo_LIBS Qt${QT_VERSION_MAJOR}::Core5Compat) + find_package(Qt6 COMPONENTS Core REQUIRED) endif() set(systeminfo_SOURCES diff --git a/nix/unwrapped.nix b/nix/unwrapped.nix index 7d461a072..2aaba42a1 100644 --- a/nix/unwrapped.nix +++ b/nix/unwrapped.nix @@ -77,7 +77,6 @@ stdenv.mkDerivation { cmark kdePackages.qtbase kdePackages.qtnetworkauth - kdePackages.qt5compat qrencode libarchive tomlplusplus