From 4eb5dda9c17b9a62952ee7966a87352111c03cf6 Mon Sep 17 00:00:00 2001 From: Albert Vaca Date: Fri, 30 Aug 2013 19:07:08 +0200 Subject: [PATCH] LoopbackDevice unserializes and serializes This way the loopback backend is more similar to regular backends --- daemon/devicelinks/loopbackdevicelink.cpp | 10 ++++++++++ daemon/devicelinks/loopbackdevicelink.h | 5 +---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/daemon/devicelinks/loopbackdevicelink.cpp b/daemon/devicelinks/loopbackdevicelink.cpp index 4c46b67d7..92d5eacc0 100644 --- a/daemon/devicelinks/loopbackdevicelink.cpp +++ b/daemon/devicelinks/loopbackdevicelink.cpp @@ -27,3 +27,13 @@ LoopbackDeviceLink::LoopbackDeviceLink(const QString& deviceId, LoopbackLinkProv { } + +bool LoopbackDeviceLink::sendPackage(const NetworkPackage& toSend) const +{ + NetworkPackage toReceive(""); + NetworkPackage::unserialize(toSend.serialize(), &toReceive); + + Q_EMIT receivedPackage(toReceive); + + return true; +} diff --git a/daemon/devicelinks/loopbackdevicelink.h b/daemon/devicelinks/loopbackdevicelink.h index 07307cd2d..209b52f05 100644 --- a/daemon/devicelinks/loopbackdevicelink.h +++ b/daemon/devicelinks/loopbackdevicelink.h @@ -31,10 +31,7 @@ class LoopbackDeviceLink public: LoopbackDeviceLink(const QString& d, LoopbackLinkProvider* a); - bool sendPackage(const NetworkPackage& np) const { - Q_EMIT receivedPackage(np); - return true; - } + bool sendPackage(const NetworkPackage& np) const; };