aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Vrátil <dvratil@kde.org>2016-09-15 12:24:24 (GMT)
committerDaniel Vrátil <dvratil@kde.org>2016-09-15 12:25:53 (GMT)
commit48f07eae8ca198dfc6991a16edd96f0001ca6d5f (patch)
treeb4f5598197fc8f233793ab51a82bca137e1314c2
parentdad52613f5aa8717ff92d076db452b9c3f9f5c20 (diff)
[BIC] Let ETM be constructed with Monitor instead of ChangeRecorder
There is zero reason to require ETM to be constructed with ChangeRecorder, when none of the recording features are actually used there. Instead let ETM be created with Monitor. Monitor is a baseclass of ChangeRecorder so no existing code needs to be changed, but it's a binary incompatible change, so everything linking Akonadi must be rebuilt.
-rw-r--r--CMakeLists.txt2
-rw-r--r--src/core/models/entitytreemodel.cpp6
-rw-r--r--src/core/models/entitytreemodel.h29
-rw-r--r--src/core/models/entitytreemodel_p.cpp6
-rw-r--r--src/core/models/entitytreemodel_p.h6
5 files changed, 23 insertions, 26 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4f34165..c931d8e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -22,7 +22,7 @@ include(CheckSymbolExists)
include(AkonadiMacros)
-set(PIM_VERSION "5.3.44")
+set(PIM_VERSION "5.3.45")
set(QT_REQUIRED_VERSION "5.5.0")
set(AKONADI_VERSION ${PIM_VERSION})
diff --git a/src/core/models/entitytreemodel.cpp b/src/core/models/entitytreemodel.cpp
index 13a8bb1..039aaff 100644
--- a/src/core/models/entitytreemodel.cpp
+++ b/src/core/models/entitytreemodel.cpp
@@ -33,7 +33,7 @@
#include <QUrlQuery>
#include "attributefactory.h"
-#include "changerecorder.h"
+#include "monitor.h"
#include "collectionmodifyjob.h"
#include "entitydisplayattribute.h"
#include "transactionsequence.h"
@@ -49,7 +49,7 @@ Q_DECLARE_METATYPE(QSet<QByteArray>)
using namespace Akonadi;
-EntityTreeModel::EntityTreeModel(ChangeRecorder *monitor, QObject *parent)
+EntityTreeModel::EntityTreeModel(Monitor *monitor, QObject *parent)
: QAbstractItemModel(parent)
, d_ptr(new EntityTreeModelPrivate(this))
{
@@ -57,7 +57,7 @@ EntityTreeModel::EntityTreeModel(ChangeRecorder *monitor, QObject *parent)
d->init(monitor);
}
-EntityTreeModel::EntityTreeModel(ChangeRecorder *monitor, EntityTreeModelPrivate *d, QObject *parent)
+EntityTreeModel::EntityTreeModel(Monitor *monitor, EntityTreeModelPrivate *d, QObject *parent)
: QAbstractItemModel(parent)
, d_ptr(d)
{
diff --git a/src/core/models/entitytreemodel.h b/src/core/models/entitytreemodel.h
index 1cd318c..1750545 100644
--- a/src/core/models/entitytreemodel.h
+++ b/src/core/models/entitytreemodel.h
@@ -31,7 +31,6 @@
namespace Akonadi
{
-class ChangeRecorder;
class CollectionStatistics;
class Item;
class ItemFetchScope;
@@ -71,14 +70,14 @@ class EntityTreeModelPrivate;
* <h3>Using EntityTreeModel in your application</h3>
*
* The responsibilities which fall to the application developer are
- * - Configuring the ChangeRecorder and EntityTreeModel
+ * - Configuring the Monitor and EntityTreeModel
* - Making use of this class via proxy models
* - Subclassing for type specific display information
*
* <h3>Creating and configuring the EntityTreeModel</h3>
*
- * This class is a wrapper around a Akonadi::ChangeRecorder object. The model represents a
- * part of the collection and item tree configured in the ChangeRecorder. The structure of the
+ * This class is a wrapper around a Akonadi::Monitor object. The model represents a
+ * part of the collection and item tree configured in the Monitor. The structure of the
* model mirrors the structure of Collections and Items on the %Akonadi server.
*
* The following code creates a model which fetches items and collections relevant to
@@ -86,12 +85,12 @@ class EntityTreeModelPrivate;
*
* @code
*
- * ChangeRecorder *changeRecorder = new ChangeRecorder( this );
- * changeRecorder->setCollectionMonitored( Collection::root() );
- * changeRecorder->setMimeTypeMonitored( KContacts::addresseeMimeType() );
- * changeRecorder->setSession( session );
+ * Monitor *monitor = new Monitor( this );
+ * monitor->setCollectionMonitored( Collection::root() );
+ * monitor->setMimeTypeMonitored( KContacts::addresseeMimeType() );
+ * monitor->setSession( session );
*
- * EntityTreeModel *model = new EntityTreeModel( changeRecorder, this );
+ * EntityTreeModel *model = new EntityTreeModel( monitor, this );
*
* EntityTreeView *view = new EntityTreeView( this );
* view->setModel( model );
@@ -101,7 +100,7 @@ class EntityTreeModelPrivate;
* The EntityTreeModel will show items of a different type by changing the line
*
* @code
- * changeRecorder->setMimeTypeMonitored( KContacts::addresseeMimeType() );
+ * monitor->setMimeTypeMonitored( KContacts::addresseeMimeType() );
* @endcode
*
* to a different mimetype. KContacts::addresseeMimeType() is an alias for "text/directory". If changed to KMime::Message::mimeType()
@@ -173,8 +172,8 @@ class EntityTreeModelPrivate;
* fetched. To fetch all item data, including all attributes:
*
* @code
- * changeRecorder->itemFetchScope().fetchFullPayload();
- * changeRecorder->itemFetchScope().fetchAllAttributes();
+ * monitor->itemFetchScope().fetchFullPayload();
+ * monitor->itemFetchScope().fetchAllAttributes();
* @endcode
*
* <h2>Using EntityTreeModel with Proxy models</h2>
@@ -389,10 +388,10 @@ public:
/**
* Creates a new entity tree model.
*
- * @param monitor The ChangeRecorder whose entities should be represented in the model.
+ * @param monitor The Monitor whose entities should be represented in the model.
* @param parent The parent object.
*/
- explicit EntityTreeModel(ChangeRecorder *monitor, QObject *parent = Q_NULLPTR);
+ explicit EntityTreeModel(Monitor *monitor, QObject *parent = Q_NULLPTR);
/**
* Destroys the entity tree model.
@@ -672,7 +671,7 @@ protected:
//@cond PRIVATE
Q_DECLARE_PRIVATE(EntityTreeModel)
EntityTreeModelPrivate *d_ptr;
- EntityTreeModel(ChangeRecorder *monitor, EntityTreeModelPrivate *d, QObject *parent = Q_NULLPTR);
+ EntityTreeModel(Monitor *monitor, EntityTreeModelPrivate *d, QObject *parent = Q_NULLPTR);
//@endcond
private:
diff --git a/src/core/models/entitytreemodel_p.cpp b/src/core/models/entitytreemodel_p.cpp
index 298310d..9266025 100644
--- a/src/core/models/entitytreemodel_p.cpp
+++ b/src/core/models/entitytreemodel_p.cpp
@@ -30,7 +30,7 @@
#include "agentmanager.h"
#include "agenttype.h"
-#include "changerecorder.h"
+#include "monitor.h"
#include "collectioncopyjob.h"
#include "collectionfetchjob.h"
#include "collectionfetchscope.h"
@@ -95,7 +95,7 @@ EntityTreeModelPrivate::~EntityTreeModelPrivate()
{
}
-void EntityTreeModelPrivate::init(ChangeRecorder *monitor)
+void EntityTreeModelPrivate::init(Monitor *monitor)
{
Q_Q(EntityTreeModel);
Q_ASSERT(!m_monitor);
@@ -106,8 +106,6 @@ void EntityTreeModelPrivate::init(ChangeRecorder *monitor)
m_monitor->fetchCollection(true);
m_session = m_monitor->session();
- m_monitor->setChangeRecordingEnabled(false);
-
m_rootCollectionDisplayName = QStringLiteral("[*]");
m_includeStatistics = true;
diff --git a/src/core/models/entitytreemodel_p.h b/src/core/models/entitytreemodel_p.h
index 8a66097..d3ee0fa 100644
--- a/src/core/models/entitytreemodel_p.h
+++ b/src/core/models/entitytreemodel_p.h
@@ -38,7 +38,7 @@ Q_DECLARE_LOGGING_CATEGORY(DebugETM)
namespace Akonadi
{
class ItemFetchJob;
-class ChangeRecorder;
+class Monitor;
class AgentInstance;
}
@@ -74,7 +74,7 @@ public:
Recursive
};
- void init(ChangeRecorder *monitor);
+ void init(Monitor *monitor);
void fetchCollections(const Collection &collection, CollectionFetchJob::Type type = CollectionFetchJob::FirstLevel);
void fetchCollections(const Collection::List &collections, CollectionFetchJob::Type type = CollectionFetchJob::FirstLevel);
@@ -149,7 +149,7 @@ public:
mutable QHash<QString, QIcon> m_iconCache;
mutable QString m_iconThemeName;
- ChangeRecorder *m_monitor;
+ Monitor *m_monitor;
Collection m_rootCollection;
Node *m_rootNode;
QString m_rootCollectionDisplayName;