summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Vrátil <dvratil@kde.org>2016-09-16 09:58:48 (GMT)
committerDaniel Vrátil <dvratil@kde.org>2016-09-16 09:58:48 (GMT)
commit920531e6ddae836e3d1f83aefcd4c03f3dbff2c1 (patch)
tree55f1074a5af46d61e25198737a40967da77cfbf6
parent9aeade1fb60f7010d39b23349df374bc41947537 (diff)
Re-enable etm_usage, port from CR to Monitor
Strictly speaking this change is not even necessary, the build could've been easilly fixed simply by forward-declaring or including CR header in our headers (and not relaying on ETM header to do it). But since all client apps should only use Monitors and not CRs, let's port the examples, so they are closer to what we want.
-rw-r--r--CMakeLists.txt2
-rw-r--r--examples/apps/CMakeLists.txt2
-rw-r--r--examples/apps/coisceim/createtripwidget.cpp4
-rw-r--r--examples/apps/coisceim/createtripwidget.h6
-rw-r--r--examples/apps/coisceim/mixedtreemodel.h2
-rw-r--r--examples/apps/coisceim/trip.cpp52
-rw-r--r--examples/apps/coisceim/trip.h12
-rw-r--r--examples/apps/coisceim/tripcomponentfactory.cpp46
-rw-r--r--examples/apps/coisceim/tripcomponentfactory.h14
-rw-r--r--examples/apps/coisceim/tripmodel.cpp4
-rw-r--r--examples/apps/coisceim/tripmodel.h4
-rw-r--r--examples/apps/etm_usage/entitytreemodelfactory.h2
12 files changed, 75 insertions, 75 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0dbdeea..5ffd095 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -65,7 +65,7 @@ set(EVENTVIEW_LIB_VERSION "5.3.40")
set(LIBKDEPIM_LIB_VERSION "5.3.40")
set(KDEPIM_APPS_LIB_VERSION "5.3.40")
set(LIBKLEO_LIB_VERSION "5.3.40")
-set(AKONADI_LIB_VERSION "5.3.40")
+set(AKONADI_LIB_VERSION "5.3.45")
set(INCIDENCEEDITOR_LIB_VERSION "5.3.40")
set(KTNEF_LIB_VERSION "5.3.40")
set(MESSAGELIB_LIB_VERSION "5.3.52")
diff --git a/examples/apps/CMakeLists.txt b/examples/apps/CMakeLists.txt
index 8b79e39..ceae617 100644
--- a/examples/apps/CMakeLists.txt
+++ b/examples/apps/CMakeLists.txt
@@ -1,6 +1,6 @@
-# add_subdirectory(etm_usage)
+add_subdirectory(etm_usage)
add_subdirectory(kabc)
add_subdirectory(mailreader)
add_subdirectory(coisceim)
diff --git a/examples/apps/coisceim/createtripwidget.cpp b/examples/apps/coisceim/createtripwidget.cpp
index 62363ab..a0928a4 100644
--- a/examples/apps/coisceim/createtripwidget.cpp
+++ b/examples/apps/coisceim/createtripwidget.cpp
@@ -31,7 +31,7 @@
#include <KConfig>
#include <KSharedConfigPtr>
-#include <AkonadiCore/ChangeRecorder>
+#include <AkonadiCore/Monitor>
#include <KSharedConfig>
#include "createfoldercontentswidget.h"
@@ -40,7 +40,7 @@
using namespace Akonadi;
-CreateTripWidget::CreateTripWidget(Trip *trip, Akonadi::ChangeRecorder *monitor, QWidget *parent, Qt::WindowFlags f)
+CreateTripWidget::CreateTripWidget(Trip *trip, Akonadi::Monitor *monitor, QWidget *parent, Qt::WindowFlags f)
: QWidget(parent, f), m_trip(trip), m_monitor(monitor)
{
QVBoxLayout *layout = new QVBoxLayout(this);
diff --git a/examples/apps/coisceim/createtripwidget.h b/examples/apps/coisceim/createtripwidget.h
index 6a06293..17547f5 100644
--- a/examples/apps/coisceim/createtripwidget.h
+++ b/examples/apps/coisceim/createtripwidget.h
@@ -28,7 +28,7 @@
namespace Akonadi
{
-class ChangeRecorder;
+class Monitor;
}
class CreateFolderContentsWidget;
@@ -39,7 +39,7 @@ class CreateTripWidget : public QWidget
{
Q_OBJECT
public:
- explicit CreateTripWidget(Trip *trip, Akonadi::ChangeRecorder *monitor, QWidget *parent = Q_NULLPTR, Qt::WindowFlags f = 0);
+ explicit CreateTripWidget(Trip *trip, Akonadi::Monitor *monitor, QWidget *parent = Q_NULLPTR, Qt::WindowFlags f = 0);
private Q_SLOTS:
void tripSelected(const Akonadi::Item &item);
@@ -49,7 +49,7 @@ private:
CreateFolderContentsWidget *createView(const QString &type, int role);
Trip *m_trip;
- Akonadi::ChangeRecorder *m_monitor;
+ Akonadi::Monitor *m_monitor;
Akonadi::Item m_tripItem;
CreateFolderContentsWidget *m_mailWidget;
CreateFolderContentsWidget *m_todoWidget;
diff --git a/examples/apps/coisceim/mixedtreemodel.h b/examples/apps/coisceim/mixedtreemodel.h
index 063aea2..a14cecc 100644
--- a/examples/apps/coisceim/mixedtreemodel.h
+++ b/examples/apps/coisceim/mixedtreemodel.h
@@ -28,7 +28,7 @@
namespace Akonadi
{
-class ChangeRecorder;
+class Monitor;
}
class MixedTreeModel : public Akonadi::EntityTreeModel
diff --git a/examples/apps/coisceim/trip.cpp b/examples/apps/coisceim/trip.cpp
index bd0c1b1..5fa91a4 100644
--- a/examples/apps/coisceim/trip.cpp
+++ b/examples/apps/coisceim/trip.cpp
@@ -23,7 +23,7 @@
#include <QSortFilterProxyModel>
-#include <AkonadiCore/ChangeRecorder>
+#include <AkonadiCore/Monitor>
#include <KCalCore/Incidence>
@@ -36,8 +36,8 @@
using namespace Akonadi;
-Trip::Trip(const QPersistentModelIndex &index, Akonadi::ChangeRecorder *changeRecorder, TripComponentFactory *factory, QObject *parent)
- : QObject(parent), m_index(index), m_changeRecorder(changeRecorder)
+Trip::Trip(const QPersistentModelIndex &index, Akonadi::Monitor *monitor, TripComponentFactory *factory, QObject *parent)
+ : QObject(parent), m_index(index), m_monitor(monitor)
{
QAbstractItemModel *model = const_cast<QAbstractItemModel *>(m_index.model());
connect(model, SIGNAL(dataChanged(QModelIndex,QModelIndex)), SLOT(dataChanged(QModelIndex,QModelIndex)));
@@ -45,13 +45,13 @@ Trip::Trip(const QPersistentModelIndex &index, Akonadi::ChangeRecorder *changeRe
connect(model, &QAbstractItemModel::layoutChanged, this, &Trip::layoutChanged);
connect(model, &QAbstractItemModel::rowsRemoved, this, &Trip::rowsRemoved);
- m_mailChangeRecorder = factory->createMailChangeRecorder(this);
- m_todoChangeRecorder = factory->createTodoChangeRecorder(this);
- m_notesChangeRecorder = factory->createNotesChangeRecorder(this);
+ m_mailMonitor = factory->createMailMonitor(this);
+ m_todoMonitor = factory->createTodoMonitor(this);
+ m_notesMonitor = factory->createNotesMonitor(this);
- m_mailChangeRecorder->setSession(m_changeRecorder->session());
- m_todoChangeRecorder->setSession(m_changeRecorder->session());
- m_notesChangeRecorder->setSession(m_changeRecorder->session());
+ m_mailMonitor->setSession(m_monitor->session());
+ m_todoMonitor->setSession(m_monitor->session());
+ m_notesMonitor->setSession(m_monitor->session());
m_mailModel = new QSortFilterProxyModel(this);
m_mailModel->setFilterCaseSensitivity(Qt::CaseInsensitive);
@@ -60,9 +60,9 @@ Trip::Trip(const QPersistentModelIndex &index, Akonadi::ChangeRecorder *changeRe
m_notesModel = new QSortFilterProxyModel(this);
m_notesModel->setFilterCaseSensitivity(Qt::CaseInsensitive);
- m_mailModel->setSourceModel(factory->createMailModel(m_mailChangeRecorder));
- m_todoModel->setSourceModel(factory->createTodoModel(m_todoChangeRecorder));
- m_notesModel->setSourceModel(factory->createNotesModel(m_notesChangeRecorder));
+ m_mailModel->setSourceModel(factory->createMailModel(m_mailMonitor));
+ m_todoModel->setSourceModel(factory->createTodoModel(m_todoMonitor));
+ m_notesModel->setSourceModel(factory->createNotesModel(m_notesMonitor));
QItemSelectionModel *mailItemSelection = new QItemSelectionModel(m_mailModel, this);
QItemSelectionModel *todoItemSelection = new QItemSelectionModel(m_todoModel, this);
@@ -132,18 +132,18 @@ void Trip::updateEvent()
setEventName(incidence->summary());
}
-static void updateCollection(Akonadi::ChangeRecorder *cr, const Collection &collection)
+static void updateCollection(Akonadi::Monitor *mon, const Collection &collection)
{
- foreach (const Collection &existingCollection, cr->collectionsMonitored()) {
- cr->setCollectionMonitored(existingCollection, false);
+ foreach (const Collection &existingCollection, mon->collectionsMonitored()) {
+ mon->setCollectionMonitored(existingCollection, false);
}
- foreach (const QString &mimeType, cr->mimeTypesMonitored()) {
- cr->setMimeTypeMonitored(mimeType, false);
+ foreach (const QString &mimeType, mon->mimeTypesMonitored()) {
+ mon->setMimeTypeMonitored(mimeType, false);
}
if (collection.isValid()) {
- cr->setCollectionMonitored(collection, true);
+ mon->setCollectionMonitored(collection, true);
}
}
@@ -151,23 +151,23 @@ void Trip::setCollection(int role, const Akonadi::Collection &collection)
{
switch (role) {
case MailCollectionRole:
- updateCollection(m_mailChangeRecorder, collection);
+ updateCollection(m_mailMonitor, collection);
Q_EMIT monitoredCollectionsChanged();
return;
case TodoCollectionRole:
- updateCollection(m_todoChangeRecorder, collection);
+ updateCollection(m_todoMonitor, collection);
Q_EMIT monitoredCollectionsChanged();
return;
case NotesCollectionRole:
- updateCollection(m_notesChangeRecorder, collection);
+ updateCollection(m_notesMonitor, collection);
Q_EMIT monitoredCollectionsChanged();
return;
}
}
-static Akonadi::Collection monitoredCollection(Akonadi::ChangeRecorder *cr)
+static Akonadi::Collection monitoredCollection(Akonadi::Monitor *monitor)
{
- Akonadi::Collection::List list = cr->collectionsMonitored();
+ Akonadi::Collection::List list = monitor->collectionsMonitored();
if (list.isEmpty()) {
return Akonadi::Collection(-1);
}
@@ -178,11 +178,11 @@ Akonadi::Collection Trip::collection(int role)
{
switch (role) {
case MailCollectionRole:
- return monitoredCollection(m_mailChangeRecorder);
+ return monitoredCollection(m_mailMonitor);
case TodoCollectionRole:
- return monitoredCollection(m_todoChangeRecorder);
+ return monitoredCollection(m_todoMonitor);
case NotesCollectionRole:
- return monitoredCollection(m_notesChangeRecorder);
+ return monitoredCollection(m_notesMonitor);
}
return Akonadi::Collection();
}
diff --git a/examples/apps/coisceim/trip.h b/examples/apps/coisceim/trip.h
index 9d087f9..60a323f 100644
--- a/examples/apps/coisceim/trip.h
+++ b/examples/apps/coisceim/trip.h
@@ -33,7 +33,7 @@ class TripComponentFactory;
namespace Akonadi
{
-class ChangeRecorder;
+class Monitor;
}
class Trip : public QObject
@@ -56,7 +56,7 @@ public:
TodoCollectionRole,
NotesCollectionRole
};
- Trip(const QPersistentModelIndex &index, Akonadi::ChangeRecorder *changeRecorder, TripComponentFactory *factory, QObject *parent = Q_NULLPTR);
+ Trip(const QPersistentModelIndex &index, Akonadi::Monitor *monitor, TripComponentFactory *factory, QObject *parent = Q_NULLPTR);
QString eventName() const;
QString eventDescription() const;
@@ -100,11 +100,11 @@ private:
private:
const QPersistentModelIndex m_index;
- Akonadi::ChangeRecorder *m_changeRecorder;
+ Akonadi::Monitor *m_monitor;
- Akonadi::ChangeRecorder *m_mailChangeRecorder;
- Akonadi::ChangeRecorder *m_todoChangeRecorder;
- Akonadi::ChangeRecorder *m_notesChangeRecorder;
+ Akonadi::Monitor *m_mailMonitor;
+ Akonadi::Monitor *m_todoMonitor;
+ Akonadi::Monitor *m_notesMonitor;
QSortFilterProxyModel *m_mailModel;
QSortFilterProxyModel *m_todoModel;
QSortFilterProxyModel *m_notesModel;
diff --git a/examples/apps/coisceim/tripcomponentfactory.cpp b/examples/apps/coisceim/tripcomponentfactory.cpp
index c9637a7..b8b7a03 100644
--- a/examples/apps/coisceim/tripcomponentfactory.cpp
+++ b/examples/apps/coisceim/tripcomponentfactory.cpp
@@ -22,7 +22,7 @@
#include "tripcomponentfactory.h"
#include <AkonadiCore/EntityTreeModel>
-#include <AkonadiCore/ChangeRecorder>
+#include <AkonadiCore/Monitor>
#include <AkonadiCore/ItemFetchScope>
#include <AkonadiCore/EntityMimeTypeFilterModel>
@@ -34,50 +34,50 @@
#include "todocheckableproxymodel.h"
#include "mixedtreemodel.h"
-Akonadi::ChangeRecorder *TripComponentFactory::createMailChangeRecorder(QObject *parent)
+Akonadi::Monitor *TripComponentFactory::createMailMonitor(QObject *parent)
{
- Akonadi::ChangeRecorder *chRec = new Akonadi::ChangeRecorder(parent);
- chRec->setMimeTypeMonitored(KMime::Message::mimeType());
- chRec->itemFetchScope().fetchFullPayload(true);
- return chRec;
+ Akonadi::Monitor *chMon = new Akonadi::Monitor(parent);
+ chMon->setMimeTypeMonitored(KMime::Message::mimeType());
+ chMon->itemFetchScope().fetchFullPayload(true);
+ return chMon;
}
-Akonadi::ChangeRecorder *TripComponentFactory::createNotesChangeRecorder(QObject *parent)
+Akonadi::Monitor *TripComponentFactory::createNotesMonitor(QObject *parent)
{
- Akonadi::ChangeRecorder *chRec = new Akonadi::ChangeRecorder(parent);
- chRec->setMimeTypeMonitored(Akonotes::Note::mimeType());
- chRec->itemFetchScope().fetchFullPayload(true);
- return chRec;
+ Akonadi::Monitor *chMon = new Akonadi::Monitor(parent);
+ chMon->setMimeTypeMonitored(Akonotes::Note::mimeType());
+ chMon->itemFetchScope().fetchFullPayload(true);
+ return chMon;
}
-Akonadi::ChangeRecorder *TripComponentFactory::createTodoChangeRecorder(QObject *parent)
+Akonadi::Monitor *TripComponentFactory::createTodoMonitor(QObject *parent)
{
- Akonadi::ChangeRecorder *chRec = new Akonadi::ChangeRecorder(parent);
- chRec->setMimeTypeMonitored(KCalCore::Todo::todoMimeType());
- chRec->itemFetchScope().fetchFullPayload(true);
- return chRec;
+ Akonadi::Monitor *chMon = new Akonadi::Monitor(parent);
+ chMon->setMimeTypeMonitored(KCalCore::Todo::todoMimeType());
+ chMon->itemFetchScope().fetchFullPayload(true);
+ return chMon;
}
-QAbstractItemModel *TripComponentFactory::createMailModel(Akonadi::ChangeRecorder *changeRecorder)
+QAbstractItemModel *TripComponentFactory::createMailModel(Akonadi::Monitor *monitor)
{
- MixedTreeModel *model = new MixedTreeModel(changeRecorder);
+ MixedTreeModel *model = new MixedTreeModel(monitor);
model->setCollectionFetchStrategy(MixedTreeModel::FetchNoCollections);
return model;
}
-QAbstractItemModel *TripComponentFactory::createNotesModel(Akonadi::ChangeRecorder *changeRecorder)
+QAbstractItemModel *TripComponentFactory::createNotesModel(Akonadi::Monitor *monitor)
{
- MixedTreeModel *model = new MixedTreeModel(changeRecorder);
+ MixedTreeModel *model = new MixedTreeModel(monitor);
model->setCollectionFetchStrategy(MixedTreeModel::FetchNoCollections);
return model;
}
-QAbstractItemModel *TripComponentFactory::createTodoModel(Akonadi::ChangeRecorder *changeRecorder)
+QAbstractItemModel *TripComponentFactory::createTodoModel(Akonadi::Monitor *monitor)
{
- MixedTreeModel *model = new MixedTreeModel(changeRecorder);
+ MixedTreeModel *model = new MixedTreeModel(monitor);
model->setCollectionFetchStrategy(MixedTreeModel::FetchNoCollections);
- Akonadi::EntityMimeTypeFilterModel *filterModel = new Akonadi::EntityMimeTypeFilterModel(changeRecorder);
+ Akonadi::EntityMimeTypeFilterModel *filterModel = new Akonadi::EntityMimeTypeFilterModel(monitor);
filterModel->addMimeTypeInclusionFilter(KCalCore::Todo::todoMimeType());
filterModel->setHeaderGroup(MixedTreeModel::ItemListHeaders);
filterModel->setSourceModel(model);
diff --git a/examples/apps/coisceim/tripcomponentfactory.h b/examples/apps/coisceim/tripcomponentfactory.h
index b023015..74d76aa 100644
--- a/examples/apps/coisceim/tripcomponentfactory.h
+++ b/examples/apps/coisceim/tripcomponentfactory.h
@@ -27,20 +27,20 @@ class QAbstractItemModel;
namespace Akonadi
{
-class ChangeRecorder;
+class Monitor;
}
class TripComponentFactory
{
public:
- Akonadi::ChangeRecorder *createMailChangeRecorder(QObject *parent);
- Akonadi::ChangeRecorder *createTodoChangeRecorder(QObject *parent);
- Akonadi::ChangeRecorder *createNotesChangeRecorder(QObject *parent);
+ Akonadi::Monitor *createMailMonitor(QObject *parent);
+ Akonadi::Monitor *createTodoMonitor(QObject *parent);
+ Akonadi::Monitor *createNotesMonitor(QObject *parent);
- QAbstractItemModel *createMailModel(Akonadi::ChangeRecorder *changeRecorder);
- QAbstractItemModel *createTodoModel(Akonadi::ChangeRecorder *changeRecorder);
- QAbstractItemModel *createNotesModel(Akonadi::ChangeRecorder *changeRecorder);
+ QAbstractItemModel *createMailModel(Akonadi::Monitor *monitor);
+ QAbstractItemModel *createTodoModel(Akonadi::Monitor *monitor);
+ QAbstractItemModel *createNotesModel(Akonadi::Monitor *monitor);
};
diff --git a/examples/apps/coisceim/tripmodel.cpp b/examples/apps/coisceim/tripmodel.cpp
index 1cb8f07..71e08ad 100644
--- a/examples/apps/coisceim/tripmodel.cpp
+++ b/examples/apps/coisceim/tripmodel.cpp
@@ -28,7 +28,7 @@
#include <KConfig>
#include <AkonadiCore/Item>
-#include <AkonadiCore/ChangeRecorder>
+#include <AkonadiCore/Monitor>
#include <KSharedConfig>
#include "trip.h"
@@ -38,7 +38,7 @@
using namespace Akonadi;
-TripModel::TripModel(Akonadi::ChangeRecorder *monitor, QObject *parent)
+TripModel::TripModel(Akonadi::Monitor *monitor, QObject *parent)
: MixedTreeModel(monitor, parent), m_monitor(monitor)
{
setCollectionFetchStrategy(MixedTreeModel::FetchNoCollections);
diff --git a/examples/apps/coisceim/tripmodel.h b/examples/apps/coisceim/tripmodel.h
index 049733b..a7a0119 100644
--- a/examples/apps/coisceim/tripmodel.h
+++ b/examples/apps/coisceim/tripmodel.h
@@ -38,7 +38,7 @@ public:
TripRole = MixedTreeModel::UserRole + 1,
WidgetRole
};
- explicit TripModel(Akonadi::ChangeRecorder *monitor, QObject *parent = Q_NULLPTR);
+ explicit TripModel(Akonadi::Monitor *monitor, QObject *parent = Q_NULLPTR);
bool removeRows(int, int, const QModelIndex & = QModelIndex()) Q_DECL_OVERRIDE;
int columnCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE;
@@ -63,7 +63,7 @@ private:
mutable QHash<Akonadi::Item::Id, Trip *> m_trips;
mutable QHash<Akonadi::Item::Id, TripWidget *> m_tripWidgets;
CreateTripWidget *m_createWidget;
- Akonadi::ChangeRecorder *m_monitor;
+ Akonadi::Monitor *m_monitor;
};
#endif
diff --git a/examples/apps/etm_usage/entitytreemodelfactory.h b/examples/apps/etm_usage/entitytreemodelfactory.h
index 731d592..970dd1d 100644
--- a/examples/apps/etm_usage/entitytreemodelfactory.h
+++ b/examples/apps/etm_usage/entitytreemodelfactory.h
@@ -38,7 +38,7 @@ Q_SIGNALS:
void modelCreated(Akonadi::EntityTreeModel *model);
protected:
- Akonadi::EntityTreeModel* getModel(Akonadi::Monitor* monitor, QObject* parent);
+ virtual Akonadi::EntityTreeModel* getModel(Akonadi::Monitor *monitor, QObject* parent);
private Q_SLOTS:
void collectionsFetched(const Akonadi::Collection::List &list);