[pim/ktnef] /: Remove now unused Formatter methods

Volker Krause <[email protected]> Tue, 4 Aug 2026 16:54:47 +0000 (UTC)
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit c04f54369d50746901688ab8f3d6efee9ea255c2 by Volker Krause.
Committed on 04/08/2026 at 16:48.
Pushed by vkrause into branch 'master'.

Remove now unused Formatter methods

This also removes KCalUtils as a dependency entirely, and moves
KCalendarCore from a public to a private link dependency.

M  +0    -1    .kde-ci.yml
M  +0    -2    CMakeLists.txt
M  +1    -1    KPimTnefConfig.cmake.in
M  +2    -2    src/CMakeLists.txt
M  +1    -29   src/formatter.cpp
M  +0    -26   src/formatter.h

https://invent.kde.org/pim/ktnef/-/commit/c04f54369d50746901688ab8f3d6efee9ea255c2

diff --git a/.kde-ci.yml b/.kde-ci.yml
index 820d2a5..b01555d 100644
--- a/.kde-ci.yml
+++ b/.kde-ci.yml
@@ -7,7 +7,6 @@ Dependencies:
     'frameworks/extra-cmake-modules': '@latest-kf6'
     'frameworks/kcontacts': '@latest-kf6'
     'frameworks/kcalendarcore': '@latest-kf6'
-    'pim/kcalutils': '@same'
 
 Options:
  require-passing-tests-on: ['@all']
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d1081c4..18863ed 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -97,7 +97,6 @@ ecm_check_outbound_license(LICENSES GPL-2.0-only  FILES ${ALL_SOURCE_FILES})
 
 include(ECMGenerateQDoc)
 
-set(CALENDARUTILS_LIB_VERSION "6.7.40")
 ecm_setup_version(PROJECT VARIABLE_PREFIX KTNEF
                         VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/ktnef_version.h"
                         PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KPim6TnefConfigVersion.cmake"
@@ -108,7 +107,6 @@ ecm_setup_version(PROJECT VARIABLE_PREFIX KTNEF
 set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KPim6Tnef")
 find_package(Qt6 ${QT_REQUIRED_VERSION} CONFIG REQUIRED Widgets)
 find_package(KF6CalendarCore ${KF_MIN_VERSION} CONFIG REQUIRED)
-find_package(KPim6CalendarUtils ${CALENDARUTILS_LIB_VERSION} CONFIG REQUIRED)
 find_package(KF6Contacts ${KF_MIN_VERSION} CONFIG REQUIRED)
 find_package(KF6I18n ${KF_MIN_VERSION} CONFIG REQUIRED)
 
diff --git a/KPimTnefConfig.cmake.in b/KPimTnefConfig.cmake.in
index b466466..ab0d750 100644
--- a/KPimTnefConfig.cmake.in
+++ b/KPimTnefConfig.cmake.in
@@ -1,5 +1,5 @@
 @PACKAGE_INIT@
 include(CMakeFindDependencyMacro)
-find_dependency(KF6CalendarCore "@KF_MIN_VERSION@")
+find_dependency(Qt6Core "@QT_REQUIRED_VERSION@")
 
 include("${CMAKE_CURRENT_LIST_DIR}/KPim6TnefTargets.cmake")
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 44a1433..5a9117e 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -44,9 +44,9 @@ target_include_directories(KPim6Tnef PUBLIC "$<BUILD_INTERFACE:${KTnef_SOURCE_DI
 target_link_libraries(
     KPim6Tnef
     PUBLIC
-        KF6::CalendarCore
+        Qt6::Core
     PRIVATE
-        KPim6::CalendarUtils
+        KF6::CalendarCore
         KF6::Contacts
         KF6::I18n
 )
diff --git a/src/formatter.cpp b/src/formatter.cpp
index df957b7..66376fb 100644
--- a/src/formatter.cpp
+++ b/src/formatter.cpp
@@ -29,9 +29,9 @@ using namespace Qt::Literals::StringLiterals;
 #include <KContacts/PhoneNumber>
 #include <KContacts/VCardConverter>
 
-#include <KCalUtils/IncidenceFormatter>
 #include <KCalendarCore/Calendar>
 #include <KCalendarCore/ICalFormat>
+#include <KCalendarCore/MemoryCalendar>
 
 #include <KLocalizedString>
 
@@ -420,31 +420,3 @@ QByteArray KTnef::messageToVcard(const KTNEFMessage *tnefMsg)
 
     return {};
 }
-
-QString KTnef::msTNEFToVPart(const QByteArray &tnef)
-{
-    KTNEFParser parser;
-    QByteArray b(tnef);
-    QBuffer buf(&b);
-
-    if (parser.openDevice(&buf)) {
-        KTNEFMessage *tnefMsg = parser.message();
-        if (const auto ical = messageToIcal(tnefMsg); !ical.isEmpty()) {
-            return ical;
-        }
-        return QString::fromUtf8(messageToVcard(tnefMsg));
-    }
-
-    return {};
-}
-
-QString KTnef::formatTNEFInvitation(const QByteArray &tnef, const MemoryCalendar::Ptr &cal, KCalUtils::InvitationFormatterHelper *h)
-{
-    const QString vPart = msTNEFToVPart(tnef);
-    QString iCal = KCalUtils::IncidenceFormatter::formatICalInvitation(vPart, cal, h);
-    if (!iCal.isEmpty()) {
-        return iCal;
-    } else {
-        return vPart;
-    }
-}
diff --git a/src/formatter.h b/src/formatter.h
index 3b4cac7..82e4afc 100644
--- a/src/formatter.h
+++ b/src/formatter.h
@@ -19,16 +19,10 @@
 
 #pragma once
 
-#include <KCalendarCore/MemoryCalendar>
 #include <QString>
 
 #include "ktnef_export.h"
 
-namespace KCalUtils
-{
-class InvitationFormatterHelper;
-}
-
 namespace KTnef
 {
 
@@ -53,24 +47,4 @@ class KTNEFMessage;
     \since 26.12
 */
 [[nodiscard]] KTNEF_EXPORT QByteArray messageToVcard(const KTnef::KTNEFMessage *tnefMsg);
-
-/*!
-    Formats a @acronym TNEF attachment to an HTML mail.
-
-    \a tnef is the QByteArray contain the @acronym TNEF data.
-    \a cal is a pointer to a Calendar object.
-    \a h is a pointer to a InvitationFormatterHelp object.
-  */
-[[nodiscard]] KTNEF_EXPORT QString formatTNEFInvitation(const QByteArray &tnef,
-                                                        const KCalendarCore::MemoryCalendar::Ptr &cal,
-                                                        KCalUtils::InvitationFormatterHelper *h);
-
-/*!
-    Transforms a @acronym TNEF attachment to an iCal or vCard.
-
-    \a tnef is the QByteArray containing the @acronym TNEF data.
-
-    Returns a string containing the transformed attachment.
-  */
-[[nodiscard]] KTNEF_EXPORT QString msTNEFToVPart(const QByteArray &tnef);
 }