diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-01-19 14:47:11 +0100 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-01-19 14:47:11 +0100 |
commit | 336e88d4bd330e0d28861c7f702711f53996bfca (patch) | |
tree | 82a58ccb3c4d15600a004b319e720bf722e31439 /common/clientapi.cpp | |
parent | cd7287325944571e9d53b00b48abdba4c9257474 (diff) | |
download | sink-336e88d4bd330e0d28861c7f702711f53996bfca.tar.gz sink-336e88d4bd330e0d28861c7f702711f53996bfca.zip |
ResourceNotification -> Notification
Diffstat (limited to 'common/clientapi.cpp')
-rw-r--r-- | common/clientapi.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/common/clientapi.cpp b/common/clientapi.cpp index 0b417d3..824ef19 100644 --- a/common/clientapi.cpp +++ b/common/clientapi.cpp | |||
@@ -307,7 +307,7 @@ KAsync::Job<void> Resources::inspect(const Inspection &inspectionCommand) | |||
307 | auto id = QUuid::createUuid().toByteArray(); | 307 | auto id = QUuid::createUuid().toByteArray(); |
308 | return resourceAccess->sendInspectionCommand(id, ApplicationDomain::getTypeName<DomainType>(), inspectionCommand.entityIdentifier, inspectionCommand.property, inspectionCommand.expectedValue) | 308 | return resourceAccess->sendInspectionCommand(id, ApplicationDomain::getTypeName<DomainType>(), inspectionCommand.entityIdentifier, inspectionCommand.property, inspectionCommand.expectedValue) |
309 | .template then<void>([resourceAccess, notifier, id](KAsync::Future<void> &future) { | 309 | .template then<void>([resourceAccess, notifier, id](KAsync::Future<void> &future) { |
310 | notifier->registerHandler([&future, id](const ResourceNotification ¬ification) { | 310 | notifier->registerHandler([&future, id](const Notification ¬ification) { |
311 | if (notification.id == id) { | 311 | if (notification.id == id) { |
312 | if (notification.code) { | 312 | if (notification.code) { |
313 | future.setError(-1, "Inspection returned an error: " + notification.message); | 313 | future.setError(-1, "Inspection returned an error: " + notification.message); |
@@ -327,14 +327,14 @@ public: | |||
327 | 327 | ||
328 | } | 328 | } |
329 | QList<QSharedPointer<ResourceAccess> > resourceAccess; | 329 | QList<QSharedPointer<ResourceAccess> > resourceAccess; |
330 | QList<std::function<void(const ResourceNotification &)> > handler; | 330 | QList<std::function<void(const Notification &)> > handler; |
331 | QSharedPointer<QObject> context; | 331 | QSharedPointer<QObject> context; |
332 | }; | 332 | }; |
333 | 333 | ||
334 | Notifier::Notifier(const QSharedPointer<ResourceAccess> &resourceAccess) | 334 | Notifier::Notifier(const QSharedPointer<ResourceAccess> &resourceAccess) |
335 | : d(new Akonadi2::Notifier::Private) | 335 | : d(new Akonadi2::Notifier::Private) |
336 | { | 336 | { |
337 | QObject::connect(resourceAccess.data(), &ResourceAccess::notification, d->context.data(), [this](const ResourceNotification ¬ification) { | 337 | QObject::connect(resourceAccess.data(), &ResourceAccess::notification, d->context.data(), [this](const Notification ¬ification) { |
338 | for (const auto &handler : d->handler) { | 338 | for (const auto &handler : d->handler) { |
339 | handler(notification); | 339 | handler(notification); |
340 | } | 340 | } |
@@ -342,7 +342,7 @@ Notifier::Notifier(const QSharedPointer<ResourceAccess> &resourceAccess) | |||
342 | d->resourceAccess << resourceAccess; | 342 | d->resourceAccess << resourceAccess; |
343 | } | 343 | } |
344 | 344 | ||
345 | void Notifier::registerHandler(std::function<void(const ResourceNotification &)> handler) | 345 | void Notifier::registerHandler(std::function<void(const Notification &)> handler) |
346 | { | 346 | { |
347 | d->handler << handler; | 347 | d->handler << handler; |
348 | } | 348 | } |