summaryrefslogtreecommitdiff
path: root/pkgmgr_livebox/src/service_register.c
diff options
context:
space:
mode:
Diffstat (limited to 'pkgmgr_livebox/src/service_register.c')
-rw-r--r--pkgmgr_livebox/src/service_register.c42
1 files changed, 39 insertions, 3 deletions
diff --git a/pkgmgr_livebox/src/service_register.c b/pkgmgr_livebox/src/service_register.c
index baefb2a..21691f0 100644
--- a/pkgmgr_livebox/src/service_register.c
+++ b/pkgmgr_livebox/src/service_register.c
@@ -1732,6 +1732,7 @@ static inline void update_box(struct livebox *livebox, xmlNodePtr node)
for (node = node->children; node; node = node->next) {
if (!xmlStrcasecmp(node->name, (const xmlChar *)"size")) {
xmlChar *size;
+ int is_easy = 0;
size = xmlNodeGetContent(node);
if (!size) {
@@ -1739,10 +1740,45 @@ static inline void update_box(struct livebox *livebox, xmlNodePtr node)
continue;
}
+ if (xmlHasProp(node, (const xmlChar *)"mode")) {
+ xmlChar *mode;
+ mode = xmlGetProp(node, (const xmlChar *)"mode");
+ if (mode) {
+ DbgPrint("Easy mode: %s\n", mode);
+ is_easy = !xmlStrcasecmp(mode, (const xmlChar *)"easy");
+ xmlFree(mode);
+ }
+ }
+
if (!xmlStrcasecmp(size, (const xmlChar *)"1x1")) {
- livebox->size_list |= LB_SIZE_TYPE_1x1;
- if (xmlHasProp(node, (const xmlChar *)"preview")) {
- livebox->preview[0] = xmlGetProp(node, (const xmlChar *)"preview");
+ if (is_easy) {
+ livebox->size_list |= LB_SIZE_TYPE_EASY_1x1;
+ if (xmlHasProp(node, (const xmlChar *)"preview")) {
+ livebox->preview[7] = xmlGetProp(node, (const xmlChar *)"preview");
+ }
+ } else {
+ livebox->size_list |= LB_SIZE_TYPE_1x1;
+ if (xmlHasProp(node, (const xmlChar *)"preview")) {
+ livebox->preview[0] = xmlGetProp(node, (const xmlChar *)"preview");
+ }
+ }
+ } else if (!xmlStrcasecmp(size, (const xmlChar *)"3x1")) {
+ if (is_easy) {
+ livebox->size_list |= LB_SIZE_TYPE_EASY_3x1;
+ if (xmlHasProp(node, (const xmlChar *)"preview")) {
+ livebox->preview[8] = xmlGetProp(node, (const xmlChar *)"preview");
+ }
+ } else {
+ ErrPrint("Invalid size tag (%s)\n", size);
+ }
+ } else if (!xmlStrcasecmp(size, (const xmlChar *)"3x3")) {
+ if (is_easy) {
+ livebox->size_list |= LB_SIZE_TYPE_EASY_3x3;
+ if (xmlHasProp(node, (const xmlChar *)"preview")) {
+ livebox->preview[9] = xmlGetProp(node, (const xmlChar *)"preview");
+ }
+ } else {
+ ErrPrint("Invalid size tag (%s)\n", size);
}
} else if (!xmlStrcasecmp(size, (const xmlChar *)"2x1")) {
livebox->size_list |= LB_SIZE_TYPE_2x1;