[rygel-grilo] Do not print error if there is no one



commit ab6bbda30c535a16c6c337047c6285f9c1e85fff
Author: Juan A. Suarez Romero <jasuarez igalia com>
Date:   Wed Apr 14 21:59:33 2010 +0200

    Do not print error if there is no one
    
    Also, if a provider has no children/properties, print provider name too.

 src/test-client.c |   22 ++++++++++++----------
 1 files changed, 12 insertions(+), 10 deletions(-)
---
diff --git a/src/test-client.c b/src/test-client.c
index 873aa22..ca312df 100644
--- a/src/test-client.c
+++ b/src/test-client.c
@@ -19,13 +19,14 @@ children_reply (GObject *source,
 
   children = ms2_client_get_children_finish (MS2_CLIENT (source), res, &error);
 
+  g_print ("\n* Provider '%s'\n", provider);
+  g_free (provider);
+
   if (!children) {
-    g_print ("Did not get any child, %s\n", error->message);
+    g_print ("\tDid not get any child, %s\n", error? error->message: "no error");
     return;
   }
 
-  g_print ("\n* Provider '%s'\n", provider);
-  g_free (provider);
   for (child = children; child; child = g_list_next (child)) {
     g_print ("\t* '%s', '%s'\n",
              g_value_get_string(g_hash_table_lookup (child->data, MS2_PROP_ID)),
@@ -84,13 +85,14 @@ properties_reply (GObject *source,
 
   result = ms2_client_get_properties_finish (MS2_CLIENT (source), res, &error);
 
+  g_print ("\n* Provider '%s'\n", provider);
+  g_free (provider);
+
   if (!result) {
-    g_print ("Did not get any property, %s\n", error->message);
+    g_print ("\tDid not get any property, %s\n", error? error->message: "no error");
     return;
   }
 
-  g_print ("\n* Provider '%s'\n", provider);
-  g_free (provider);
   for (p = properties; *p; p++) {
     v = g_hash_table_lookup (result, *p);
     if (v && G_VALUE_HOLDS_INT (v)) {
@@ -165,12 +167,12 @@ test_properties_sync ()
 
     result = ms2_client_get_properties (client, MS2_ROOT, properties, &error);
 
+    g_print ("\n* Provider '%s'\n", *provider);
     if (!result) {
-      g_print ("Did not get any property, %s\n", error->message);
+      g_print ("\tDid not get any property, %s\n", error? error->message: "no error");
       return;
     }
 
-    g_print ("\n* Provider '%s'\n", *provider);
     for (p = properties; *p; p++) {
       v = g_hash_table_lookup (result, *p);
       if (v && G_VALUE_HOLDS_INT (v)) {
@@ -215,12 +217,12 @@ test_children_sync ()
 
     children  = ms2_client_get_children (client, MS2_ROOT, 0, -1, properties, &error);
 
+    g_print ("\n* Provider '%s'\n", *provider);
     if (!children) {
-      g_print ("Did not get any child, %s\n", error->message);
+      g_print ("\tDid not get any child, %s\n", error? error->message: "no error");
       return;
     }
 
-    g_print ("\n* Provider '%s'\n", *provider);
     for (child = children; child; child = g_list_next (child)) {
       g_print ("\t* '%s', '%s'\n",
                g_value_get_string(g_hash_table_lookup (child->data, MS2_PROP_ID)),



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]