From 17269914807884be0e9d740b760ed105b3f3978f Mon Sep 17 00:00:00 2001 From: Tomasz Iwanek Date: Wed, 21 Nov 2012 15:03:34 +0100 Subject: [PATCH] Removing unused merged code [Issue#] LINUXNGWAP-428 [Bug] Code that was removed is merged back somehow [Cause] N/A [Solution] Removing that code and widgetHandle uses [Verification] Build or check buildbot status Change-Id: I058cbc0705699392b15d5e894c7d1e7288940a01 --- src/jobs/widget_install/task_db_update.cpp | 121 ------------------------- src/jobs/widget_install/task_db_update.h | 47 ---------- src/jobs/widget_install/task_new_db_insert.cpp | 111 ----------------------- src/jobs/widget_install/task_new_db_insert.h | 48 ---------- src/logic/installer_controller.h | 2 +- 5 files changed, 1 insertion(+), 328 deletions(-) delete mode 100644 src/jobs/widget_install/task_db_update.cpp delete mode 100644 src/jobs/widget_install/task_db_update.h delete mode 100644 src/jobs/widget_install/task_new_db_insert.cpp delete mode 100644 src/jobs/widget_install/task_new_db_insert.h diff --git a/src/jobs/widget_install/task_db_update.cpp b/src/jobs/widget_install/task_db_update.cpp deleted file mode 100644 index 5b02a95..0000000 --- a/src/jobs/widget_install/task_db_update.cpp +++ /dev/null @@ -1,121 +0,0 @@ -/* - * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved - * - * 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. - */ -/** - * @file task_db_update.cpp - * @author Lukasz Wrzosek(l.wrzosek@samsung.com) - * @version 1.0 - * @brief Implementation file for installer task database updating - */ -//#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -using namespace WrtDB; - -namespace Jobs { -namespace WidgetInstall { -TaskDbUpdate::TaskDbUpdate(InstallerContext& context) : - DPL::TaskDecl(this), - m_context(context) -{ - AddStep(&TaskDbUpdate::StepDbUpdate); - - AddAbortStep(&TaskDbUpdate::StepAbortDBUpdate); -} - -void TaskDbUpdate::StepDbUpdate() -{ - Try - { - // If there is existing model, remove its database data - if (true == m_context.existingWidgetInfo.isExist) { - WidgetHandle old = m_context.existingWidgetInfo.existingHandle; - LogInfo("Unregistering widget...: " << old); - WidgetDAO::unregisterWidget(old); - LogInfo("Widget unregistered"); - } - - /* Set install Time */ - time(&m_context.widgetConfig.installedTime); - - LogInfo("Registering widget..."); - - WidgetDAO::registerWidget( - *(m_context.widgetHandle), - m_context.widgetConfig, - m_context.wacSecurity); - - FOREACH (cap, m_context.staticPermittedDevCaps) { - LogInfo("staticPermittedDevCaps : " << cap->first - << " smack status: " << cap->second); - } - - Assert(!!m_context.widgetConfig.pkgname - && "pkgName should be initialized"); - - WrtDB::WidgetDAO widgetDao(*m_context.widgetHandle); - widgetDao.setPkgName(m_context.widgetConfig.pkgname); - - LogInfo("Widget registered"); - } - Catch(WidgetDAO::Exception::DatabaseError) - { - LogWarning("Database failure!"); - ReThrowMsg(Exceptions::DatabaseFailure, "Database failure!"); - } - Catch(DPL::DB::SqlConnection::Exception::Base) - { - LogDebug("Database failure!"); - ReThrowMsg(Exceptions::DatabaseFailure, "Database failure!"); - } - - m_context.job->UpdateProgress( - InstallerContext::INSTALL_DB_UPDATE, - "Widget DB UPDATE Finished"); -} - -void TaskDbUpdate::StepAbortDBUpdate() -{ - LogWarning("[DB Update Task] Aborting... (DB Clean)"); - Assert(!!m_context.widgetHandle); - Try - { - WidgetDAO::unregisterWidget(*m_context.widgetHandle); - - LogDebug("Cleaning DB successful!"); - } - Catch(DPL::DB::SqlConnection::Exception::Base) - { - //TODO What should happen here? - LogError("Failed to handle StepAbortDBClean!"); - // ReThrowMsg(Exceptions::DbStepFailed, "Failed to handle StepAbortDBClean!"); - } -} - -} //namespace WidgetInstall -} //namespace Jobs diff --git a/src/jobs/widget_install/task_db_update.h b/src/jobs/widget_install/task_db_update.h deleted file mode 100644 index 3f76680..0000000 --- a/src/jobs/widget_install/task_db_update.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved - * - * 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. - */ -/* - * @file task_db_update.h - * @author Lukasz Wrzosek(l.wrzosek@samsung.com) - * @version 1.0 - * @brief Header file for installer task database updating - */ -#ifndef INSTALLER_CORE_JOS_WIDGET_INSTALL_TASK_DB_UPDATE_H -#define INSTALLER_CORE_JOS_WIDGET_INSTALL_TASK_DB_UPDATE_H - -#include - -class InstallerContext; - -namespace Jobs { -namespace WidgetInstall { -class TaskDbUpdate : - public DPL::TaskDecl -{ - private: - InstallerContext& m_context; - - void StepDbUpdate(); - - void StepAbortDBUpdate(); - - public: - TaskDbUpdate(InstallerContext& context); -}; -} //namespace WidgetInstall -} //namespace Jobs - -#endif // INSTALLER_CORE_JOS_WIDGET_INSTALL_TASK_DB_UPDATE_H diff --git a/src/jobs/widget_install/task_new_db_insert.cpp b/src/jobs/widget_install/task_new_db_insert.cpp deleted file mode 100644 index 38e9d92..0000000 --- a/src/jobs/widget_install/task_new_db_insert.cpp +++ /dev/null @@ -1,111 +0,0 @@ -/* - * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved - * - * 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. - */ -/** - * @file task_new_db_insert.cpp - * @author Lukasz Wrzosek(l.wrzosek@samsung.com) - * @author Soyoung kim(sy037.kim@samsung.com) - * @version 1.0 - * @brief Implementation file for installer task database updating for widget update - */ -#include -#include -#include -#include -#include -#include -//#include -#include -#include -#include -#include -//#include -#include -#include - -using namespace WrtDB; - -namespace Jobs { -namespace WidgetInstall { -TaskNewDbInsert::TaskNewDbInsert(InstallerContext& context) : - DPL::TaskDecl(this), - m_context(context) -{ - AddStep(&TaskNewDbInsert::StepDBInsert); - - AddAbortStep(&TaskNewDbInsert::StepAbortDBInsert); -} - -void TaskNewDbInsert::StepDBInsert() -{ - Try - { - /* Set install Time */ - time(&m_context.widgetConfig.installedTime); - - LogInfo("Registering widget..."); - - WidgetDAO::registerWidget( - *(m_context.widgetHandle), - m_context.widgetConfig, - m_context.wacSecurity); - - FOREACH (cap, m_context.staticPermittedDevCaps) { - LogInfo("staticPermittedDevCaps : " << cap->first - << " smack status: " << cap->second); - } - - Assert(!!m_context.widgetConfig.pkgname - && "pkgName should be initialized"); - - WrtDB::WidgetDAO widgetDao(*m_context.widgetHandle); - widgetDao.setPkgName(m_context.widgetConfig.pkgname); - - LogInfo("Widget registered"); - } - Catch(WidgetDAO::Exception::DatabaseError) - { - LogWarning("Database failure!"); - ReThrowMsg(Exceptions::InsertNewWidgetFailed, "Database failure!"); - } - Catch(DPL::DB::SqlConnection::Exception::Base) - { - LogDebug("Database failure!"); - ReThrowMsg(Exceptions::InsertNewWidgetFailed, "Database failure!"); - } - - m_context.job->UpdateProgress( - InstallerContext::INSTALL_NEW_DB_INSERT, - "New Widget DB UPDATE Finished"); -} - -void TaskNewDbInsert::StepAbortDBInsert() -{ - LogWarning("[DB Update Task] Aborting... (DB Clean)"); - Assert(!!m_context.widgetHandle); - Try - { - WidgetDAO::unregisterWidget(*m_context.widgetHandle); - - LogDebug("Cleaning DB successful!"); - } - Catch(DPL::DB::SqlConnection::Exception::Base) - { - LogError("Failed to handle StepAbortDBClean!"); - } -} - -} //namespace WidgetInstall -} //namespace Jobs diff --git a/src/jobs/widget_install/task_new_db_insert.h b/src/jobs/widget_install/task_new_db_insert.h deleted file mode 100644 index 13290d4..0000000 --- a/src/jobs/widget_install/task_new_db_insert.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved - * - * 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. - */ -/* - * @file task_new_db_insert.h - * @author Lukasz Wrzosek(l.wrzosek@samsung.com) - * @author Soyoung kim(sy037.kim@samsung.com) - * @version 1.0 - * @brief Header file for installer task database updating for widget update - */ -#ifndef INSTALLER_CORE_JOS_WIDGET_INSTALL_TASK_NEW_DB_INSERT_H -#define INSTALLER_CORE_JOS_WIDGET_INSTALL_TASK_NEW_DB_INSERT_H - -#include - -class InstallerContext; - -namespace Jobs { -namespace WidgetInstall { -class TaskNewDbInsert: - public DPL::TaskDecl -{ - private: - InstallerContext& m_context; - - void StepDBInsert(); - - void StepAbortDBInsert(); - - public: - TaskNewDbInsert(InstallerContext& context); -}; -} //namespace WidgetInstall -} //namespace Jobs - -#endif // INSTALLER_CORE_JOS_WIDGET_INSTALL_TASK_NEW_DB_INSERT_H diff --git a/src/logic/installer_controller.h b/src/logic/installer_controller.h index 938e7ee..55c68fe 100644 --- a/src/logic/installer_controller.h +++ b/src/logic/installer_controller.h @@ -52,7 +52,7 @@ DECLARE_GENERIC_EVENT_2(InstallPluginEvent, std::string, PluginInstallerStruct) /** * @brief Event for inicietig widget uninstallation. * - * WidgetHandler is used to point witch widget shuld be uninstalled + * tizen id is used to point witch widget shuld be uninstalled */ DECLARE_GENERIC_EVENT_2(UninstallWidgetEvent, std::string, -- 2.7.4