telepathy-mission-control: mc-tool: don't display empty 'Addressing' section

Guillaume Desmottes gdesmott at kemper.freedesktop.org
Wed Aug 8 02:06:28 PDT 2012


Module: telepathy-mission-control
Branch: master
Commit: af504f1f7db73c71e35f3c3701bfe9e428d02b72
URL:    http://cgit.freedesktop.org/telepathy/telepathy-mission-control/commit/?id=af504f1f7db73c71e35f3c3701bfe9e428d02b72

Author: Guillaume Desmottes <guillaume.desmottes at collabora.co.uk>
Date:   Tue Aug  7 10:36:28 2012 +0200

mc-tool: don't display empty 'Addressing' section

The general behaviour is to only display relevant fields.

https://bugs.freedesktop.org/show_bug.cgi?id=53202

---

 util/mc-tool.c |   15 ++++++++-------
 1 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/util/mc-tool.c b/util/mc-tool.c
index 7d46147..1c9e84b 100644
--- a/util/mc-tool.c
+++ b/util/mc-tool.c
@@ -323,10 +323,7 @@ show_uri_schemes (const gchar * const *schemes)
   int result;
   gchar *tmp;
 
-  if (schemes == NULL || schemes[0] == NULL)
-    tmp = g_strdup ("");
-  else
-    tmp = g_strjoinv (", ", (gchar **) schemes);
+  tmp = g_strjoinv (", ", (gchar **) schemes);
 
   result = printf ("%12s: %s\n", "URIScheme", tmp);
 
@@ -760,10 +757,14 @@ command_show (TpAccount *account)
     show ("Changing",
         tp_account_get_changing_presence (account) ? "yes" : "no");
 
-    puts ("");
-    puts ("Addressing:");
     schemes = tp_account_get_uri_schemes (account);
-    show_uri_schemes (schemes);
+    if (schemes != NULL && schemes[0] != NULL)
+      {
+        puts ("");
+        puts ("Addressing:");
+
+        show_uri_schemes (schemes);
+      }
 
     storage_provider = tp_account_get_storage_provider (account);
     if (!tp_str_empty (storage_provider))



More information about the telepathy-commits mailing list