From 694e1ce4e53b72edc9fc6507d5550e6e32cdf29e Mon Sep 17 00:00:00 2001 From: Soyoung Kim Date: Fri, 30 Nov 2012 17:37:22 +0900 Subject: [PATCH] Revert "Pkgname (tizen id) - not null" This reverts commit 1800f55be353602203725d82c392f5af0c98e3c8. --- .../dao/security_origin_dao.cpp | 4 ++-- modules/widget_dao/dao/widget_dao.cpp | 24 ------------------- modules/widget_dao/dao/widget_dao_read_only.cpp | 27 ++++------------------ .../include/dpl/wrt-dao-ro/common_dao_types.h | 2 -- .../include/dpl/wrt-dao-ro/widget_dao_read_only.h | 7 +----- .../widget_dao/include/dpl/wrt-dao-rw/widget_dao.h | 2 -- modules/widget_dao/orm/wrt_db | 1 - 7 files changed, 7 insertions(+), 60 deletions(-) diff --git a/modules/security_origin_dao/dao/security_origin_dao.cpp b/modules/security_origin_dao/dao/security_origin_dao.cpp index d6df4f0..c1bb112 100644 --- a/modules/security_origin_dao/dao/security_origin_dao.cpp +++ b/modules/security_origin_dao/dao/security_origin_dao.cpp @@ -65,9 +65,9 @@ std::string createDatabasePath(int widgetHandle) { std::stringstream filename; WrtDB::WidgetDAOReadOnly widgetDAO(widgetHandle); - DPL::String pkgname = widgetDAO.getPkgname_NOTNULL(); + DPL::Optional pkgname = widgetDAO.getPkgname(); - filename << GetWidgetPersistentStoragePath(pkgname) + filename << GetWidgetPersistentStoragePath(*pkgname) << "/" << SECURITY_ORIGIN_DB_NAME; return filename.str(); diff --git a/modules/widget_dao/dao/widget_dao.cpp b/modules/widget_dao/dao/widget_dao.cpp index 9327806..d46f378 100644 --- a/modules/widget_dao/dao/widget_dao.cpp +++ b/modules/widget_dao/dao/widget_dao.cpp @@ -53,7 +53,6 @@ namespace WrtDB { WidgetDAO::WidgetDAO(DPL::OptionalString widgetGUID) : WidgetDAOReadOnly(WidgetDAOReadOnly::getHandle(widgetGUID)) -// TODO THIS WILL BE DELETED { } @@ -120,29 +119,6 @@ void WidgetDAO::setPkgName(const DPL::OptionalString& pkgName) SQL_CONNECTION_EXCEPTION_HANDLER_END("Failed to register widget") } -void WidgetDAO::setPkgName_NOTNULL(const DPL::String& pkgName) -{ - SQL_CONNECTION_EXCEPTION_HANDLER_BEGIN - { - using namespace DPL::DB::ORM; - wrt::ScopedTransaction transaction(&WrtDatabase::interface()); - - isWidgetInstalled(getHandle()); - - wrt::WidgetInfo::Row row; - row.Set_pkgname(pkgName); - - WRT_DB_UPDATE(update, wrt::WidgetInfo, &WrtDatabase::interface()) - update->Where( - Equals(getHandle())); - - update->Values(row); - update->Execute(); - transaction.Commit(); - } - SQL_CONNECTION_EXCEPTION_HANDLER_END("Failed to register widget") -} - void WidgetDAO::setSecurityPopupUsage(const SettingsType value) { SQL_CONNECTION_EXCEPTION_HANDLER_BEGIN diff --git a/modules/widget_dao/dao/widget_dao_read_only.cpp b/modules/widget_dao/dao/widget_dao_read_only.cpp index b23eaa6..0d52aae 100644 --- a/modules/widget_dao/dao/widget_dao_read_only.cpp +++ b/modules/widget_dao/dao/widget_dao_read_only.cpp @@ -383,19 +383,6 @@ WidgetPkgNameList WidgetDAOReadOnly::getPkgnameList() SQL_CONNECTION_EXCEPTION_HANDLER_END("Failed to get Pkgname list") } -WidgetPkgNameList_NOTNULL WidgetDAOReadOnly::getPkgnameList_NOTNULL() -{ - LogDebug("Getting Pkgname List"); - SQL_CONNECTION_EXCEPTION_HANDLER_BEGIN - { - using namespace DPL::DB::ORM; - using namespace DPL::DB::ORM::wrt; - WRT_DB_SELECT(select, WidgetInfo, &WrtDatabase::interface()) - return select->GetValueList(); - } - SQL_CONNECTION_EXCEPTION_HANDLER_END("Failed to get Pkgname list") -} - DbWidgetDAOReadOnlyList WidgetDAOReadOnly::getWidgetList() { LogDebug("Getting DbWidget List"); @@ -506,12 +493,6 @@ DPL::OptionalString WidgetDAOReadOnly::getPkgname() const return row.Get_pkgname(); } -DPL::String WidgetDAOReadOnly::getPkgname_NOTNULL() const -{ - WidgetInfoRow row = getWidgetInfoRow(m_widgetHandle); - return *row.Get_pkgname(); -} - DPL::OptionalString WidgetDAOReadOnly::getDefaultlocale() const { WidgetInfoRow row = getWidgetInfoRow(m_widgetHandle); @@ -985,9 +966,9 @@ std::string WidgetDAOReadOnly::getCookieDatabasePath() const using namespace WrtDB::WidgetConfig; std::ostringstream path; - DPL::String pkgname = getPkgname_NOTNULL(); + DPL::OptionalString pkgname = getPkgname(); - path << GetWidgetPersistentStoragePath(pkgname); + path << GetWidgetPersistentStoragePath(*pkgname); path << "/"; path << GlobalConfig::GetCookieDatabaseFile(); @@ -997,8 +978,8 @@ std::string WidgetDAOReadOnly::getCookieDatabasePath() const std::string WidgetDAOReadOnly::getPrivateLocalStoragePath() const { std::ostringstream path; - DPL::String pkgname = getPkgname_NOTNULL(); - path << WidgetConfig::GetWidgetWebLocalStoragePath(pkgname); + DPL::OptionalString pkgname = getPkgname(); + path << WidgetConfig::GetWidgetWebLocalStoragePath(*pkgname); path << "/"; return path.str(); diff --git a/modules/widget_dao/include/dpl/wrt-dao-ro/common_dao_types.h b/modules/widget_dao/include/dpl/wrt-dao-ro/common_dao_types.h index 6b69d17..c40e396 100644 --- a/modules/widget_dao/include/dpl/wrt-dao-ro/common_dao_types.h +++ b/modules/widget_dao/include/dpl/wrt-dao-ro/common_dao_types.h @@ -238,8 +238,6 @@ typedef std::list DbWidgetHandleList; typedef std::list > WidgetPkgNameList; //TODO: this cannot be null -> appropriate changes in db schema needed -typedef std::list WidgetPkgNameList_NOTNULL; //TODO: this cannot be null -> appropriate changes in db schema needed - class WidgetDAOReadOnly; //forward declaration typedef std::shared_ptr WidgetDAOReadOnlyPtr; /** diff --git a/modules/widget_dao/include/dpl/wrt-dao-ro/widget_dao_read_only.h b/modules/widget_dao/include/dpl/wrt-dao-ro/widget_dao_read_only.h index d427ce1..3d33b89 100644 --- a/modules/widget_dao/include/dpl/wrt-dao-ro/widget_dao_read_only.h +++ b/modules/widget_dao/include/dpl/wrt-dao-ro/widget_dao_read_only.h @@ -175,10 +175,7 @@ struct WidgetRegisterInfo int isTestWidget; ConfigParserData configInfo; LocalizationData localizationData; - DPL::OptionalString pkgname; - DPL::String pkgname_NOTNULL; - time_t installedTime; PackagingType packagingType; EncryptedFileList encryptedFiles; @@ -369,8 +366,6 @@ class WidgetDAOReadOnly */ DPL::OptionalString getPkgname() const; - DPL::String getPkgname_NOTNULL() const; - /** * This method returns the defaultlocale for the widget. * @@ -564,7 +559,6 @@ class WidgetDAOReadOnly * @return list of pkgname of installed packages */ static WidgetPkgNameList getPkgnameList(); - static WidgetPkgNameList_NOTNULL getPkgnameList_NOTNULL(); /** * This method returns a list of all the installed widgets. @@ -575,6 +569,7 @@ class WidgetDAOReadOnly * DB table. */ static DbWidgetDAOReadOnlyList getWidgetList(); + /** * This method removes a widget's information from EmDB. * diff --git a/modules/widget_dao/include/dpl/wrt-dao-rw/widget_dao.h b/modules/widget_dao/include/dpl/wrt-dao-rw/widget_dao.h index 9888852..44b9d1b 100644 --- a/modules/widget_dao/include/dpl/wrt-dao-rw/widget_dao.h +++ b/modules/widget_dao/include/dpl/wrt-dao-rw/widget_dao.h @@ -134,8 +134,6 @@ class WidgetDAO : public WidgetDAOReadOnly */ void setPkgName(const DPL::OptionalString& pkgName); - void setPkgName_NOTNULL(const DPL::String& pkgName); - /* This function will update of api-feature status. * If status is true (feature rejected) plugin connected with this * api feature mustn't be loaded durign widget launch. diff --git a/modules/widget_dao/orm/wrt_db b/modules/widget_dao/orm/wrt_db index 9167222..56c93a0 100644 --- a/modules/widget_dao/orm/wrt_db +++ b/modules/widget_dao/orm/wrt_db @@ -39,7 +39,6 @@ CREATE_TABLE(WidgetInfo) COLUMN(access_network, TINYINT, DEFAULT 0) COLUMN(defaultlocale, VARCHAR(256), DEFAULT 0) COLUMN(pkgname, VARCHAR(256), DEFAULT 0 UNIQUE) - COLUMN_NOT_NULL(pkgname_NOTNULL,VARCHAR(256), DEFAULT 0 UNIQUE) COLUMN(pkg_type, INT, DEFAULT 0) CREATE_TABLE_END() -- 2.7.4