From a01b42b4d72214fcaa901ad5319faea8763c8e9b Mon Sep 17 00:00:00 2001 From: Micke Prag Date: Wed, 29 Feb 2012 17:53:52 +0100 Subject: [PATCH] An else should appear on the same line as the preceding } according to Google style guidelines "whitespace/newline" --- telldus-core/service/Device.cpp | 3 +-- telldus-core/service/EventUpdateManager.cpp | 3 +-- telldus-core/service/Protocol.cpp | 18 ++++++------------ telldus-core/service/ProtocolWaveman.cpp | 4 +--- 4 files changed, 9 insertions(+), 19 deletions(-) diff --git a/telldus-core/service/Device.cpp b/telldus-core/service/Device.cpp index 41399643..f1cdc3ad 100644 --- a/telldus-core/service/Device.cpp +++ b/telldus-core/service/Device.cpp @@ -131,8 +131,7 @@ std::wstring Device::getStateValue() { int Device::getType() { if(d->protocolName == L"group") { return TELLSTICK_TYPE_GROUP; - } - else if(d->protocolName == L"scene") { + } else if(d->protocolName == L"scene") { return TELLSTICK_TYPE_SCENE; } return TELLSTICK_TYPE_DEVICE; diff --git a/telldus-core/service/EventUpdateManager.cpp b/telldus-core/service/EventUpdateManager.cpp index 3f5dc623..b81ec06a 100644 --- a/telldus-core/service/EventUpdateManager.cpp +++ b/telldus-core/service/EventUpdateManager.cpp @@ -62,8 +62,7 @@ void EventUpdateManager::run() { if(data) { d->clients.push_back(data->socket); } - } - else if(d->updateEvent->isSignaled()) { + } else if(d->updateEvent->isSignaled()) { // device event, signal all clients TelldusCore::EventDataRef eventData = d->updateEvent->takeSignal(); EventUpdateData *data = reinterpret_cast(eventData.get()); diff --git a/telldus-core/service/Protocol.cpp b/telldus-core/service/Protocol.cpp index 04420885..454b3930 100644 --- a/telldus-core/service/Protocol.cpp +++ b/telldus-core/service/Protocol.cpp @@ -141,9 +141,8 @@ Protocol *Protocol::getProtocolInstance(const std::wstring &protocolname) { } else if (TelldusCore::comparei(protocolname, L"group")) { return new ProtocolGroup(); - } - else if (TelldusCore::comparei(protocolname, L"scene")) { + } else if (TelldusCore::comparei(protocolname, L"scene")) { return new ProtocolScene(); } @@ -232,32 +231,27 @@ std::list Protocol::decodeData(const std::string &fullData) { if (decoded != "") { retval.push_back(decoded); } - } - else if(TelldusCore::comparei(dataMsg.protocol(), L"everflourish") ) { + } else if(TelldusCore::comparei(dataMsg.protocol(), L"everflourish") ) { decoded = ProtocolEverflourish::decodeData(dataMsg); if (decoded != "") { retval.push_back(decoded); } - } - else if(TelldusCore::comparei(dataMsg.protocol(), L"fineoffset") ) { + } else if(TelldusCore::comparei(dataMsg.protocol(), L"fineoffset") ) { decoded = ProtocolFineoffset::decodeData(dataMsg); if (decoded != "") { retval.push_back(decoded); } - } - else if(TelldusCore::comparei(dataMsg.protocol(), L"mandolyn") ) { + } else if(TelldusCore::comparei(dataMsg.protocol(), L"mandolyn") ) { decoded = ProtocolMandolyn::decodeData(dataMsg); if (decoded != "") { retval.push_back(decoded); } - } - else if(TelldusCore::comparei(dataMsg.protocol(), L"oregon") ) { + } else if(TelldusCore::comparei(dataMsg.protocol(), L"oregon") ) { decoded = ProtocolOregon::decodeData(dataMsg); if (decoded != "") { retval.push_back(decoded); } - } - else if(TelldusCore::comparei(dataMsg.protocol(), L"x10") ) { + } else if(TelldusCore::comparei(dataMsg.protocol(), L"x10") ) { decoded = ProtocolX10::decodeData(dataMsg); if (decoded != "") { retval.push_back(decoded); diff --git a/telldus-core/service/ProtocolWaveman.cpp b/telldus-core/service/ProtocolWaveman.cpp index fecd4c3c..0dd2b688 100644 --- a/telldus-core/service/ProtocolWaveman.cpp +++ b/telldus-core/service/ProtocolWaveman.cpp @@ -62,11 +62,9 @@ std::string ProtocolWaveman::decodeData(ControllerMessage& dataMsg) { if(method == 0) { retString << ";unit:" << unit << ";method:turnoff;"; - } else if(method == 14) { retString << ";unit:" << unit << ";method:turnon;"; - } - else { + } else { // not waveman return ""; }