[gnome-builder/wip/libide] libide: print some basic diagnostic info



commit 3547e2baee8c7c9eb6878d3e65fe2c180bb5883e
Author: Christian Hergert <christian hergert me>
Date:   Wed Feb 11 23:36:39 2015 -0800

    libide: print some basic diagnostic info

 tools/ide-list-diagnostics.c |   18 ++++++++++++++++--
 1 files changed, 16 insertions(+), 2 deletions(-)
---
diff --git a/tools/ide-list-diagnostics.c b/tools/ide-list-diagnostics.c
index 22f62ae..10e724b 100644
--- a/tools/ide-list-diagnostics.c
+++ b/tools/ide-list-diagnostics.c
@@ -43,7 +43,9 @@ diagnose_cb (GObject      *object,
 {
   IdeDiagnostician *diagnostician = (IdeDiagnostician *)object;
   g_autoptr(GError) error = NULL;
-  void *ret;
+  g_autoptr(IdeDiagnostics) ret = NULL;
+  gsize count;
+  gsize i;
 
   ret = ide_diagnostician_diagnose_finish (diagnostician, result, &error);
 
@@ -54,8 +56,20 @@ diagnose_cb (GObject      *object,
       return;
     }
 
+  count = ide_diagnostics_get_size (ret);
+
+  for (i = 0; i < count; i++)
+    {
+      IdeDiagnostic *diag;
+      const gchar *text;
+
+      diag = ide_diagnostics_index (ret, i);
+      text = ide_diagnostic_get_text (diag);
+
+      g_print ("%s\n", text);
+    }
+
   quit (EXIT_SUCCESS);
-  return;
 }
 
 static void


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