summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Zaoui <daniel.zaoui@yahoo.com>2016-03-02 13:28:26 +0200
committerDaniel Zaoui <daniel.zaoui@yahoo.com>2016-03-02 13:28:26 +0200
commit4ac3b30d046b43c7c4dca763e5dfb1efbaeae702 (patch)
tree0dbd122b373c125ce132486022ae84aa03f73a53
parentd3641da8ad0338f7ed9cca81f7d160e398c6b332 (diff)
Check object class and not parent class for items
If the item parent is not specified, the ctor function can not be resolved. This can happen for items created during callback.
-rw-r--r--src/lib/ea_json_parser.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lib/ea_json_parser.c b/src/lib/ea_json_parser.c
index a8a5d9d..5614645 100644
--- a/src/lib/ea_json_parser.c
+++ b/src/lib/ea_json_parser.c
@@ -599,19 +599,19 @@ _json_parse(Ea_Session *ea_session, const char *buffer)
599 jobj = JSON_GET(jwdg, "Desc", "item"); 599 jobj = JSON_GET(jwdg, "Desc", "item");
600 if (jobj) 600 if (jobj)
601 { 601 {
602 const Eolian_Class *kl = ea_object_class_get(ea_object_parent_get(ea_obj)); 602 const Eolian_Class *kl = ea_object_class_get(ea_obj);
603 Ea *ea_func = NULL; 603 Ea *ea_func = NULL;
604 if (_class_is_of_type(kl, "Naviframe")) 604 if (_class_is_of_type(kl, "Naviframe_Item"))
605 { 605 {
606 if (!_nv_item_push_function) _nv_item_push_function = _find_function_by_full_name("Elm.Naviframe.item_push"); 606 if (!_nv_item_push_function) _nv_item_push_function = _find_function_by_full_name("Elm.Naviframe.item_push");
607 ea_func = _function_parse(ea_session, _nv_item_push_function, jobj); 607 ea_func = _function_parse(ea_session, _nv_item_push_function, jobj);
608 } 608 }
609 else if (_class_is_of_type(kl, "Toolbar")) 609 else if (_class_is_of_type(kl, "Toolbar_Item"))
610 { 610 {
611 if (!_tb_item_add_function) _tb_item_add_function = _find_function_by_full_name("Elm.Toolbar.item_append"); 611 if (!_tb_item_add_function) _tb_item_add_function = _find_function_by_full_name("Elm.Toolbar.item_append");
612 ea_func = _function_parse(ea_session, _tb_item_add_function, jobj); 612 ea_func = _function_parse(ea_session, _tb_item_add_function, jobj);
613 } 613 }
614 else if (_class_is_of_type(kl, "Hoversel")) 614 else if (_class_is_of_type(kl, "Hoversel_Item"))
615 { 615 {
616 if (!_hs_item_add_function) _hs_item_add_function = _find_function_by_full_name("Elm.Hoversel.item_add"); 616 if (!_hs_item_add_function) _hs_item_add_function = _find_function_by_full_name("Elm.Hoversel.item_add");
617 ea_func = _function_parse(ea_session, _hs_item_add_function, jobj); 617 ea_func = _function_parse(ea_session, _hs_item_add_function, jobj);