diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-01-18 18:38:59 +0100 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-01-18 18:38:59 +0100 |
commit | db48154e47a9f611b7d3dceb195b14a8953e7abb (patch) | |
tree | 9e0a57762c659aa7a8a037daa7d2ef10c73dccc5 | |
parent | 67e83aadde8db2bb1293cee61e8c6306a4ffcca0 (diff) | |
download | sink-db48154e47a9f611b7d3dceb195b14a8953e7abb.tar.gz sink-db48154e47a9f611b7d3dceb195b14a8953e7abb.zip |
Reuse the queuedInvoke method for less boilerplate
-rw-r--r-- | common/resourceaccess.cpp | 9 | ||||
-rw-r--r-- | common/resourceaccess.h | 1 |
2 files changed, 3 insertions, 7 deletions
diff --git a/common/resourceaccess.cpp b/common/resourceaccess.cpp index 483d83f..c78993b 100644 --- a/common/resourceaccess.cpp +++ b/common/resourceaccess.cpp | |||
@@ -534,7 +534,9 @@ bool ResourceAccess::processMessageBuffer() | |||
534 | 534 | ||
535 | d->completeCommands << buffer->id(); | 535 | d->completeCommands << buffer->id(); |
536 | //The callbacks can result in this object getting destroyed directly, so we need to ensure we finish our work first | 536 | //The callbacks can result in this object getting destroyed directly, so we need to ensure we finish our work first |
537 | QMetaObject::invokeMethod(this, "callCallbacks", Qt::QueuedConnection); | 537 | queuedInvoke([=]() { |
538 | d->callCallbacks(); | ||
539 | }); | ||
538 | break; | 540 | break; |
539 | } | 541 | } |
540 | case Commands::NotificationCommand: { | 542 | case Commands::NotificationCommand: { |
@@ -575,11 +577,6 @@ bool ResourceAccess::processMessageBuffer() | |||
575 | return d->partialMessageBuffer.size() >= headerSize; | 577 | return d->partialMessageBuffer.size() >= headerSize; |
576 | } | 578 | } |
577 | 579 | ||
578 | void ResourceAccess::callCallbacks() | ||
579 | { | ||
580 | d->callCallbacks(); | ||
581 | } | ||
582 | |||
583 | void ResourceAccess::log(const QString &message) | 580 | void ResourceAccess::log(const QString &message) |
584 | { | 581 | { |
585 | Log(d->resourceInstanceIdentifier) << this << message; | 582 | Log(d->resourceInstanceIdentifier) << this << message; |
diff --git a/common/resourceaccess.h b/common/resourceaccess.h index fe3fa99..e1c01d7 100644 --- a/common/resourceaccess.h +++ b/common/resourceaccess.h | |||
@@ -97,7 +97,6 @@ private Q_SLOTS: | |||
97 | void connectionError(QLocalSocket::LocalSocketError error); | 97 | void connectionError(QLocalSocket::LocalSocketError error); |
98 | void readResourceMessage(); | 98 | void readResourceMessage(); |
99 | bool processMessageBuffer(); | 99 | bool processMessageBuffer(); |
100 | void callCallbacks(); | ||
101 | 100 | ||
102 | private: | 101 | private: |
103 | void connected(); | 102 | void connected(); |