summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsung-su.kim <sung-su.kim@samsung.com>2013-10-11 17:33:00 +0900
committersung-su.kim <sung-su.kim@samsung.com>2013-10-11 17:33:06 +0900
commit9f85ae041fb24f898779ffa0715602645b9bc694 (patch)
tree90c23d28631e131675e3669b306a895411b3cc81
parentcd0efd3e92ed0d7ac2e94e093b95eb296cc5a246 (diff)
parent19b7d73e092365980f2f21b28ae7029852d0869b (diff)
downloadweb-provider-9f85ae041fb24f898779ffa0715602645b9bc694.tar.gz
web-provider-9f85ae041fb24f898779ffa0715602645b9bc694.tar.bz2
web-provider-9f85ae041fb24f898779ffa0715602645b9bc694.zip
[Release] livebox.web-provider-1.59
Merge branch 'master' into tizen_2.2 Change-Id: I41e0fad0f67c070530047b77560ffdcc02dcbd4a
-rwxr-xr-xpackaging/livebox.web-provider.spec2
-rwxr-xr-xsrc/API/web_provider_plugin_info.cpp32
2 files changed, 22 insertions, 12 deletions
diff --git a/packaging/livebox.web-provider.spec b/packaging/livebox.web-provider.spec
index 3b07677..0a5aa5e 100755
--- a/packaging/livebox.web-provider.spec
+++ b/packaging/livebox.web-provider.spec
@@ -1,7 +1,7 @@
#git:framework/web/web-provider
Name: livebox.web-provider
Summary: web framework for livebox
-Version: 1.58
+Version: 1.59
Release: 1
Group: main/app
License: Flora License, Version 1.1
diff --git a/src/API/web_provider_plugin_info.cpp b/src/API/web_provider_plugin_info.cpp
index 1c3ee0f..373c95f 100755
--- a/src/API/web_provider_plugin_info.cpp
+++ b/src/API/web_provider_plugin_info.cpp
@@ -30,6 +30,7 @@
#include <glib-object.h>
#include <json-glib/json-glib.h>
#include <Core/Util/Log.h>
+#include "web_provider_livebox_info.h"
#include "web_provider_plugin_info.h"
#include <memory>
@@ -57,7 +58,7 @@ static const std::string jsonMemberBoxSize("supported_size");
static const std::string jsonValueBoolTrue("true");
static const std::string jsonValueBoolFalse("false");
static const std::string jsonFileExtension(".json");
-static const std::string mendatoryBoxSize("1x1");
+static const std::string mandatoryBoxSize("1x1");
web_provider_plugin_info** web_provider_plugin_get_installed_list(int* count)
{
@@ -289,8 +290,6 @@ bool web_provider_plugin_release_info(web_provider_plugin_info* info)
int web_provider_plugin_check_supported_size(
const char* plugin_type, char** size, int sizeCount)
{
- bool mendatoryChk = false;
-
// read plugin directory and store plugin config path
std::string configPath;
configPath = installedPluginDirPath;
@@ -304,25 +303,36 @@ int web_provider_plugin_check_supported_size(
return false;
}
+ // check if this type is default type
+ bool isDefaultType = false;
+ const char* defaultType = web_provider_livebox_get_default_type();
+ if (!defaultType) {
+ LogD("can't get default type");
+ return false;
+ }
+ if (!strcmp(plugin_type, defaultType)) {
+ isDefaultType = true;
+ }
+
// compare the parsed config data with the parsed json data
+ bool mandatoryCheck = false;
for (int configCnt = 0; configCnt < sizeCount; configCnt++) {
- bool supportedSizeChk = false;
-
+ bool supportedSizeCheck = false;
for (int jsonCnt = 0; jsonCnt < jsonData->box_size_count; jsonCnt++) {
- // check mendatory size
- if (!strcmp(mendatoryBoxSize.c_str(), size[configCnt])) {
- mendatoryChk = true;
+ // check mandatory size
+ if (isDefaultType && !strcmp(mandatoryBoxSize.c_str(), size[configCnt])) {
+ mandatoryCheck = true;
}
// check supported size
if (!strcmp(jsonData->box_size[jsonCnt], size[configCnt])) {
- supportedSizeChk = true;
+ supportedSizeCheck = true;
break;
}
}
- if (!supportedSizeChk) {
+ if (!supportedSizeCheck) {
LogD("Not supported size: %s", size[configCnt]);
web_provider_plugin_release_info(jsonData);
return false;
@@ -331,7 +341,7 @@ int web_provider_plugin_check_supported_size(
//release the jsonData
web_provider_plugin_release_info(jsonData);
- if (!mendatoryChk) {
+ if (isDefaultType && !mandatoryCheck) {
LogD("Mandatory members don't exist ");
return false;
}