diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-11-29 00:24:04 +0100 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-11-29 00:24:04 +0100 |
commit | 81b459c0f013704e95fb5933525c82a6ca46f13f (patch) | |
tree | 79e68dfd923765cf048f1c3e15bc69fa0490b434 /common/commandprocessor.cpp | |
parent | 169ded69825ab7bde01a5afe9dc842aebeb1c42e (diff) | |
download | sink-81b459c0f013704e95fb5933525c82a6ca46f13f.tar.gz sink-81b459c0f013704e95fb5933525c82a6ca46f13f.zip |
Cleanup
Diffstat (limited to 'common/commandprocessor.cpp')
-rw-r--r-- | common/commandprocessor.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/common/commandprocessor.cpp b/common/commandprocessor.cpp index bdff905..fccff22 100644 --- a/common/commandprocessor.cpp +++ b/common/commandprocessor.cpp | |||
@@ -122,15 +122,14 @@ void CommandProcessor::processSynchronizeCommand(const QByteArray &data) | |||
122 | auto buffer = Sink::Commands::GetSynchronize(data.constData()); | 122 | auto buffer = Sink::Commands::GetSynchronize(data.constData()); |
123 | auto timer = QSharedPointer<QTime>::create(); | 123 | auto timer = QSharedPointer<QTime>::create(); |
124 | timer->start(); | 124 | timer->start(); |
125 | auto job = KAsync::null<void>(); | ||
126 | Sink::QueryBase query; | 125 | Sink::QueryBase query; |
127 | if (buffer->query()) { | 126 | if (buffer->query()) { |
128 | auto data = QByteArray::fromStdString(buffer->query()->str()); | 127 | auto data = QByteArray::fromStdString(buffer->query()->str()); |
129 | QDataStream stream(&data, QIODevice::ReadOnly); | 128 | QDataStream stream(&data, QIODevice::ReadOnly); |
130 | stream >> query; | 129 | stream >> query; |
131 | } | 130 | } |
132 | job = synchronizeWithSource(query); | 131 | synchronizeWithSource(query) |
133 | job.then<void>([timer](const KAsync::Error &error) { | 132 | .then<void>([timer](const KAsync::Error &error) { |
134 | if (error) { | 133 | if (error) { |
135 | SinkWarning() << "Sync failed: " << error.errorMessage; | 134 | SinkWarning() << "Sync failed: " << error.errorMessage; |
136 | return KAsync::error(error); | 135 | return KAsync::error(error); |
@@ -140,7 +139,6 @@ void CommandProcessor::processSynchronizeCommand(const QByteArray &data) | |||
140 | } | 139 | } |
141 | }) | 140 | }) |
142 | .exec(); | 141 | .exec(); |
143 | return; | ||
144 | } else { | 142 | } else { |
145 | SinkWarning() << "received invalid command"; | 143 | SinkWarning() << "received invalid command"; |
146 | } | 144 | } |