aboutsummaryrefslogtreecommitdiffstats
path: root/src/examples
diff options
context:
space:
mode:
authorCedric BAIL <cedric.bail@free.fr>2018-11-23 16:25:19 +0000
committerCedric BAIL <cedric@osg.samsung.com>2018-11-23 10:13:58 -0800
commitd4d44d76f3efef4d61edb4cce7152284915a12d2 (patch)
tree502779c9047c6a8e02c8466f81ddc8616887fa50 /src/examples
parenteina: add tests for eina_multiple_iterator_new. (diff)
downloadefl-d4d44d76f3efef4d61edb4cce7152284915a12d2.tar.gz
efl: make Efl.Model.properties_get return an Iterator<string>.
Reviewed-by: Vitor Sousa da Silva <vitorsousa@expertisesolutions.com.br> Differential Revision: https://phab.enlightenment.org/D7289
Diffstat (limited to 'src/examples')
-rw-r--r--src/examples/eldbus/dbusmodel.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/examples/eldbus/dbusmodel.c b/src/examples/eldbus/dbusmodel.c
index 10150c40f2..cc09d79ae3 100644
--- a/src/examples/eldbus/dbusmodel.c
+++ b/src/examples/eldbus/dbusmodel.c
@@ -64,17 +64,16 @@ EFL_CALLBACKS_ARRAY_DEFINE(child_cbs,
static void
process(Eo *child, unsigned int index)
{
- Eina_Array *properties = efl_model_properties_get(child);
+ Eina_Iterator *properties = efl_model_properties_get(child);
const char *property;
- Eina_Array_Iterator it;
Eina_Strbuf *buf;
- unsigned int i;
+ Eina_Bool noproperties = EINA_TRUE;
buf = eina_strbuf_new();
const char *name = eldbus_model_proxy_name_get(child);
- EINA_ARRAY_ITER_NEXT(properties, i, property, it)
+ EINA_ITERATOR_FOREACH(properties, property)
{
Eina_Value *v = efl_model_property_get(child, property);
char *str;
@@ -90,16 +89,18 @@ process(Eo *child, unsigned int index)
free(str);
eina_value_free(v);
+
+ noproperties = EINA_FALSE;
}
+ eina_iterator_free(properties);
- if (eina_array_count(properties) <= 0)
+ if (noproperties)
eina_strbuf_append_printf(buf, " %2d: %s (no properties yet)\n", index, name);
else
eina_strbuf_prepend_printf(buf, " -> %s\n Properties:\n", name);
printf("%s", eina_strbuf_string_get(buf));
- eina_array_free(properties);
eina_strbuf_free(buf);
efl_ref(child);