From eb0600cbd18d3a4f74326359da81515347c9cf87 Mon Sep 17 00:00:00 2001 From: Andrzej Surdej Date: Thu, 21 Feb 2013 11:33:43 +0100 Subject: [PATCH] Prepare database for additional appservice parameter [Issue#] LINUXWRT-58 [Problem] N/A [Cause] N/A [Solution] N/A [Verification] To verify build repo. Change-Id: I1efe3251c6df8de11959b0a7503622e05aea94c2 --- modules/widget_dao/dao/config_parser_data.cpp | 6 ++++-- modules/widget_dao/dao/widget_dao.cpp | 1 + modules/widget_dao/dao/widget_dao_read_only.cpp | 1 + .../include/dpl/wrt-dao-ro/common_dao_types.h | 10 ++++++++-- .../include/dpl/wrt-dao-ro/config_parser_data.h | 11 +++++++++-- modules/widget_dao/orm/wrt_db | 17 +++++++++-------- 6 files changed, 32 insertions(+), 14 deletions(-) diff --git a/modules/widget_dao/dao/config_parser_data.cpp b/modules/widget_dao/dao/config_parser_data.cpp index eccbe40..cc5253a 100644 --- a/modules/widget_dao/dao/config_parser_data.cpp +++ b/modules/widget_dao/dao/config_parser_data.cpp @@ -451,7 +451,8 @@ bool ConfigParserData::ServiceInfo::operator== (const ServiceInfo& info) const return m_src == info.m_src && m_operation == info.m_operation && m_scheme == info.m_scheme && - m_mime == info.m_mime; + m_mime == info.m_mime && + m_disposition == info.m_disposition; } bool ConfigParserData::ServiceInfo::operator!= (const ServiceInfo& info) const @@ -459,7 +460,8 @@ bool ConfigParserData::ServiceInfo::operator!= (const ServiceInfo& info) const return m_src != info.m_src && m_operation != info.m_operation && m_scheme != info.m_scheme && - m_mime != info.m_mime; + m_mime != info.m_mime && + m_disposition != info.m_disposition; } bool ConfigParserData::LiveboxInfo::operator==(const LiveboxInfo& other) const diff --git a/modules/widget_dao/dao/widget_dao.cpp b/modules/widget_dao/dao/widget_dao.cpp index d67b408..86819ab 100644 --- a/modules/widget_dao/dao/widget_dao.cpp +++ b/modules/widget_dao/dao/widget_dao.cpp @@ -709,6 +709,7 @@ void WidgetDAO::registerAppService(DbWidgetHandle widgetHandle, row.Set_operation(ASIt->m_operation); row.Set_scheme(ASIt->m_scheme); row.Set_mime(ASIt->m_mime); + row.Set_disposition(static_cast(ASIt->m_disposition)); DO_INSERT(row, ApplicationServiceInfo) } diff --git a/modules/widget_dao/dao/widget_dao_read_only.cpp b/modules/widget_dao/dao/widget_dao_read_only.cpp index 5f7274b..b11158a 100644 --- a/modules/widget_dao/dao/widget_dao_read_only.cpp +++ b/modules/widget_dao/dao/widget_dao_read_only.cpp @@ -1129,6 +1129,7 @@ void WidgetDAOReadOnly::getAppServiceList( ret.operation = it->Get_operation(); ret.scheme = it->Get_scheme(); ret.mime = it->Get_mime(); + ret.disposition = static_cast(it->Get_disposition()); outAppServiceList.push_back(ret); } 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 ff30556..234ef6e 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 @@ -378,18 +378,24 @@ typedef std::list WidgetSettings; */ struct WidgetApplicationService { - public: + enum class Disposition { + WINDOW = 0, + INLINE + }; + DPL::String src; /* start uri */ DPL::String operation; /* service name */ DPL::String scheme; /* scheme type*/ DPL::String mime; /* mime type */ + Disposition disposition; bool operator== (const WidgetApplicationService& other) const { return src == other.src && operation == other.operation && scheme == other.scheme && - mime == other.mime; + mime == other.mime && + disposition == other.disposition; } }; diff --git a/modules/widget_dao/include/dpl/wrt-dao-ro/config_parser_data.h b/modules/widget_dao/include/dpl/wrt-dao-ro/config_parser_data.h index f56be55..5eb7f6e 100644 --- a/modules/widget_dao/include/dpl/wrt-dao-ro/config_parser_data.h +++ b/modules/widget_dao/include/dpl/wrt-dao-ro/config_parser_data.h @@ -181,20 +181,27 @@ class ConfigParserData */ struct ServiceInfo { + enum class Disposition { + WINDOW = 0, + INLINE + }; ServiceInfo( const DPL::String& src, const DPL::String& operation, const DPL::String& scheme, - const DPL::String& mime) : + const DPL::String& mime, + const Disposition dispos) : m_src(src), m_operation(operation), m_scheme(scheme), - m_mime(mime) + m_mime(mime), + m_disposition(dispos) {} DPL::String m_src; DPL::String m_operation; DPL::String m_scheme; DPL::String m_mime; + Disposition m_disposition; bool operator==(const ServiceInfo&) const; bool operator!=(const ServiceInfo&) const; diff --git a/modules/widget_dao/orm/wrt_db b/modules/widget_dao/orm/wrt_db index 9a41d5b..2aa4cd2 100755 --- a/modules/widget_dao/orm/wrt_db +++ b/modules/widget_dao/orm/wrt_db @@ -313,20 +313,21 @@ CREATE_TABLE(CRLResponseStorage) CREATE_TABLE_END() CREATE_TABLE(SettingsList) - COLUMN_NOT_NULL(appId, INT,) - COLUMN_NOT_NULL(settingName, TEXT, ) - COLUMN_NOT_NULL(settingValue, TEXT, ) + COLUMN_NOT_NULL(appId, INT,) + COLUMN_NOT_NULL(settingName, TEXT,) + COLUMN_NOT_NULL(settingValue, TEXT,) TABLE_CONSTRAINTS( FOREIGN KEY (appId) REFERENCES WidgetInfo (app_id) ON DELETE CASCADE ) CREATE_TABLE_END() CREATE_TABLE(ApplicationServiceInfo) - COLUMN_NOT_NULL(app_id, INT,) - COLUMN_NOT_NULL(src, TEXT,) - COLUMN_NOT_NULL(operation, TEXT,) - COLUMN_NOT_NULL(scheme, TEXT,) - COLUMN_NOT_NULL(mime, TEXT,) + COLUMN_NOT_NULL(app_id, INT,) + COLUMN_NOT_NULL(src, TEXT,) + COLUMN_NOT_NULL(operation, TEXT,) + COLUMN_NOT_NULL(scheme, TEXT,) + COLUMN_NOT_NULL(mime, TEXT,) + COLUMN_NOT_NULL(disposition, TINYINT, DEFAULT 0) TABLE_CONSTRAINTS( PRIMARY KEY(app_id, operation, scheme, mime) -- 2.7.4