diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-03-03 09:01:05 +0100 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-03-03 09:01:05 +0100 |
commit | 4d9746c828558c9f872e0aed52442863affb25d5 (patch) | |
tree | 507d7c2ba67f47d3cbbcf01a722236ff1b48426b /common/notifier.cpp | |
parent | 9cea920b7dd51867a0be0fed2f461b6be73c103e (diff) | |
download | sink-4d9746c828558c9f872e0aed52442863affb25d5.tar.gz sink-4d9746c828558c9f872e0aed52442863affb25d5.zip |
Fromatted the whole codebase with clang-format.
clang-format -i */**{.cpp,.h}
Diffstat (limited to 'common/notifier.cpp')
-rw-r--r-- | common/notifier.cpp | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/common/notifier.cpp b/common/notifier.cpp index e4248df..25d0b85 100644 --- a/common/notifier.cpp +++ b/common/notifier.cpp | |||
@@ -27,20 +27,18 @@ | |||
27 | 27 | ||
28 | using namespace Sink; | 28 | using namespace Sink; |
29 | 29 | ||
30 | class Sink::Notifier::Private { | 30 | class Sink::Notifier::Private |
31 | { | ||
31 | public: | 32 | public: |
32 | Private() | 33 | Private() : context(new QObject) |
33 | : context(new QObject) | ||
34 | { | 34 | { |
35 | |||
36 | } | 35 | } |
37 | QList<QSharedPointer<ResourceAccess> > resourceAccess; | 36 | QList<QSharedPointer<ResourceAccess>> resourceAccess; |
38 | QList<std::function<void(const Notification &)> > handler; | 37 | QList<std::function<void(const Notification &)>> handler; |
39 | QSharedPointer<QObject> context; | 38 | QSharedPointer<QObject> context; |
40 | }; | 39 | }; |
41 | 40 | ||
42 | Notifier::Notifier(const QSharedPointer<ResourceAccess> &resourceAccess) | 41 | Notifier::Notifier(const QSharedPointer<ResourceAccess> &resourceAccess) : d(new Sink::Notifier::Private) |
43 | : d(new Sink::Notifier::Private) | ||
44 | { | 42 | { |
45 | QObject::connect(resourceAccess.data(), &ResourceAccess::notification, d->context.data(), [this](const Notification ¬ification) { | 43 | QObject::connect(resourceAccess.data(), &ResourceAccess::notification, d->context.data(), [this](const Notification ¬ification) { |
46 | for (const auto &handler : d->handler) { | 44 | for (const auto &handler : d->handler) { |
@@ -50,8 +48,7 @@ Notifier::Notifier(const QSharedPointer<ResourceAccess> &resourceAccess) | |||
50 | d->resourceAccess << resourceAccess; | 48 | d->resourceAccess << resourceAccess; |
51 | } | 49 | } |
52 | 50 | ||
53 | Notifier::Notifier(const QByteArray &instanceIdentifier) | 51 | Notifier::Notifier(const QByteArray &instanceIdentifier) : d(new Sink::Notifier::Private) |
54 | : d(new Sink::Notifier::Private) | ||
55 | { | 52 | { |
56 | auto resourceAccess = Sink::ResourceAccess::Ptr::create(instanceIdentifier); | 53 | auto resourceAccess = Sink::ResourceAccess::Ptr::create(instanceIdentifier); |
57 | resourceAccess->open(); | 54 | resourceAccess->open(); |