Commit 60336bd7 authored by Volker Krause's avatar Volker Krause
Browse files

Use IncidenceTreeModel from akonadi-calendar

This is the first step in moving TodoModel from eventviews to akonadi-
calendar, which would remove the dependency on eventviews and calendar-
support here entirely.
parent 5a7baa90
Pipeline #160404 passed with stage
in 1 minute and 21 seconds
......@@ -8,7 +8,11 @@ TodoSortFilterProxyModel::TodoSortFilterProxyModel(QObject *parent)
: QSortFilterProxyModel(parent)
{
const QString todoMimeType = QStringLiteral("application/x-vnd.akonadi.calendar.todo");
#if AKONADICALENDAR_VERSION < QT_VERSION_CHECK(5, 20, 41)
m_todoTreeModel = new IncidenceTreeModel(QStringList() << todoMimeType, this);
#else
m_todoTreeModel = new Akonadi::IncidenceTreeModel(QStringList() << todoMimeType, this);
#endif
const auto pref = EventViews::PrefsPtr(new EventViews::Prefs);
m_baseTodoModel = new TodoModel(pref, this);
m_baseTodoModel->setSourceModel(m_todoTreeModel);
......
......@@ -11,7 +11,11 @@
#endif
#include <CalendarSupport/KCalPrefs>
#include <CalendarSupport/Utils>
#if AKONADICALENDAR_VERSION < QT_VERSION_CHECK(5, 20, 41)
#include <EventViews/IncidenceTreeModel>
#else
#include <Akonadi/IncidenceTreeModel>
#endif
#include <EventViews/TodoModel>
#include <KConfigWatcher>
#include <KSharedConfig>
......@@ -135,7 +139,11 @@ private:
int compareCompletion(const QModelIndex &left, const QModelIndex &right) const;
Akonadi::ETMCalendar::Ptr m_calendar;
#if AKONADICALENDAR_VERSION < QT_VERSION_CHECK(5, 20, 41)
IncidenceTreeModel *m_todoTreeModel = nullptr;
#else
Akonadi::IncidenceTreeModel *m_todoTreeModel = nullptr;
#endif
TodoModel *m_baseTodoModel = nullptr;
Akonadi::IncidenceChanger *m_lastSetChanger = nullptr;
QHash<QString, QColor> m_colors;
......
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