const char** data_array = appsvc_get_data_array(app_control_bundle_,
key.c_str(), &data_array_len);
std::vector<std::string> data_vector;
-
- if (data_array_len > 0) {
- for (int i = 0; i < data_array_len; i++) {
- data_vector.push_back(data_array[i]);
+ if (data_array) { // checking whether the 'data_array' is valid
+ if (data_array_len > 0) {
+ for (int i = 0; i < data_array_len; i++) {
+ data_vector.push_back(data_array[i]);
+ }
}
}
return data_vector;
ResourceManager::ResourceManager(ApplicationData* application_data,
LocaleManager* locale_manager)
- : application_data_(application_data), locale_manager_(locale_manager) {
+ : application_data_(application_data),
+ locale_manager_(locale_manager),
+ security_model_version_(0) {
if (application_data != NULL) {
appid_ = application_data->tizen_application_info()->id();
if (application_data->csp_info() != NULL ||
std::string src;
std::string type;
std::string encoding = kDefaultEncoding;
- auto content_info = application_data_->content_info();
- if (content_info) {
- src = content_info->src();
- type = content_info->type();
- encoding = content_info->encoding();
- LOGGER(DEBUG) << "src: " << src;
- LOGGER(DEBUG) << "type: " << type;
- LOGGER(DEBUG) << "encoding: " << encoding;
- } else {
- LOGGER(DEBUG) << "content_info is null";
+
+ std::shared_ptr<const wgt::parse::ContentInfo> content_info;
+ if (application_data_) {
+ content_info.reset(application_data_->content_info());
+ if (content_info) {
+ src = content_info->src();
+ type = content_info->type();
+ encoding = content_info->encoding();
+ LOGGER(DEBUG) << "src: " << src;
+ LOGGER(DEBUG) << "type: " << type;
+ LOGGER(DEBUG) << "encoding: " << encoding;
+ } else {
+ LOGGER(DEBUG) << "content_info is null";
+ }
}
// Check that tizen:content src is external page
// Read filesize
fseek(src, 0, SEEK_END);
- size_t src_len = ftell(src);
+
+ size_t src_len = 0;
+ int ret = ftell(src);
+ if (ret < 0) {
+ LOGGER(ERROR) << "Cannot get filesize of " << src_path;
+ return path;
+ } else {
+ src_len = static_cast<size_t>(ret);
+ }
+
if (src_len == 0) {
// if the file exists and is empty, bypass it
fclose(src);
return &instance;
}
-WidgetPreferenceDB::WidgetPreferenceDB() {
+WidgetPreferenceDB::WidgetPreferenceDB()
+ : appdata_(nullptr),
+ locale_manager_(nullptr) {
}
WidgetPreferenceDB::~WidgetPreferenceDB() {
}
enable_button_ = true;
switch (type) {
case ButtonType::OkButton:
- button1_ = AddButton(this, popup_string::kPopupButtonOk,
- kContentButton1);
- break;
+ button1_ = AddButton(this, popup_string::kPopupButtonOk,
+ kContentButton1);
+ break;
case ButtonType::OkCancelButton:
- button1_ = AddButton(this, popup_string::kPopupButtonCancel,
- kContentButton1);
- button2_ = AddButton(this, popup_string::kPopupButtonOk,
- kContentButton2);
+ button1_ = AddButton(this, popup_string::kPopupButtonCancel,
+ kContentButton1);
+ button2_ = AddButton(this, popup_string::kPopupButtonOk,
+ kContentButton2);
+ break;
case ButtonType::LoginCancelButton:
- button1_ = AddButton(this, popup_string::kPopupButtonCancel,
- kContentButton1);
- button2_ = AddButton(this, popup_string::kPopupButtonLogin,
- kContentButton2);
- break;
+ button1_ = AddButton(this, popup_string::kPopupButtonCancel,
+ kContentButton1);
+ button2_ = AddButton(this, popup_string::kPopupButtonLogin,
+ kContentButton2);
+ break;
case ButtonType::AllowDenyButton:
- button1_ = AddButton(this, popup_string::kPopupButtonDeny,
- kContentButton1);
- button2_ = AddButton(this, popup_string::kPopupButtonAllow,
- kContentButton2);
- break;
+ button1_ = AddButton(this, popup_string::kPopupButtonDeny,
+ kContentButton1);
+ button2_ = AddButton(this, popup_string::kPopupButtonAllow,
+ kContentButton2);
+ break;
}
}
runtime::NativeWindow* window,
std::shared_ptr<const wgt::parse::SplashScreenInfo> ss_info,
const std::string& app_path)
- : window_(window),
- ss_info_(ss_info),
+ : ss_info_(ss_info),
+ window_(window),
image_(nullptr),
background_(nullptr),
+ background_image_(nullptr),
is_active_(false) {
LOGGER(DEBUG) << "start of create splash screen";
if (ss_info == nullptr) return;
context_(context),
ewk_view_(NULL),
listener_(NULL),
+ rotation_handler_id_(0),
view_(view),
fullscreen_(false),
evas_smart_class_(NULL),