summaryrefslogtreecommitdiff
path: root/legacy/edbus/src/examples/complex_types_client_eina_value.c
diff options
context:
space:
mode:
authorJosé Roberto de Souza <zehortigoza@profusion.mobi>2012-11-09 18:35:14 +0000
committerLucas De Marchi <lucas.demarchi@profusion.mobi>2012-11-09 18:35:14 +0000
commitffc6f5cf9fdc774b9423e0aad234c240b6efee02 (patch)
treea50742040b167aaef68ddb2eb8a7080b3b4cf12b /legacy/edbus/src/examples/complex_types_client_eina_value.c
parentec5d3e18f896bde81114887dc1600590d18668f9 (diff)
edbus: Implement DBus.Properties for services
Patch by: José Roberto de Souza <zehortigoza@profusion.mobi> SVN revision: 79035
Diffstat (limited to '')
-rw-r--r--legacy/edbus/src/examples/complex_types_client_eina_value.c28
1 files changed, 19 insertions, 9 deletions
diff --git a/legacy/edbus/src/examples/complex_types_client_eina_value.c b/legacy/edbus/src/examples/complex_types_client_eina_value.c
index f5dcfb420e..2e9455f4ef 100644
--- a/legacy/edbus/src/examples/complex_types_client_eina_value.c
+++ b/legacy/edbus/src/examples/complex_types_client_eina_value.c
@@ -158,7 +158,7 @@ _property_changed(void *data, EDBus_Proxy *proxy, void *event_info)
158 name = event->name; 158 name = event->name;
159 value = event->value; 159 value = event->value;
160 160
161 if (!strcmp(name, "text")) 161 if (!strcmp(name, "text") || !strcmp(name, "Resp2"))
162 { 162 {
163 const char *txt; 163 const char *txt;
164 eina_value_get(value, &txt); 164 eina_value_get(value, &txt);
@@ -189,18 +189,27 @@ _read_cache(void *data)
189 Eina_Value *v; 189 Eina_Value *v;
190 190
191 v = edbus_proxy_property_local_get(proxy, "text"); 191 v = edbus_proxy_property_local_get(proxy, "text");
192 eina_value_get(v, &txt); 192 if (v)
193 printf("Read cache: [txt] = %s\n", txt); 193 {
194 eina_value_get(v, &txt);
195 printf("Read cache: [txt] = %s\n", txt);
196 }
194 197
195 v = edbus_proxy_property_local_get(proxy, "int32"); 198 v = edbus_proxy_property_local_get(proxy, "int32");
196 eina_value_get(v, &num); 199 if (v)
197 printf("Read cache: [int32] = %d\n", num); 200 {
201 eina_value_get(v, &num);
202 printf("Read cache: [int32] = %d\n", num);
203 }
198 204
199 v = edbus_proxy_property_local_get(proxy, "st"); 205 v = edbus_proxy_property_local_get(proxy, "st");
200 eina_value_struct_get(v, "arg0", &txt); 206 if (v)
201 printf("Read cache: [st] %s | ", txt); 207 {
202 eina_value_struct_get(v, "arg1", &txt); 208 eina_value_struct_get(v, "arg0", &txt);
203 printf("%s\n", txt); 209 printf("Read cache: [st] %s | ", txt);
210 eina_value_struct_get(v, "arg1", &txt);
211 printf("%s\n", txt);
212 }
204 213
205 return EINA_FALSE; 214 return EINA_FALSE;
206} 215}
@@ -258,6 +267,7 @@ main(void)
258 EDBUS_PROXY_EVENT_PROPERTY_CHANGED, 267 EDBUS_PROXY_EVENT_PROPERTY_CHANGED,
259 _property_changed, NULL); 268 _property_changed, NULL);
260 269
270 edbus_proxy_properties_monitor(proxy, EINA_TRUE);
261 ecore_timer_add(10, _read_cache, proxy); 271 ecore_timer_add(10, _read_cache, proxy);
262 272
263 ecore_main_loop_begin(); 273 ecore_main_loop_begin();