Commit c1f1dfa0 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Make compile against qt6 (not akonadi support for the moment)

parent 9829d9b8
Pipeline #122170 passed with stage
in 1 minute and 19 seconds
......@@ -50,14 +50,20 @@ find_package(KF5Wallet ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5I18n ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5KIO ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5Mime ${KMIME_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5Akonadi ${AKONADI_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5AkonadiMime ${AKONADIMIME_LIB_VERSION} CONFIG REQUIRED)
if (QT_MAJOR_VERSION STREQUAL "6")
find_package(KF5Akonadi ${AKONADI_LIB_VERSION} CONFIG)
find_package(KF5AkonadiMime ${AKONADIMIME_LIB_VERSION} CONFIG)
else()
find_package(KF5AkonadiMime ${AKONADIMIME_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5Akonadi ${AKONADI_LIB_VERSION} CONFIG REQUIRED)
endif()
find_package(KPimSMTP ${KSMTP_LIB_VERSION} CONFIG REQUIRED)
find_package(KPimGAPI ${KGAPI_LIB_VERSION} CONFIG REQUIRED)
#it will replace kwallet support
find_package(Qt5Keychain CONFIG)
set_package_properties(Qt5Keychain PROPERTIES
find_package(Qt${QT_MAJOR_VERSION}Keychain CONFIG)
set_package_properties(Qt${QT_MAJOR_VERSION}Keychain PROPERTIES
DESCRIPTION "Provides support for secure credentials storage"
URL "https://github.com/frankosterfeld/qtkeychain"
TYPE REQUIRED)
......@@ -66,7 +72,7 @@ add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x050f02)
add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x055A00)
if(BUILD_TESTING)
find_package(Qt5Test CONFIG REQUIRED)
find_package(Qt${QT_MAJOR_VERSION}Test CONFIG REQUIRED)
add_definitions(-DBUILD_TESTING)
endif(BUILD_TESTING)
......
add_subdirectory(kmailtransport)
add_subdirectory(kmailtransportakonadi)
if (TARGET KF5::AkonadiCore)
add_subdirectory(kmailtransportakonadi)
endif()
add_subdirectory(kcm)
......@@ -8,5 +8,5 @@ target_link_libraries(kcm_mailtransport
)
install(TARGETS kcm_mailtransport DESTINATION ${KDE_INSTALL_PLUGINDIR})
install(FILES kcm_mailtransport.desktop DESTINATION ${KDE_INSTALL_KSERVICES5DIR})
install(FILES kcm_mailtransport.desktop DESTINATION ${KDE_INSTALL_KSERVICESDIR})
......@@ -84,9 +84,15 @@ target_link_libraries(KF5MailTransport
KF5::ConfigWidgets
Qt${QT_MAJOR_VERSION}::DBus
Qt${QT_MAJOR_VERSION}::Network
qt5keychain
)
if (QT_MAJOR_VERSION STREQUAL "6")
target_link_libraries(KF5MailTransport PRIVATE qt6keychain)
else()
target_link_libraries(KF5MailTransport PRIVATE qt5keychain)
endif()
set_target_properties(KF5MailTransport PROPERTIES
VERSION ${MAILTRANSPORT_VERSION}
SOVERSION ${MAILTRANSPORT_SOVERSION}
......
......@@ -353,9 +353,17 @@ bool ServerTestPrivate::handleNntpConversation(MailTransport::Socket *socket, in
if (line.compare(QLatin1String("STARTTLS"), Qt::CaseInsensitive) == 0) {
*shouldStartTLS = true;
} else if (line.startsWith(QLatin1String("AUTHINFO "), Qt::CaseInsensitive)) {
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
const QVector<QStringRef> authinfos = line.split(QLatin1Char(' '), Qt::SkipEmptyParts);
#else
const QVector<QStringView> authinfos = QStringView(line).split(QLatin1Char(' '), Qt::SkipEmptyParts);
#endif
const QString s(QStringLiteral("USER"));
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
const QStringRef ref(&s);
#else
const QStringView ref(s);
#endif
if (authinfos.contains(ref)) {
authenticationResults[type].append(Transport::EnumAuthenticationType::CLEAR); // XXX
}
......
......@@ -16,7 +16,11 @@
#include <KMessageBox>
#include <KStringHandler>
#include <KWallet>
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
#include <qt5keychain/keychain.h>
#else
#include <qt6keychain/keychain.h>
#endif
using namespace QKeychain;
using namespace MailTransport;
using namespace KWallet;
......
......@@ -31,11 +31,14 @@
#include <KEMailSettings>
#include <KLocalizedString>
#include <KMessageBox>
#include <kcoreaddons_version.h>
#if KCOREADDONS_VERSION < QT_VERSION_CHECK(6, 0, 0)
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
#include <Kdelibs4ConfigMigrator>
#endif
#include <qt5keychain/keychain.h>
#else
#include <qt6keychain/keychain.h>
#endif
using namespace QKeychain;
#include <KWallet>
......@@ -112,7 +115,7 @@ TransportManager::TransportManager()
: QObject()
, d(new TransportManagerPrivate(this))
{
#if KCOREADDONS_VERSION < QT_VERSION_CHECK(6, 0, 0)
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
Kdelibs4ConfigMigrator migrate(QStringLiteral("transportmanager"));
migrate.setConfigFiles(QStringList() << QStringLiteral("mailtransports"));
migrate.migrate();
......
Supports Markdown
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