[pim/eventviews] src/agenda: Use KCalendarCore::MimeData for DnD operations

Volker Krause <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit fa6cb6010e548a3be842198f7b9c06e717ce501b by Volker Krause.
Committed on 25/07/2026 at 05:42.
Pushed by vkrause into branch 'master'.

Use KCalendarCore::MimeData for DnD operations

M  +7    -0    src/agenda/agenda.cpp
M  +9    -1    src/agenda/agendaitem.cpp

https://invent.kde.org/pim/eventviews/-/commit/fa6cb6010e548a3be842198f7b9c06e717ce501b

diff --git a/src/agenda/agenda.cpp b/src/agenda/agenda.cpp
index 314be046..4980e39a 100644
--- a/src/agenda/agenda.cpp
+++ b/src/agenda/agenda.cpp
@@ -19,6 +19,9 @@
 #include <CalendarSupport/Utils>
 
 #include <KCalendarCore/Incidence>
+#if KCALENDARCORE_VERSION >= QT_VERSION_CHECK(6, 29, 0)
+#include <KCalendarCore/MimeData>
+#endif
 
 #include <KCalUtils/RecurrenceActions>
 
@@ -557,7 +560,11 @@ bool Agenda::eventFilter_drag(QObject *obj, QDropEvent *de)
         }
 
         const QList<QUrl> incidenceUrls = CalendarSupport::incidenceItemUrls(md);
+#if KCALENDARCORE_VERSION < QT_VERSION_CHECK(6, 29, 0)
         const KCalendarCore::Incidence::List incidences = CalendarSupport::incidences(md);
+#else
+        const KCalendarCore::Incidence::List incidences = KCalendarCore::MimeData::decodeIncidences(md);
+#endif
 
         Q_ASSERT(!incidenceUrls.isEmpty() || !incidences.isEmpty());
 
diff --git a/src/agenda/agendaitem.cpp b/src/agenda/agendaitem.cpp
index 2cc3cd0e..6ffe2de9 100644
--- a/src/agenda/agendaitem.cpp
+++ b/src/agenda/agendaitem.cpp
@@ -18,9 +18,13 @@
 
 #include <KContacts/VCardDrag>
 
-#include <KCalUtils/ICalDrag>
 #include <KCalUtils/IncidenceFormatter>
+#if KCALENDARCORE_VERSION < QT_VERSION_CHECK(6, 29, 0)
+#include <KCalUtils/ICalDrag>
 #include <KCalUtils/VCalDrag>
+#else
+#include <KCalendarCore/MimeData>
+#endif
 
 #include <KEmailAddress>
 
@@ -605,7 +609,11 @@ void AgendaItem::expandRight(int dx)
 void AgendaItem::dragEnterEvent(QDragEnterEvent *e)
 {
     const QMimeData *md = e->mimeData();
+#if KCALENDARCORE_VERSION < QT_VERSION_CHECK(6, 29, 0)
     if (KCalUtils::ICalDrag::canDecode(md) || KCalUtils::VCalDrag::canDecode(md)) {
+#else
+    if (KCalendarCore::MimeData::canDecode(md)) {
+#endif
         // TODO: Allow dragging events/todos onto other events to create a relation
         e->ignore();
         return;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.