[empathy: 23/53] Remove trailing whitespace from the debug message.



commit 0dce56f5fccdb09c42a66823986f5b13ba2e4704
Author: Jonny Lamb <jonny lamb collabora co uk>
Date:   Mon Apr 20 22:24:40 2009 +0100

    Remove trailing whitespace from the debug message.
    
    Signed-off-by: Jonny Lamb <jonny lamb collabora co uk>
---
 src/empathy-debug-dialog.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/src/empathy-debug-dialog.c b/src/empathy-debug-dialog.c
index b700be7..f5fcd64 100644
--- a/src/empathy-debug-dialog.c
+++ b/src/empathy-debug-dialog.c
@@ -117,6 +117,7 @@ debug_dialog_add_message (EmpathyDebugDialog *debug_dialog,
   EmpathyDebugDialogPriv *priv = GET_PRIV (debug_dialog);
   gchar *domain, *category;
   GtkTreeIter iter;
+  gchar *string;
 
   if (g_strrstr (domain_category, "/"))
     {
@@ -131,15 +132,22 @@ debug_dialog_add_message (EmpathyDebugDialog *debug_dialog,
       category = g_strdup ("");
     }
 
+  if (g_str_has_suffix (message, "\n"))
+    string = g_strchomp (g_strdup (message));
+  else
+    string = g_strdup (message);
+
+
   gtk_list_store_append (priv->store, &iter);
   gtk_list_store_set (priv->store, &iter,
       COL_TIMESTAMP, timestamp,
       COL_DOMAIN, domain,
       COL_CATEGORY, category,
       COL_LEVEL, log_level_to_string (level),
-      COL_MESSAGE, message,
+      COL_MESSAGE, string,
       -1);
 
+  g_free (string);
   g_free (domain);
   g_free (category);
 }



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