From 02c760ed6ffdaa6a82262e279cd947b78996466a Mon Sep 17 00:00:00 2001 From: Kamil Nowac Date: Thu, 2 May 2013 14:27:30 +0200 Subject: [PATCH] [Developer mode] Removal from wrt-commons repository [Issue#] LINUXWRT-282 [Problem] Unsupported feature [Cause] N/A [Solution] Removing it [Verification] 1. Check if there are any 'D(/d)eveloper' words remains in source code. 2. Build wrt repository. Change-Id: I8e324391cb9a99377806852e35590f9229e987f3 --- modules/widget_dao/dao/global_dao.cpp | 19 ------------------- modules/widget_dao/dao/global_dao_read_only.cpp | 14 -------------- .../include/dpl/wrt-dao-ro/global_dao_read_only.h | 2 -- .../widget_dao/include/dpl/wrt-dao-rw/global_dao.h | 2 -- modules/widget_dao/orm/wrt_db | 1 - tests/dao/TestCases_GlobalDAO.cpp | 16 ---------------- 6 files changed, 54 deletions(-) diff --git a/modules/widget_dao/dao/global_dao.cpp b/modules/widget_dao/dao/global_dao.cpp index 0c22d90..8678c3d 100644 --- a/modules/widget_dao/dao/global_dao.cpp +++ b/modules/widget_dao/dao/global_dao.cpp @@ -29,25 +29,6 @@ #include namespace WrtDB { -void GlobalDAO::SetDeveloperMode(bool mode) -{ - LogDebug("updating Developer mode to:" << mode); - Try { - using namespace DPL::DB::ORM; - using namespace DPL::DB::ORM::wrt; - GlobalProperties::Row row; - row.Set_developer_mode(mode); - - WRT_DB_UPDATE(update, GlobalProperties, &WrtDatabase::interface()) - update->Values(row); - update->Execute(); - } - Catch(DPL::DB::SqlConnection::Exception::Base){ - ReThrowMsg(GlobalDAO::Exception::DatabaseError, - "Failed to update Developer Mode"); - } -} - void GlobalDAO::SetSecureByDefault(bool secure) { //If secure == true -> widget does not need to be signed diff --git a/modules/widget_dao/dao/global_dao_read_only.cpp b/modules/widget_dao/dao/global_dao_read_only.cpp index d634523..3916e57 100644 --- a/modules/widget_dao/dao/global_dao_read_only.cpp +++ b/modules/widget_dao/dao/global_dao_read_only.cpp @@ -32,20 +32,6 @@ #include namespace WrtDB { -bool GlobalDAOReadOnly::GetDeveloperMode() -{ - LogDebug("Getting Developer mode"); - Try { - using namespace DPL::DB::ORM; - using namespace DPL::DB::ORM::wrt; - WRT_DB_SELECT(select, GlobalProperties, &WrtDatabase::interface()) - return select->GetSingleValue(); - } - Catch(DPL::DB::SqlConnection::Exception::Base){ - ReThrowMsg(GlobalDAOReadOnly::Exception::DatabaseError, - "Failed to get developer mode"); - } -} bool GlobalDAOReadOnly::GetSecureByDefault() { diff --git a/modules/widget_dao/include/dpl/wrt-dao-ro/global_dao_read_only.h b/modules/widget_dao/include/dpl/wrt-dao-ro/global_dao_read_only.h index f5eab4e..bc805a7 100644 --- a/modules/widget_dao/include/dpl/wrt-dao-ro/global_dao_read_only.h +++ b/modules/widget_dao/include/dpl/wrt-dao-ro/global_dao_read_only.h @@ -57,8 +57,6 @@ class GlobalDAOReadOnly static bool IsValidSubTag(const DPL::String& tag, int type); - static bool GetDeveloperMode(); - static bool GetSecureByDefault(); static bool getComplianceMode(); diff --git a/modules/widget_dao/include/dpl/wrt-dao-rw/global_dao.h b/modules/widget_dao/include/dpl/wrt-dao-rw/global_dao.h index 21b66fe..5522306 100644 --- a/modules/widget_dao/include/dpl/wrt-dao-rw/global_dao.h +++ b/modules/widget_dao/include/dpl/wrt-dao-rw/global_dao.h @@ -29,8 +29,6 @@ namespace WrtDB { class GlobalDAO : public GlobalDAOReadOnly { public: - static void SetDeveloperMode(bool mode); - static void SetSecureByDefault(bool secureByDefault); static void setComplianceMode(bool mode); diff --git a/modules/widget_dao/orm/wrt_db b/modules/widget_dao/orm/wrt_db index 86103e4..d4c747b 100644 --- a/modules/widget_dao/orm/wrt_db +++ b/modules/widget_dao/orm/wrt_db @@ -4,7 +4,6 @@ SQL( ) /*TODO: secure_by_default should be 0 by default*/ CREATE_TABLE(GlobalProperties) - COLUMN_NOT_NULL(developer_mode, INT, DEFAULT 0) COLUMN_NOT_NULL(secure_by_default, INT, DEFAULT 1) COLUMN_NOT_NULL(home_network_data_usage, TINYINT, DEFAULT 1) COLUMN_NOT_NULL(roaming_data_usage, TINYINT, DEFAULT 1) diff --git a/tests/dao/TestCases_GlobalDAO.cpp b/tests/dao/TestCases_GlobalDAO.cpp index 65cb9e0..ff182af 100644 --- a/tests/dao/TestCases_GlobalDAO.cpp +++ b/tests/dao/TestCases_GlobalDAO.cpp @@ -39,22 +39,6 @@ const DPL::String widgetPackage5(L"widgetpackage5"); RUNNER_TEST_GROUP_INIT(DAO) /* - * Name: global_dao_developer_mode - * Description: tests if developer mode is correctly set and get - * Expected: received developer shoudl match the one was set - */ -RUNNER_TEST(global_dao_developer_mode) -{ - bool prev_mode = GlobalDAO::GetDeveloperMode(); - GlobalDAO::SetDeveloperMode(false); - RUNNER_ASSERT_MSG(!GlobalDAO::GetDeveloperMode(), "set false failed"); - - GlobalDAO::SetDeveloperMode(true); - RUNNER_ASSERT_MSG(GlobalDAO::GetDeveloperMode(), "set true failed"); - GlobalDAO::SetDeveloperMode(prev_mode); -} - -/* * Name: home_network_data_usage * Description: tests if HomeNetworkDataUsage is correctly set and get * Expected: received developer shoudl match the one was set -- 2.7.4