[gnome-builder] ide-configuration-manager: warn when restoring config fails



commit 94106283b374eba40a374fc4951b5f6240ae6b93
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Sat Dec 17 16:00:08 2016 -0800

    ide-configuration-manager: warn when restoring config fails
    
    And don't leak the error in that case.

 libide/buildsystem/ide-configuration-manager.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/libide/buildsystem/ide-configuration-manager.c b/libide/buildsystem/ide-configuration-manager.c
index 8ac8110..0d7ddf2 100644
--- a/libide/buildsystem/ide-configuration-manager.c
+++ b/libide/buildsystem/ide-configuration-manager.c
@@ -669,8 +669,8 @@ ide_configuration_manager_init_worker (GTask        *task,
 {
   IdeConfigurationManager *self = source_object;
   g_autoptr(GFile) settings_file = NULL;
+  g_autoptr(GError) error = NULL;
   IdeContext *context;
-  GError *error = NULL;
   IdeVcs *vcs;
   GFile *workdir;
 
@@ -685,7 +685,12 @@ ide_configuration_manager_init_worker (GTask        *task,
 
   if (!g_file_query_exists (settings_file, cancellable) ||
       !ide_configuration_manager_restore (self, settings_file, cancellable, &error))
-    ide_configuration_manager_add_default (self);
+    {
+      if (error != NULL)
+        g_warning ("Failed to restore configuration: %s", error->message);
+
+      ide_configuration_manager_add_default (self);
+    }
 
   g_task_return_boolean (task, TRUE);
 }


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