diff options
author | Kozoriz <kozorizandriy@gmail.com> | 2016-04-25 16:39:26 +0300 |
---|---|---|
committer | Kozoriz <kozorizandriy@gmail.com> | 2016-04-25 16:39:26 +0300 |
commit | 990bee92cc9d67f9845629bf86e0a700ccc700ce (patch) | |
tree | 2feedfc333dfd6af412db96e189c941b367e08c7 /src/components/application_manager/src/commands/mobile/slider_request.cc | |
parent | 388ef32944603a105ed34db4aa089acf5a7a87fd (diff) | |
download | sdl_core-990bee92cc9d67f9845629bf86e0a700ccc700ce.tar.gz |
Code style format with clang-format
Diffstat (limited to 'src/components/application_manager/src/commands/mobile/slider_request.cc')
-rw-r--r-- | src/components/application_manager/src/commands/mobile/slider_request.cc | 54 |
1 files changed, 22 insertions, 32 deletions
diff --git a/src/components/application_manager/src/commands/mobile/slider_request.cc b/src/components/application_manager/src/commands/mobile/slider_request.cc index 0c4b177d44..3920b49db3 100644 --- a/src/components/application_manager/src/commands/mobile/slider_request.cc +++ b/src/components/application_manager/src/commands/mobile/slider_request.cc @@ -42,16 +42,15 @@ namespace application_manager { namespace commands { -SliderRequest::SliderRequest(const MessageSharedPtr& message, ApplicationManager& application_manager) - : CommandRequestImpl(message, application_manager) { +SliderRequest::SliderRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager) + : CommandRequestImpl(message, application_manager) { subscribe_on_event(hmi_apis::FunctionID::UI_OnResetTimeout); } -SliderRequest::~SliderRequest() { -} +SliderRequest::~SliderRequest() {} bool SliderRequest::Init() { - /* Timeout in milliseconds. If omitted a standard value of 10000 milliseconds is used.*/ if ((*message_)[strings::msg_params].keyExists(strings::timeout)) { @@ -66,9 +65,8 @@ bool SliderRequest::Init() { void SliderRequest::Run() { LOG4CXX_AUTO_TRACE(logger_); - ApplicationSharedPtr application = - application_manager_.application( - (*message_)[strings::params][strings::connection_key].asUInt()); + ApplicationSharedPtr application = application_manager_.application( + (*message_)[strings::params][strings::connection_key].asUInt()); if (!application) { LOG4CXX_ERROR(logger_, "Application is not registered"); @@ -85,9 +83,8 @@ void SliderRequest::Run() { if ((*message_)[strings::msg_params].keyExists(strings::slider_footer)) { if (1 < (*message_)[strings::msg_params][strings::slider_footer].length()) { - if ((*message_)[strings::msg_params][strings::num_ticks].asUInt() - != (*message_)[strings::msg_params] - [strings::slider_footer].length()) { + if ((*message_)[strings::msg_params][strings::num_ticks].asUInt() != + (*message_)[strings::msg_params][strings::slider_footer].length()) { LOG4CXX_ERROR(logger_, "INVALID_DATA"); SendResponse(false, mobile_apis::Result::INVALID_DATA); return; @@ -101,8 +98,8 @@ void SliderRequest::Run() { return; } - smart_objects::SmartObject msg_params = smart_objects::SmartObject( - smart_objects::SmartType_Map); + smart_objects::SmartObject msg_params = + smart_objects::SmartObject(smart_objects::SmartType_Map); msg_params = (*message_)[strings::msg_params]; msg_params[strings::app_id] = application->app_id(); @@ -124,9 +121,8 @@ void SliderRequest::on_event(const event_engine::Event& event) { const event_engine::Event::EventID event_id = event.id(); if (event_id == FunctionID::UI_OnResetTimeout) { LOG4CXX_INFO(logger_, "Received UI_OnResetTimeout event"); - application_manager_.updateRequestTimeout(connection_key(), - correlation_id(), - default_timeout()); + application_manager_.updateRequestTimeout( + connection_key(), correlation_id(), default_timeout()); return; } @@ -142,30 +138,25 @@ void SliderRequest::on_event(const event_engine::Event& event) { SmartObject response_msg_params = message[strings::msg_params]; - const bool is_timeout_aborted = - Compare<Common_Result::eType, EQ, ONE>( - response_code, - Common_Result::TIMED_OUT, - Common_Result::ABORTED); + const bool is_timeout_aborted = Compare<Common_Result::eType, EQ, ONE>( + response_code, Common_Result::TIMED_OUT, Common_Result::ABORTED); if (is_timeout_aborted) { - if (message[strings::params][strings::data] - .keyExists(strings::slider_position)) { - //Copy slider_position info to msg_params section + if (message[strings::params][strings::data].keyExists( + strings::slider_position)) { + // Copy slider_position info to msg_params section response_msg_params[strings::slider_position] = message[strings::params][strings::data][strings::slider_position]; } else { - LOG4CXX_ERROR(logger_, strings::slider_position << " field is absent" - " in response."); + LOG4CXX_ERROR(logger_, + strings::slider_position << " field is absent" + " in response."); response_msg_params[strings::slider_position] = 0; } } - const bool is_response_success = - Compare<Common_Result::eType, EQ, ONE>( - response_code, - Common_Result::SUCCESS, - Common_Result::WARNINGS); + const bool is_response_success = Compare<Common_Result::eType, EQ, ONE>( + response_code, Common_Result::SUCCESS, Common_Result::WARNINGS); SendResponse(is_response_success, MessageHelper::HMIToMobileResult(response_code), @@ -203,4 +194,3 @@ bool SliderRequest::IsWhiteSpaceExist() { } // namespace commands } // namespace application_manager - |