Commit 007c11d2 authored by Daniel Vrátil's avatar Daniel Vrátil 🤖
Browse files

Receive notifications via the new Notification Bus instead of DBus

Monitor, once subscribing to the NotificationManager starts a new Session using the
identifier received from NotificationManager. The Session is started in the special
NotificationBus mode, so the server will use it to deliver notifications for the given
subscriber through it.

This laos ports all code from NotificationMessageV* to Protocol::ChangeNotification.
parent 18f20a87
......@@ -18,7 +18,7 @@ include(KDEFrameworkCompilerSettings)
# FIXME: Do we want the same versions in kdepimlibs and kf5?
set(KF5_VERSION "5.11.0")
set(KDEPIMLIBS_VERSION "4.83.0")
set(KDEPIMLIBS_VERSION "4.84.0")
set(QT_REQUIRED_VERSION "5.2.0")
# Remove it when we split it
......@@ -54,7 +54,7 @@ set(AKONADI_TESTS_EXPORT AKONADICORE_EXPORT)
configure_file(akonadiprivate_export.h.in "${CMAKE_CURRENT_BINARY_DIR}/akonadiprivate_export.h")
set(KF5AkonadiServer_MIN_VERSION "5.0.50")
set(KF5AkonadiServer_MIN_VERSION "5.0.51")
find_package(KF5AkonadiServer ${KF5AkonadiServer_MIN_VERSION} CONFIG REQUIRED)
find_package(Qt5Designer NO_MODULE)
......
......@@ -59,7 +59,7 @@ include(../KF5AkonadiMacros.cmake)
# akonadi test fake library
set(akonaditestfake_xml ${AKONADI_DBUS_INTERFACES_DIR}/org.freedesktop.Akonadi.NotificationSource.xml)
set_source_files_properties(${akonaditestfake_xml} PROPERTIES INCLUDE "notificationmessagev3_p.h")
set_source_files_properties(${akonaditestfake_xml} PROPERTIES INCLUDE "protocol_p.h")
qt5_add_dbus_interface( akonaditestfake_srcs ${akonaditestfake_xml} notificationsourceinterface )
add_library(akonaditestfake SHARED
......
/*
* Copyright 2015 Daniel Vrátil <dvratil@redhat.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License or (at your option) version 3 or any later version
* accepted by the membership of KDE e.V. (or its successor approved
* by the membership of KDE e.V.), which shall act as a proxy
* defined in Section 14 of version 3 of the license.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "test_utils.h"
#include "collectioncreatejob.h"
#include "collectionfetchjob.h"
#include "collectionmodifyjob.h"
#include "collectiondeletejob.h"
#include "entitydisplayattribute.h"
using namespace Akonadi;
class CollectionModifyTest : public QObject
{
Q_OBJECT
private Q_SLOTS:
void initTestCase()
{
AkonadiTest::checkTestIsIsolated();
}
void testModifyCollection()
{
Collection col;
col.setName(QLatin1String("test_collection"));
col.setContentMimeTypes({ Collection::mimeType() });
col.setParentCollection(Collection(collectionIdFromPath(QLatin1String("res1"))));
col.setRights(Collection::AllRights);
CollectionCreateJob *cj = new CollectionCreateJob(col, this);
AKVERIFYEXEC(cj);
col = cj->collection();
QVERIFY(col.isValid());
auto attr = col.attribute<EntityDisplayAttribute>(Entity::AddIfMissing);
attr->setDisplayName(QLatin1String("Test Collection"));
col.setContentMimeTypes({ Collection::mimeType(), QLatin1String("application/octet-stream") });
CollectionModifyJob *mj = new CollectionModifyJob(col, this);
AKVERIFYEXEC(mj);
CollectionFetchJob *fj = new CollectionFetchJob(col, CollectionFetchJob::Base);
AKVERIFYEXEC(fj);
QCOMPARE(fj->collections().count(), 1);
const Collection actual = fj->collections().at(0);
QCOMPARE(actual.id(), col.id());
QCOMPARE(actual.name(), col.name());
QCOMPARE(actual.displayName(), col.displayName());
QCOMPARE(actual.contentMimeTypes(), col.contentMimeTypes());
QCOMPARE(actual.parentCollection(), col.parentCollection());
QCOMPARE(actual.rights(), col.rights());
CollectionDeleteJob *dj = new CollectionDeleteJob(col, this);
AKVERIFYEXEC(dj);
}
};
QTEST_AKONADIMAIN(CollectionModifyTest)
#include "collectionmodifytest.moc"
\ No newline at end of file
......@@ -22,11 +22,14 @@
#include "monitor_p.h"
#include "notificationsource_p.h"
#include "notificationbus_p.h"
#include "collectionfetchscope.h"
#include "itemfetchscope.h"
#include "akonaditestfake_export.h"
#include <akonadi/private/protocol_p.h>
template<typename T, typename Cache>
class FakeEntityCache : public Cache
{
......@@ -83,11 +86,6 @@ public:
{
}
void emitNotify(const Akonadi::NotificationMessageV3::List &msgs)
{
notifyV3(msgs);
}
public Q_SLOTS:
void setAllMonitored(bool allMonitored)
{
......@@ -123,9 +121,28 @@ public Q_SLOTS:
{
Q_UNUSED(session);
}
};
class AKONADITESTFAKE_EXPORT FakeNotificationBus : public QObject
{
Q_OBJECT
public:
explicit FakeNotificationBus(QObject* parent = Q_NULLPTR)
: QObject(parent)
{}
virtual ~FakeNotificationBus()
{}
void emitNotify(const Akonadi::Protocol::ChangeNotification &ntf)
{
Q_EMIT notify(ntf);
}
Q_SIGNALS:
void notifyV3(const Akonadi::NotificationMessageV3::List &msgs);
void notify(const Akonadi::Protocol::ChangeNotification &ntf);
};
class FakeMonitorDependeciesFactory : public Akonadi::ChangeNotificationDependenciesFactory
......@@ -144,6 +161,12 @@ public:
return new Akonadi::NotificationSource(new FakeNotificationSource(parent));
}
QObject *createNotificationBus(QObject *parent, Akonadi::NotificationSource *source) Q_DECL_OVERRIDE
{
Q_UNUSED(source);
return new FakeNotificationBus(parent);
}
Akonadi::CollectionCache *createCollectionCache(int maxCapacity, Akonadi::Session *session) Q_DECL_OVERRIDE
{
Q_UNUSED(maxCapacity)
......
......@@ -38,7 +38,7 @@ public:
{
}
bool emitNotification(const Akonadi::NotificationMessageV3 &msg) Q_DECL_OVERRIDE
bool emitNotification(const Akonadi::Protocol::ChangeNotification &msg) Q_DECL_OVERRIDE
{
// TODO: Check/Log
return Akonadi::ChangeRecorderPrivate::emitNotification(msg);
......@@ -55,11 +55,15 @@ public:
return qobject_cast<FakeNotificationSource *>(d_ptr->notificationSource->source());
}
QQueue<Akonadi::NotificationMessageV3> pendingNotifications() const
FakeNotificationBus *notificationBus() const {
return qobject_cast<FakeNotificationBus *>(d_ptr->notificationBus);
}
QQueue<Akonadi::Protocol::ChangeNotification> pendingNotifications() const
{
return d_ptr->pendingNotifications;
}
QQueue<Akonadi::NotificationMessageV3> pipeline() const
QQueue<Akonadi::Protocol::ChangeNotification> pipeline() const
{
return d_ptr->pipeline;
}
......
......@@ -38,7 +38,7 @@ public:
{
}
bool emitNotification(const Akonadi::NotificationMessageV3 &msg) Q_DECL_OVERRIDE
bool emitNotification(const Akonadi::Protocol::ChangeNotification &msg) Q_DECL_OVERRIDE
{
// TODO: Check/Log
return Akonadi::MonitorPrivate::emitNotification(msg);
......@@ -56,11 +56,16 @@ public:
return qobject_cast<FakeNotificationSource *>(d_ptr->notificationSource->source());
}
QQueue<Akonadi::NotificationMessageV3> pendingNotifications() const
FakeNotificationBus *notificationBus() const
{
return qobject_cast<FakeNotificationBus *>(d_ptr->notificationBus);
}
QQueue<Akonadi::Protocol::ChangeNotification> pendingNotifications() const
{
return d_ptr->pendingNotifications;
}
QQueue<Akonadi::NotificationMessageV3> pipeline() const
QQueue<Akonadi::Protocol::ChangeNotification> pipeline() const
{
return d_ptr->pipeline;
}
......
This diff is collapsed.
......@@ -100,29 +100,28 @@ void MonitorNotificationTest::testSingleMessage_impl(MonitorImpl *monitor, FakeC
monitor->setSession(m_fakeSession);
monitor->fetchCollection(true);
NotificationMessageV3::List list;
Protocol::ChangeNotification::List list;
Collection parent(1);
Collection added(2);
NotificationMessageV3 msg;
Protocol::ChangeNotification msg;
msg.setParentCollection(parent.id());
msg.setOperation(Akonadi::NotificationMessageV2::Add);
msg.setType(Akonadi::NotificationMessageV2::Collections);
msg.setOperation(Protocol::ChangeNotification::Add);
msg.setType(Protocol::ChangeNotification::Collections);
msg.addEntity( added.id() );
QHash<Collection::Id, Collection> data;
data.insert(parent.id(), parent);
data.insert(added.id(), added);
list << msg;
// Pending notifications remains empty because we don't fill the pipeline with one message.
QVERIFY(monitor->pipeline().isEmpty());
QVERIFY(monitor->pendingNotifications().isEmpty());
monitor->notifier()->emitNotify(list);
monitor->notificationBus()->emitNotify(msg);
QCOMPARE(monitor->pipeline().size(), 1);
QVERIFY(monitor->pendingNotifications().isEmpty());
......@@ -168,7 +167,7 @@ void MonitorNotificationTest::testFillPipeline_impl(MonitorImpl *monitor, FakeCo
monitor->setSession(m_fakeSession);
monitor->fetchCollection(true);
NotificationMessageV3::List list;
Protocol::ChangeNotification::List list;
QHash<Collection::Id, Collection> data;
int i = 1;
......@@ -176,10 +175,10 @@ void MonitorNotificationTest::testFillPipeline_impl(MonitorImpl *monitor, FakeCo
Collection parent(i++);
Collection added(i++);
NotificationMessageV3 msg;
Protocol::ChangeNotification msg;
msg.setParentCollection(parent.id());
msg.setOperation(Akonadi::NotificationMessageV2::Add);
msg.setType(Akonadi::NotificationMessageV2::Collections);
msg.setOperation(Protocol::ChangeNotification::Add);
msg.setType(Protocol::ChangeNotification::Collections);
msg.addEntity( added.id() );
data.insert(parent.id(), parent);
......@@ -191,7 +190,9 @@ void MonitorNotificationTest::testFillPipeline_impl(MonitorImpl *monitor, FakeCo
QVERIFY(monitor->pipeline().isEmpty());
QVERIFY(monitor->pendingNotifications().isEmpty());
monitor->notifier()->emitNotify(list);
Q_FOREACH (const Protocol::ChangeNotification &ntf, list) {
monitor->notificationBus()->emitNotify(ntf);
}
QCOMPARE(monitor->pipeline().size(), 5);
QCOMPARE(monitor->pendingNotifications().size(), 15);
......@@ -236,7 +237,7 @@ void MonitorNotificationTest::testMonitor_impl(MonitorImpl *monitor, FakeCollect
monitor->setSession(m_fakeSession);
monitor->fetchCollection(true);
NotificationMessageV3::List list;
Protocol::ChangeNotification::List list;
Collection col2(2);
col2.setParentCollection(Collection::root());
......@@ -248,10 +249,10 @@ void MonitorNotificationTest::testMonitor_impl(MonitorImpl *monitor, FakeCollect
while (i < 8) {
Collection added(i++);
NotificationMessageV3 msg;
Protocol::ChangeNotification msg;
msg.setParentCollection( i % 2 ? 2 : added.id() - 1);
msg.setOperation(Akonadi::NotificationMessageV2::Add);
msg.setType(Akonadi::NotificationMessageV2::Collections);
msg.setOperation(Protocol::ChangeNotification::Add);
msg.setType(Protocol::ChangeNotification::Collections);
msg.addEntity( added.id() );
list << msg;
......@@ -276,7 +277,9 @@ void MonitorNotificationTest::testMonitor_impl(MonitorImpl *monitor, FakeCollect
QVERIFY(monitor->pipeline().isEmpty());
QVERIFY(monitor->pendingNotifications().isEmpty());
monitor->notifier()->emitNotify(list);
Q_FOREACH (const Protocol::ChangeNotification &ntf, list) {
monitor->notificationBus()->emitNotify(ntf);
}
// Collection 6 is not notified, because Collection 5 has held up the pipeline
QCOMPARE(collectionAddedSpy.size(), 1);
......
......@@ -45,7 +45,8 @@ set(akonadicore_base_SRCS
monitor.cpp
monitor_p.cpp
newmailnotifierattribute.cpp
notificationsource.cpp
notificationbus_p.cpp
notificationsource_p.cpp
partfetcher.cpp
pastehelper.cpp
persistentsearchattribute.cpp
......@@ -268,11 +269,10 @@ if (NOT "${std_exception_file}" STREQUAL "")
endif()
set(akonadicore_dbus_xml ${AKONADI_DBUS_INTERFACES_DIR}/org.freedesktop.Akonadi.NotificationManager.xml)
set_source_files_properties(${akonadicore_dbus_xml} PROPERTIES INCLUDE "${AKONADI_INCLUDE_DIR}/akonadi/private/notificationmessagev3_p.h" )
qt5_add_dbus_interface(akonadicore_dbus_SRCS ${akonadicore_dbus_xml} notificationmanagerinterface)
set(akonadicore_dbus_xml ${AKONADI_DBUS_INTERFACES_DIR}/org.freedesktop.Akonadi.NotificationSource.xml)
set_source_files_properties(${akonadicore_dbus_xml} PROPERTIES INCLUDE "${AKONADI_INCLUDE_DIR}/akonadi/private/notificationmessagev3_p.h" )
set_source_files_properties(${akonadicore_dbus_xml} PROPERTIES INCLUDE "${AKONADI_INCLUDE_DIR}/akonadi/private/protocol_p.h" )
qt5_add_dbus_interface(akonadicore_dbus_SRCS ${akonadicore_dbus_xml} notificationsourceinterface)
qt5_add_dbus_interfaces(akonadicore_dbus_SRCS ${AKONADI_DBUS_INTERFACES_DIR}/org.freedesktop.Akonadi.AgentManager.xml)
......
......@@ -26,7 +26,6 @@
#include <QtCore/QSet>
#include "item.h"
#include <akonadi/private/notificationmessagev2_p.h>
namespace Akonadi {
......@@ -72,7 +71,6 @@ private Q_SLOTS:
private:
QList<QObject *> m_monitors;
QVector<Akonadi::NotificationMessageV2> messageQueue;
QVector<Akonadi::Job *> unfilteredJobs;
QSet<QByteArray> m_sessions;
......
......@@ -20,6 +20,7 @@
#include "changenotificationdependenciesfactory_p.h"
#include "KDBusConnectionPool"
#include "notificationsource_p.h"
#include "notificationbus_p.h"
#include "notificationsourceinterface.h"
#include "notificationmanagerinterface.h"
#include "changemediator_p.h"
......@@ -54,7 +55,7 @@ NotificationSource *ChangeNotificationDependenciesFactory::createNotificationSou
KGlobal::mainComponent().componentName(),
QString::number(QCoreApplication::applicationPid()),
KRandom::randomString(6));
QDBusObjectPath p = manager->subscribeV2(name, true);
QDBusObjectPath p = manager->subscribe(name, false);
const bool validError = manager->lastError().isValid();
if (validError) {
qWarning() << manager->lastError().name() << manager->lastError().message();
......@@ -76,6 +77,13 @@ NotificationSource *ChangeNotificationDependenciesFactory::createNotificationSou
return new NotificationSource(notificationSource);
}
QObject *ChangeNotificationDependenciesFactory::createNotificationBus(QObject *parent, NotificationSource *source)
{
NotificationBusPrivate *priv = new NotificationBusPrivate;
new Session(priv, source->identifier().toLatin1(), parent);
return priv;
}
QObject *ChangeNotificationDependenciesFactory::createChangeMediator(QObject *parent)
{
Q_UNUSED(parent);
......
......@@ -38,6 +38,7 @@ public:
{
}
virtual NotificationSource *createNotificationSource(QObject *parent);
virtual QObject *createNotificationBus(QObject *parent, NotificationSource *source);
virtual QObject *createChangeMediator(QObject *parent);
virtual Akonadi::CollectionCache *createCollectionCache(int maxCapacity, Session *session);
......
......@@ -63,7 +63,7 @@ void ChangeRecorder::replayNext()
}
if (!d->pendingNotifications.isEmpty()) {
const NotificationMessageV3 msg = d->pendingNotifications.head();
const Protocol::ChangeNotification msg = d->pendingNotifications.head();
if (d->ensureDataAvailable(msg)) {
d->emitNotification(msg);
} else if (d->translateAndCompress(d->pipeline, msg)) {
......
......@@ -46,12 +46,12 @@ int ChangeRecorderPrivate::pipelineSize() const
return MonitorPrivate::pipelineSize();
}
void ChangeRecorderPrivate::slotNotify(const Akonadi::NotificationMessageV3::List &msgs)
void ChangeRecorderPrivate::slotNotify(const Akonadi::Protocol::ChangeNotification &msg)
{
Q_Q(ChangeRecorder);
const int oldChanges = pendingNotifications.size();
// with change recording disabled this will automatically take care of dispatching notification messages and saving
MonitorPrivate::slotNotify(msgs);
MonitorPrivate::slotNotify(msg);
if (enableChangeRecording && pendingNotifications.size() != oldChanges) {
emit q->changesAdded();
}
......@@ -85,10 +85,10 @@ void ChangeRecorderPrivate::loadNotifications()
for (int i = 0; i < size; ++i) {
settings->setArrayIndex(i);
NotificationMessageV3 msg;
Protocol::ChangeNotification msg;
msg.setSessionId(settings->value(QStringLiteral("sessionId")).toByteArray());
msg.setType((NotificationMessageV2::Type)settings->value(QStringLiteral("type")).toInt());
msg.setOperation((NotificationMessageV2::Operation)settings->value(QStringLiteral("op")).toInt());
msg.setType((Protocol::ChangeNotification::Type)settings->value(QStringLiteral("type")).toInt());
msg.setOperation((Protocol::ChangeNotification::Operation)settings->value(QStringLiteral("op")).toInt());
msg.addEntity(settings->value(QStringLiteral("uid")).toLongLong(),
settings->value(QStringLiteral("rid")).toString(),
QString(),
......@@ -127,11 +127,11 @@ void ChangeRecorderPrivate::loadNotifications()
notificationsLoaded();
}
static const quint64 s_currentVersion = Q_UINT64_C(0x000300000000);
static const quint64 s_currentVersion = Q_UINT64_C(0x000400000000);
static const quint64 s_versionMask = Q_UINT64_C(0xFFFF00000000);
static const quint64 s_sizeMask = Q_UINT64_C(0x0000FFFFFFFF);
QQueue<NotificationMessageV3> ChangeRecorderPrivate::loadFrom(QIODevice *device, bool &needsFullSave) const
QQueue<Protocol::ChangeNotification> ChangeRecorderPrivate::loadFrom(QIODevice *device, bool &needsFullSave) const
{
QDataStream stream(device);
stream.setVersion(QDataStream::Qt_4_6);
......@@ -143,7 +143,7 @@ QQueue<NotificationMessageV3> ChangeRecorderPrivate::loadFrom(QIODevice *device,
QSet<QByteArray> itemParts, addedFlags, removedFlags;
QSet<qint64> addedTags, removedTags;
QQueue<NotificationMessageV3> list;
QQueue<Protocol::ChangeNotification> list;
quint64 sizeAndVersion;
stream >> sizeAndVersion;
......@@ -161,7 +161,7 @@ QQueue<NotificationMessageV3> ChangeRecorderPrivate::loadFrom(QIODevice *device,
needsFullSave = startOffset > 0 || version == 0;
for (quint64 i = 0; i < size && !stream.atEnd(); ++i) {
NotificationMessageV2 msg;
Protocol::ChangeNotification msg;
if (version == 1) {
stream >> sessionId;
......@@ -180,8 +180,8 @@ QQueue<NotificationMessageV3> ChangeRecorderPrivate::loadFrom(QIODevice *device,
}
msg.setSessionId(sessionId);
msg.setType(static_cast<NotificationMessageV2::Type>(type));
msg.setOperation(static_cast<NotificationMessageV2::Operation>(operation));
msg.setType(static_cast<Protocol::ChangeNotification::Type>(type));
msg.setOperation(static_cast<Protocol::ChangeNotification::Operation>(operation));
msg.addEntity(uid, remoteId, QString(), mimeType);
msg.setResource(resource);
msg.setParentCollection(parentCollection);
......@@ -190,7 +190,7 @@ QQueue<NotificationMessageV3> ChangeRecorderPrivate::loadFrom(QIODevice *device,
} else if (version == 2 || version == 3) {
NotificationMessageV3 msg;
Protocol::ChangeNotification msg;
stream >> sessionId;
stream >> type;
......@@ -220,8 +220,8 @@ QQueue<NotificationMessageV3> ChangeRecorderPrivate::loadFrom(QIODevice *device,
}
msg.setSessionId(sessionId);
msg.setType(static_cast<NotificationMessageV2::Type>(type));
msg.setOperation(static_cast<NotificationMessageV2::Operation>(operation));
msg.setType(static_cast<Protocol::ChangeNotification::Type>(type));
msg.setOperation(static_cast<Protocol::ChangeNotification::Operation>(operation));
msg.setResource(resource);
msg.setDestinationResource(destinationResource);
msg.setParentCollection(parentCollection);
......@@ -271,19 +271,17 @@ QString ChangeRecorderPrivate::dumpNotificationListToString() const
QString result;
bool dummy;
const QQueue<NotificationMessageV3> notifications = loadFrom(&file, dummy);
Q_FOREACH(const NotificationMessageV3 &n, notifications) {
n.toString();
const QQueue<Protocol::ChangeNotification> notifications = loadFrom(&file, dummy);
Q_FOREACH(const Protocol::ChangeNotification &n, notifications) {
QString typeString;
switch (n.type()) {
case NotificationMessageV2::Collections:
case Protocol::ChangeNotification::Collections:
typeString = QStringLiteral("Collections");
break;
case NotificationMessageV2::Items:
case Protocol::ChangeNotification::Items:
typeString = QStringLiteral("Items");
break;
case NotificationMessageV2::Tags:
case Protocol::ChangeNotification::Tags:
typeString = QStringLiteral("Tags");
break;
default:
......@@ -293,34 +291,34 @@ QString ChangeRecorderPrivate::dumpNotificationListToString() const
QString operationString;
switch (n.operation()) {
case NotificationMessageV2::Add:
case Protocol::ChangeNotification::Add:
operationString = QStringLiteral("Add");
break;
case NotificationMessageV2::Modify:
case Protocol::ChangeNotification::Modify:
operationString = QStringLiteral("Modify");
break;
case NotificationMessageV2::ModifyFlags:
case Protocol::ChangeNotification::ModifyFlags:
operationString = QStringLiteral("ModifyFlags");
break;
case NotificationMessageV2::ModifyTags:
case Protocol::ChangeNotification::ModifyTags:
operationString = QStringLiteral("ModifyTags");
break;
case NotificationMessageV2::Move:
case Protocol::ChangeNotification::Move:
operationString = QStringLiteral("Move");
break;
case NotificationMessageV2::Remove:
case Protocol::ChangeNotification::Remove:
operationString = QStringLiteral("Remove");
break;
case NotificationMessageV2::Link:
case Protocol::ChangeNotification::Link:
operationString = QStringLiteral("Link");
break;
case NotificationMessageV2::Unlink:
case Protocol::ChangeNotification::Unlink:
operationString = QStringLiteral("Unlink");
break;
case NotificationMessageV2::Subscribe:
case Protocol::ChangeNotification::Subscribe:
operationString = QStringLiteral("Subscribe");
break;
case NotificationMessageV2::Unsubscribe:
case Protocol::ChangeNotification::Unsubscribe:
operationString = QStringLiteral("Unsubscribe");
break;
default:
......@@ -351,13 +349,16 @@ QString ChangeRecorderPrivate::dumpNotificationListToString() const
return result;
}
void ChangeRecorderPrivate::addToStream(QDataStream &stream, const NotificationMessageV3 &msg)
void ChangeRecorderPrivate::addToStream(QDataStream &stream, const Protocol::ChangeNotification &msg)
{
// We deliberately don't use Factory::serialize(), because the internal
// serialization format could change at any point
stream << msg.sessionId();
stream << int(msg.type());
stream << int(msg.operation());
stream << msg.entities().count();
Q_FOREACH (const NotificationMessageV2::Entity &entity, msg.entities()) {
Q_FOREACH (const Protocol::ChangeNotification::Entity &entity, msg.entities()) {
stream << quint64(entity.id);
stream << entity.remoteId;
stream << entity.remoteRevision;
......@@ -435,7 +436,7 @@ void ChangeRecorderPrivate::saveTo(QIODevice *device)
//qDebug() << "Saving" << pendingNotifications.count() << "notifications (full save)";
for (int i = 0; i < pendingNotifications.count(); ++i) {