Commit fa7da5a6 authored by Ömer Fadıl Usta's avatar Ömer Fadıl Usta 😊 Committed by Volker Krause

Fixes Windows Build by striping Libkleo for non Unix builds

Unfortunately we dont have libkleo on windows systems so we need to strip down
kleo related parts for windows builds.
parent e44362f7
Pipeline #34794 passed with stage
in 20 minutes and 59 seconds
......@@ -52,7 +52,10 @@ find_package(KF5Contacts ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5Mime ${KMIMELIB_VERSION} CONFIG REQUIRED)
find_package(KF5Akonadi ${AKONADI_VERSION} CONFIG REQUIRED)
find_package(KF5Libkleo ${LIBKLEO_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5Libkleo ${LIBKLEO_LIB_VERSION} CONFIG)
if (NOT WIN32)
set_package_properties(KF5Libkleo PROPERTIES TYPE REQUIRED)
endif()
find_package(KF5GrantleeTheme ${GRANTLEETHEME_LIB_VERSION} CONFIG REQUIRED)
find_package(Grantlee5 ${GRANTLEE_LIB_VERSION} CONFIG REQUIRED)
......
......@@ -39,6 +39,9 @@ set(akonadicontact_actions_SRCS
actions/qekigadialer.cpp
)
if (TARGET KF5::Libkleo)
set(HAVE_KLEO TRUE)
endif()
configure_file(config-akonadi-contact.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-akonadi-contact.h)
configure_file( actions/contactactionssettings.kcfg.cmake ${CMAKE_CURRENT_BINARY_DIR}/contactactionssettings.kcfg @ONLY)
......@@ -157,9 +160,14 @@ target_link_libraries(KF5AkonadiContact
KF5::ContactEditor
KF5::Prison
Grantlee5::Templates
KF5::Libkleo
)
if(TARGET KF5::Libkleo)
target_link_libraries(KF5AkonadiContact
PRIVATE
KF5::Libkleo
)
endif()
set_target_properties(KF5AkonadiContact PROPERTIES
VERSION ${AKONADICONTACT_VERSION_STRING}
......
#define AKONADI_CONTACT_LIB "${KDE_INSTALL_FULL_LIBDIR}"
#cmakedefine HAVE_KLEO
......@@ -4,10 +4,11 @@
SPDX-License-Identifier: GPL-2.0-or-later
*/
#include "config-akonadi-contact.h"
#include "contactgrantleewrapper.h"
#ifdef HAVE_KLEO
#include <Libkleo/Enum>
#endif
#include <KLocalizedString>
#include <QBuffer>
......@@ -77,12 +78,20 @@ int ContactGrantleeWrapper::age() const
QString ContactGrantleeWrapper::cryptoPreference() const
{
#ifdef HAVE_KLEO
return Kleo::encryptionPreferenceToLabel(Kleo::stringToEncryptionPreference(custom(QStringLiteral("KADDRESSBOOK"), QStringLiteral("CRYPTOENCRYPTPREF"))));
#else
return custom(QStringLiteral("KADDRESSBOOK"), QStringLiteral("CRYPTOENCRYPTPREF"));
#endif
}
QString ContactGrantleeWrapper::signaturePreference() const
{
#ifdef HAVE_KLEO
return Kleo::signingPreferenceToLabel(Kleo::stringToSigningPreference(custom(QStringLiteral("KADDRESSBOOK"), QStringLiteral("CRYPTOSIGNPREF"))));
#else
custom(QStringLiteral("KADDRESSBOOK"), QStringLiteral("CRYPTOSIGNPREF"));
#endif
}
static QString imgToDataUrl(const QImage &image)
......
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