Commit c5ba92f1 authored by Claudio Cambra's avatar Claudio Cambra
Browse files

Remove Kleo dependency

Akonadi-contacts currently depends on Libkleo for two properties in ContactGrantleeWrapper, `signaturePreference` and `cryptoPreference`. However, these are not used in any Akonadi-enabled applications and the only reference I could find to either of them was in a README file for KAddressBook here: https://invent.kde.org/pim/kaddressbook/-/blob/master/src/printing/grantlee/README.themes#L104

This MR therefore drops these preferences, allowing for the removal of the Libkleo dependency entirely
parent a867645b
Pipeline #123567 passed with stage
in 1 minute and 55 seconds
......@@ -10,6 +10,5 @@ Dependencies:
'frameworks/kcmutils': '@latest'
'pim/akonadi' : '@same'
'pim/kmime' : '@same'
'pim/libkleo' : '@same'
'pim/grantleetheme' : '@same'
'third-party/grantlee' : '@stable'
......@@ -39,7 +39,6 @@ add_feature_info(QCH ${BUILD_QCH} "API documentation in QCH format (for e.g. Qt
set(AKONADI_CONTACTS_VERSION ${PIM_VERSION})
set(KMIMELIB_VERSION "5.19.40")
set(AKONADI_VERSION "5.19.40")
set(LIBKLEO_LIB_VERSION "5.19.40")
set(GRANTLEETHEME_LIB_VERSION "5.19.40")
set(GRANTLEE_LIB_VERSION "5.2")
......@@ -62,11 +61,6 @@ 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)
if (NOT WIN32)
set_package_properties(KF5Libkleo PROPERTIES TYPE REQUIRED)
endif()
find_package(KF5GrantleeTheme ${GRANTLEETHEME_LIB_VERSION} CONFIG REQUIRED)
......
......@@ -56,9 +56,6 @@ target_sources(KF5AkonadiContact PRIVATE
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)
......@@ -239,13 +236,6 @@ if(TARGET KF5::I18nLocaleData)
target_link_libraries(KF5AkonadiContact PRIVATE KF5::I18nLocaleData)
endif()
if(TARGET KF5::Libkleo)
target_link_libraries(KF5AkonadiContact
PRIVATE
KF5::Libkleo
)
endif()
set_target_properties(KF5AkonadiContact PROPERTIES
VERSION ${AKONADICONTACT_VERSION}
SOVERSION ${AKONADICONTACT_SOVERSION}
......
#define AKONADI_CONTACT_LIB "${KDE_INSTALL_FULL_LIBDIR}"
#cmakedefine HAVE_KLEO
......@@ -6,9 +6,6 @@
#include "contactgrantleewrapper.h"
#include "config-akonadi-contact.h"
#ifdef HAVE_KLEO
#include <Libkleo/Enum>
#endif
#include <KLocalizedString>
#include <QBuffer>
......@@ -77,24 +74,6 @@ int ContactGrantleeWrapper::age() const
return age;
}
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
return custom(QStringLiteral("KADDRESSBOOK"), QStringLiteral("CRYPTOSIGNPREF"));
#endif
}
static QString imgToDataUrl(const QImage &image)
{
QByteArray ba;
......
......@@ -30,8 +30,6 @@ class ContactGrantleeWrapper : public KContacts::Addressee
Q_PROPERTY(QString addressBookName READ addressBookName)
Q_PROPERTY(int age READ age)
Q_PROPERTY(QString cryptoPreference READ cryptoPreference)
Q_PROPERTY(QString signaturePreference READ signaturePreference)
// ### this shouldn't be returning assembled HTML, that's a job for Grantlee
Q_PROPERTY(QString photo READ photoImgElement)
......@@ -56,8 +54,6 @@ private:
Q_REQUIRED_RESULT QString addressBookName() const;
Q_REQUIRED_RESULT int age() const;
Q_REQUIRED_RESULT QString cryptoPreference() const;
Q_REQUIRED_RESULT QString signaturePreference() const;
Q_REQUIRED_RESULT QString photoImgElement() const;
Q_REQUIRED_RESULT QString logoImgElement() const;
......
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