return paramsList <= other.paramsList;
}
+bool ConfigParserData::Privilege::operator==(const Privilege& other) const
+{
+ return name == other.name;
+}
+
+bool ConfigParserData::Privilege::operator!=(const Privilege& other) const
+{
+ return name != other.name;
+}
+
+bool ConfigParserData::Privilege::operator >(const Privilege& other) const
+{
+ return name > other.name;
+}
+
+bool ConfigParserData::Privilege::operator>=(const Privilege& other) const
+{
+ return name >= other.name;
+}
+
+bool ConfigParserData::Privilege::operator <(const Privilege& other) const
+{
+ return name < other.name;
+}
+
+bool ConfigParserData::Privilege::operator<=(const Privilege& other) const
+{
+ return name < other.name;
+}
+
bool ConfigParserData::Icon::operator==(const Icon& other) const
{
return src == other.src;
registerWidgetFeatures(widgetHandle, widgetRegInfo);
+ registerWidgetPrivilege(widgetHandle, widgetRegInfo);
+
registerWidgetWindowModes(widgetHandle, widgetRegInfo);
registerWidgetWarpInfo(widgetHandle, widgetRegInfo);
}
}
+void WidgetDAO::registerWidgetPrivilege(DbWidgetHandle widgetHandle,
+ const WidgetRegisterInfo ®Info)
+{
+ using namespace DPL::DB::ORM;
+ const ConfigParserData& widgetConfigurationInfo = regInfo.configInfo;
+
+ FOREACH(it, widgetConfigurationInfo.privilegeList)
+ {
+ wrt::WidgetPrivilege::Row widgetPrivilege;
+ widgetPrivilege.Set_app_id(widgetHandle);
+ widgetPrivilege.Set_name(it->name);
+
+ DO_INSERT(widgetPrivilege, wrt::WidgetPrivilege)
+ }
+}
+
void WidgetDAO::updateFeatureRejectStatus(const DbWidgetFeature &widgetFeature){
// This function could be merged with registerWidgetFeature but it requires desing change:
// 1. Check "ace step" in installer must be done before "update database step"
};
typedef std::set<Feature> FeaturesList;
+ struct Privilege
+ {
+ Privilege(const DPL::String& _name) : name(_name)
+ {
+ }
+ DPL::String name;
+
+ bool operator==(const Privilege&) const;
+ bool operator!=(const Privilege&) const;
+ bool operator >(const Privilege&) const;
+ bool operator>=(const Privilege&) const;
+ bool operator <(const Privilege&) const;
+ bool operator<=(const Privilege&) const;
+ };
+ typedef std::set<Privilege> PrivilegeList;
+
struct Icon
{
Icon(const DPL::String& _src) : src(_src)
DPL::OptionalString authorEmail;
FeaturesList featuresList;
+ PrivilegeList privilegeList;
SettingsList settingsList;
static void registerWidgetFeatures(
DbWidgetHandle widgetHandle,
const WidgetRegisterInfo ®Info);
+ static void registerWidgetPrivilege(
+ DbWidgetHandle widgetHandle,
+ const WidgetRegisterInfo ®Info);
static void registerWidgetWindowModes(
DbWidgetHandle widgetHandle,
const WidgetRegisterInfo ®Info);
COLUMN_NOT_NULL(widget_feature_id, INTEGER,)
COLUMN_NOT_NULL(name, TEXT,)
COLUMN_NOT_NULL(value, TEXT,)
-
TABLE_CONSTRAINTS(
FOREIGN KEY (widget_feature_id) REFERENCES WidgetFeature (widget_feature_id) ON DELETE CASCADE
)
CREATE_TABLE_END()
+CREATE_TABLE(WidgetPrivilege)
+ COLUMN_NOT_NULL(widget_privilege_id, INTEGER, primary key autoincrement)
+ COLUMN_NOT_NULL(app_id, INT,)
+ COLUMN_NOT_NULL(name, VARCHAR(256),)
+ TABLE_CONSTRAINTS(
+ FOREIGN KEY (app_id) REFERENCES WidgetInfo (app_id) ON DELETE CASCADE
+ )
+CREATE_TABLE_END()
+
CREATE_TABLE(WidgetIcon)
COLUMN_NOT_NULL(icon_id, INTEGER, primary key autoincrement)
COLUMN_NOT_NULL(app_id, INT,)