Commit 475d4efd authored by Volker Krause's avatar Volker Krause
Browse files

Port away from Qt6::Core5Compat

parent 7c483f3b
Pipeline #124206 passed with stage
in 40 seconds
......@@ -38,9 +38,6 @@ ecm_setup_version(PROJECT VARIABLE_PREFIX KPKPASS
set(QT_REQUIRED_VERSION "5.15.2")
find_package(Qt${QT_MAJOR_VERSION} ${QT_REQUIRED_VERSION} REQUIRED COMPONENTS Gui)
if (QT_MAJOR_VERSION STREQUAL "6")
find_package(Qt6Core5Compat)
endif()
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS Archive)
find_package(SharedMimeInfo 1.3 REQUIRED)
......
......@@ -41,10 +41,6 @@ target_link_libraries(KPimPkPass
KF5::Archive
)
if (TARGET Qt6::Core5Compat)
target_link_libraries(KPimPkPass PRIVATE Qt6::Core5Compat) # QTextCodec
endif()
if (COMPILE_WITH_UNITY_CMAKE_SUPPORT)
set_target_properties(KPimPkPass PROPERTIES UNITY_BUILD ON)
endif()
......
......@@ -22,7 +22,11 @@
#include <QJsonObject>
#include <QLocale>
#include <QRegularExpression>
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
#include <QTextCodec>
#else
#include <QStringDecoder>
#endif
#include <QUrl>
using namespace KPkPass;
......@@ -121,8 +125,13 @@ bool PassPrivate::parseMessages(const QString &lang)
if (rawData.at(0) == '"') {
catalog = QString::fromUtf8(rawData);
} else {
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
auto codec = QTextCodec::codecForName("UTF-16BE");
catalog = codec->toUnicode(rawData);
#else
auto codec = QStringDecoder(QStringDecoder::Utf16BE);
catalog = codec(rawData);
#endif
}
int idx = 0;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment