summaryrefslogtreecommitdiff
path: root/src/examples/eldbus
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/eldbus
parentaac7d099a17d69f5989481f8999a43d4173005bd (diff)
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/eldbus')
-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 10150c4..cc09d79 100644
--- a/src/examples/eldbus/dbusmodel.c
+++ b/src/examples/eldbus/dbusmodel.c
@@ -64,17 +64,16 @@ EFL_CALLBACKS_ARRAY_DEFINE(child_cbs,
64static void 64static void
65process(Eo *child, unsigned int index) 65process(Eo *child, unsigned int index)
66{ 66{
67 Eina_Array *properties = efl_model_properties_get(child); 67 Eina_Iterator *properties = efl_model_properties_get(child);
68 const char *property; 68 const char *property;
69 Eina_Array_Iterator it;
70 Eina_Strbuf *buf; 69 Eina_Strbuf *buf;
71 unsigned int i; 70 Eina_Bool noproperties = EINA_TRUE;
72 71
73 buf = eina_strbuf_new(); 72 buf = eina_strbuf_new();
74 73
75 const char *name = eldbus_model_proxy_name_get(child); 74 const char *name = eldbus_model_proxy_name_get(child);
76 75
77 EINA_ARRAY_ITER_NEXT(properties, i, property, it) 76 EINA_ITERATOR_FOREACH(properties, property)
78 { 77 {
79 Eina_Value *v = efl_model_property_get(child, property); 78 Eina_Value *v = efl_model_property_get(child, property);
80 char *str; 79 char *str;
@@ -90,16 +89,18 @@ process(Eo *child, unsigned int index)
90 free(str); 89 free(str);
91 90
92 eina_value_free(v); 91 eina_value_free(v);
92
93 noproperties = EINA_FALSE;
93 } 94 }
95 eina_iterator_free(properties);
94 96
95 if (eina_array_count(properties) <= 0) 97 if (noproperties)
96 eina_strbuf_append_printf(buf, " %2d: %s (no properties yet)\n", index, name); 98 eina_strbuf_append_printf(buf, " %2d: %s (no properties yet)\n", index, name);
97 else 99 else
98 eina_strbuf_prepend_printf(buf, " -> %s\n Properties:\n", name); 100 eina_strbuf_prepend_printf(buf, " -> %s\n Properties:\n", name);
99 101
100 printf("%s", eina_strbuf_string_get(buf)); 102 printf("%s", eina_strbuf_string_get(buf));
101 103
102 eina_array_free(properties);
103 eina_strbuf_free(buf); 104 eina_strbuf_free(buf);
104 105
105 efl_ref(child); 106 efl_ref(child);