summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLarry Jr <larry.olj@gmail.com>2015-05-25 20:28:55 -0300
committerLarry Jr <larry.olj@gmail.com>2015-05-25 20:28:55 -0300
commitf8b1b3b24408b60fc45ce44f764763156ad49c27 (patch)
treee171e87e4f6ba6d7302b07e383bc7d6529becf9b
parent4722bdc527ecdaf793b104fc62dea7b30080e523 (diff)
corrected table loading incorrect statusdevs/felipealmeida/esqlmodel
-rw-r--r--src/lib/Makefile.mk5
-rw-r--r--src/lib/esql_model_row.c4
-rw-r--r--src/lib/esql_model_table.c13
3 files changed, 13 insertions, 9 deletions
diff --git a/src/lib/Makefile.mk b/src/lib/Makefile.mk
index 6d96779..7a90048 100644
--- a/src/lib/Makefile.mk
+++ b/src/lib/Makefile.mk
@@ -96,10 +96,7 @@ src/lib/Esql_Model.hh: $(generated_esql_cxx_bindings)
96 @echo @ECHO_E@ "#endif\n\n#endif\n" >> $(top_builddir)/src/lib/Esql_Model.hh 96 @echo @ECHO_E@ "#endif\n\n#endif\n" >> $(top_builddir)/src/lib/Esql_Model.hh
97 97
98generated_esql_cxx_all = $(generated_esql_cxx_bindings) \ 98generated_esql_cxx_all = $(generated_esql_cxx_bindings) \
99 src/lib/Esql_Model.hh \ 99 src/lib/Esql_Model.hh
100 src/lib/esql_model_database.eo.impl.hh \
101 src/lib/esql_model_row.eo.impl.hh \
102 src/lib/esql_model_table.eo.impl.hh
103 100
104CLEANFILES += \ 101CLEANFILES += \
105$(generated_esql_cxx_all) 102$(generated_esql_cxx_all)
diff --git a/src/lib/esql_model_row.c b/src/lib/esql_model_row.c
index b52b2ee..4594ef3 100644
--- a/src/lib/esql_model_row.c
+++ b/src/lib/esql_model_row.c
@@ -721,7 +721,9 @@ _esql_model_row_efl_model_base_property_get(Eo *obj EINA_UNUSED,
721 return EFL_MODEL_LOAD_STATUS_ERROR; 721 return EFL_MODEL_LOAD_STATUS_ERROR;
722 722
723 *value = eina_hash_find(pd->properties_hash, property); 723 *value = eina_hash_find(pd->properties_hash, property);
724 EINA_SAFETY_ON_NULL_RETURN_VAL(*value, EFL_MODEL_LOAD_STATUS_ERROR); 724 if (value == NULL)
725 return EFL_MODEL_LOAD_STATUS_ERROR;
726 //EINA_SAFETY_ON_NULL_RETURN_VAL(*value, EFL_MODEL_LOAD_STATUS_ERROR);
725 727
726 return pd->load.status; 728 return pd->load.status;
727} 729}
diff --git a/src/lib/esql_model_table.c b/src/lib/esql_model_table.c
index eab8565..981059e 100644
--- a/src/lib/esql_model_table.c
+++ b/src/lib/esql_model_table.c
@@ -108,15 +108,18 @@ _esql_model_table_load(Esql_Model_Table_Data *pd)
108 DBG("(%p)", pd->obj); 108 DBG("(%p)", pd->obj);
109 if (!pd->metadata) 109 if (!pd->metadata)
110 { 110 {
111 if (_esql_model_table_metadata_load(pd, _esql_model_table_load)) 111 _esql_model_table_metadata_load(pd, _esql_model_table_load);
112 _esql_model_load_set(pd->obj, &pd->load, EFL_MODEL_LOAD_STATUS_LOADING);
113 return; 112 return;
114 } 113 }
115 114
116 if (!(pd->load.status & EFL_MODEL_LOAD_STATUS_LOADED_PROPERTIES)) 115 if (!(pd->load.status & EFL_MODEL_LOAD_STATUS_LOADED_PROPERTIES))
117 _esql_model_table_properties_load(pd); 116 _esql_model_table_properties_load(pd);
118 if (!(pd->load.status & EFL_MODEL_LOAD_STATUS_LOADED_CHILDREN)) 117
118 if ((!(pd->load.status & EFL_MODEL_LOAD_STATUS_LOADED_CHILDREN)) &&
119 (!(pd->load.status & EFL_MODEL_LOAD_STATUS_LOADING_CHILDREN)))
120 {
119 _esql_model_table_children_load(pd); 121 _esql_model_table_children_load(pd);
122 }
120} 123}
121 124
122static void 125static void
@@ -482,6 +485,7 @@ _esql_model_table_constructor(Eo *obj,
482 pd->pending_callbacks = NULL; 485 pd->pending_callbacks = NULL;
483 pd->metadata = NULL; 486 pd->metadata = NULL;
484 487
488 pd->load.status = 0;
485 _esql_model_load_set(pd->obj, &pd->load, EFL_MODEL_LOAD_STATUS_UNLOADED); 489 _esql_model_load_set(pd->obj, &pd->load, EFL_MODEL_LOAD_STATUS_UNLOADED);
486} 490}
487 491
@@ -886,7 +890,8 @@ _esql_model_table_filter_set(Eo *obj EINA_UNUSED, Esql_Model_Table_Data *pd, con
886 if (filter_str && strlen(filter_str) > 0) 890 if (filter_str && strlen(filter_str) > 0)
887 pd->filter = eina_stringshare_add(filter_str); 891 pd->filter = eina_stringshare_add(filter_str);
888 892
889 _esql_model_table_children_load(pd); 893 if ((pd->load.status & EFL_MODEL_LOAD_STATUS_LOADED_CHILDREN))
894 _esql_model_table_children_load(pd);
890} 895}
891 896
892static bool 897static bool