summaryrefslogtreecommitdiffstats
path: root/common/notifier.cpp
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2016-03-03 09:01:05 +0100
committerChristian Mollekopf <chrigi_1@fastmail.fm>2016-03-03 09:01:05 +0100
commit4d9746c828558c9f872e0aed52442863affb25d5 (patch)
tree507d7c2ba67f47d3cbbcf01a722236ff1b48426b /common/notifier.cpp
parent9cea920b7dd51867a0be0fed2f461b6be73c103e (diff)
downloadsink-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.cpp17
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
28using namespace Sink; 28using namespace Sink;
29 29
30class Sink::Notifier::Private { 30class Sink::Notifier::Private
31{
31public: 32public:
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
42Notifier::Notifier(const QSharedPointer<ResourceAccess> &resourceAccess) 41Notifier::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 &notification) { 43 QObject::connect(resourceAccess.data(), &ResourceAccess::notification, d->context.data(), [this](const Notification &notification) {
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
53Notifier::Notifier(const QByteArray &instanceIdentifier) 51Notifier::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();