From: hyunho Date: Fri, 30 Aug 2019 01:34:01 +0000 (+0900) Subject: Remove unused codes X-Git-Tag: submit/tizen/20190830.041902~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=04e74f978ed1ff9bb0eb56383adba1115dcfd79a;p=platform%2Fcore%2Fappfw%2Fcomponent-based-application.git Remove unused codes Change-Id: I83008964209d8517bbfb4089eb2ba395224ee5c9 Signed-off-by: hyunho --- diff --git a/component_based/base/component.cc b/component_based/base/component.cc index 3c5e7a5..cec29a8 100644 --- a/component_based/base/component.cc +++ b/component_based/base/component.cc @@ -309,10 +309,6 @@ std::string Component::GetInstanceID() { return impl_->GetInstanceID(); } -ResourceManager& Component::GetResourceManager() { - return impl_->GetResourceManager(); -} - void Component::Finish() { auto& mgr = internal::ComponentManager::GetInst(); mgr.Exit(impl_->GetInstanceID()); diff --git a/component_based/base/component.h b/component_based/base/component.h index 8b9a58a..8353ff5 100644 --- a/component_based/base/component.h +++ b/component_based/base/component.h @@ -26,7 +26,6 @@ #include "component_based/base/device_orientation.h" #include "component_based/base/low_battery.h" #include "component_based/base/low_memory.h" -#include "component_based/base/resource_manager.h" #include "component_based/base/suspended_state.h" #ifndef EXPORT_API @@ -80,7 +79,6 @@ class EXPORT_API Component { std::string GetComponentID(); std::string GetInstanceID(); - ResourceManager& GetResourceManager(); void Finish(); Type GetType(); void RegisterAction(std::string app_control_name); diff --git a/component_based/base/component_implementation.h b/component_based/base/component_implementation.h index 568aec4..57d431b 100644 --- a/component_based/base/component_implementation.h +++ b/component_based/base/component_implementation.h @@ -27,7 +27,6 @@ #include "component_based/base/action_internal.h" #include "component_based/base/component.h" #include "component_based/base/component_manager_internal.h" -#include "component_based/base/resource_manager.h" #include "component_based/base/system_event_internal.h" #include "component_based/base/content_manager_internal.h" @@ -71,10 +70,6 @@ class Component::Impl : internal::ComponentManager::IEventListener, return inst_id_; } - ResourceManager& GetResourceManager() { - return res_mgr_; - } - void SendAsync(AppControl control, AppControl::IEventListener* ev); AppControl Send(AppControl control); @@ -96,7 +91,6 @@ class Component::Impl : internal::ComponentManager::IEventListener, std::string inst_id_; std::unique_ptr sys_ev_; std::unique_ptr content_mgr_; - ResourceManager res_mgr_; State state_ = State::None; std::map> act_map_; }; diff --git a/component_based/base/resource_manager.cc b/component_based/base/resource_manager.cc deleted file mode 100644 index f762815..0000000 --- a/component_based/base/resource_manager.cc +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2019 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include - -#include -#include - -#include "component_based/base/dlog_internal.h" -#include "component_based/base/resource_manager.h" - -namespace component_based { - -std::string ResourceManager::Get(ResourceManager::Type type, std::string id) { - char* path = nullptr; - int r = app_resource_manager_get(static_cast(type), - id.c_str(), &path); - if (r != APP_RESOURCE_ERROR_NONE) { - LOGE("Failed to get resource(%s). error(%d)", id.c_str(), r); - return std::string(""); - } - - auto p = std::unique_ptr(path, std::free); - return std::string(p.get()); -} - -} // namespace component_based diff --git a/component_based/base/resource_manager.h b/component_based/base/resource_manager.h deleted file mode 100644 index 13ffddf..0000000 --- a/component_based/base/resource_manager.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) 2019 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef COMPONENT_BASED_BASE_RESOURCE_MANAGER_H_ -#define COMPONENT_BASED_BASE_RESOURCE_MANAGER_H_ - -#include - -#ifndef EXPORT_API -#define EXPORT_API __attribute__((visibility("default"))) -#endif - -namespace component_based { - -class EXPORT_API ResourceManager { - public: - enum class Type { - Image, - Layout, - Sound, - Bin, - }; - - std::string Get(Type type, std::string id); -}; - -} // namespace component_based - -#endif // COMPONENT_BASED_BASE_RESOURCE_MANAGER_H_ diff --git a/unit_tests/src/base/test_component_based_component.cc b/unit_tests/src/base/test_component_based_component.cc index 7454e34..96106c0 100644 --- a/unit_tests/src/base/test_component_based_component.cc +++ b/unit_tests/src/base/test_component_based_component.cc @@ -11,7 +11,6 @@ #include "component_based/base/service_component.h" #include "component_based/base/component.h" #include "component_based/base/component_implementation.h" -#include "component_based/base/resource_manager.h" #include "unit_tests/mock/mock_app_common.h" #include "unit_tests/mock/mock_app_control.h" @@ -134,11 +133,6 @@ TEST_F(ComponentTest, TestComponentClass) { component_based::Component::Type type = fc->GetType(); EXPECT_EQ(type, component_based::Component::Type::Frame); - - component_based::ResourceManager rm = fc->GetResourceManager(); - std::string path = rm.Get(component_based::ResourceManager::Type::Sound, "test"); - EXPECT_STREQ(path.c_str(), "tmp"); - fc->Finish(); fc->RegisterAction(std::string("action"));