[gconf/migration-changes: 5/7] GSettings migration: print better keyfile errors



commit 581ac91a973ec7f81c497544a5d793f75e3cc647
Author: Ryan Lortie <desrt desrt ca>
Date:   Mon Aug 15 11:34:50 2011 -0400

    GSettings migration: print better keyfile errors
    
    GKeyFile error messages don't have very good context.  Add some when we
    print the message to stderr.

 gsettings/gsettings-data-convert.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/gsettings/gsettings-data-convert.c b/gsettings/gsettings-data-convert.c
index 8af5a4f..21dcf6f 100644
--- a/gsettings/gsettings-data-convert.c
+++ b/gsettings/gsettings-data-convert.c
@@ -75,7 +75,8 @@ handle_file (const gchar *filename)
   error = NULL;
   if (!g_key_file_load_from_file (keyfile, filename, 0, &error))
     {
-      g_printerr ("%s\n", error->message);
+      if (verbose)
+        g_printerr ("%s: %s\n", filename, error->message);
       g_error_free (error);
 
       g_key_file_free (keyfile);
@@ -441,7 +442,7 @@ load_state (time_t *mtime)
   error = NULL;
   if (!g_key_file_load_from_file (keyfile, filename, 0, &error))
     {
-      g_printerr ("%s\n", error->message);
+      g_printerr ("%s: %s\n", filename, error->message);
       g_error_free (error);
       return converted;
     }



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