[gnome-builder] plugins/sessionui: don't warn on file-not-found



commit a2cfe2ca290037b11efc9a692cad2b3b2dd2d52f
Author: Christian Hergert <chergert redhat com>
Date:   Fri Sep 16 11:09:23 2022 -0700

    plugins/sessionui: don't warn on file-not-found
    
    That is common for new projects, so no need to warn for it.

 src/plugins/sessionui/gbp-sessionui-workbench-addin.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/src/plugins/sessionui/gbp-sessionui-workbench-addin.c 
b/src/plugins/sessionui/gbp-sessionui-workbench-addin.c
index af1cc0996..b435f429d 100644
--- a/src/plugins/sessionui/gbp-sessionui-workbench-addin.c
+++ b/src/plugins/sessionui/gbp-sessionui-workbench-addin.c
@@ -118,7 +118,10 @@ gbp_sessionui_workbench_addin_load_state_cb (GObject      *object,
 
   if (!(bytes = g_file_load_bytes_finish (file, result, NULL, &error)))
     {
-      ide_task_return_error (task, g_steal_pointer (&error));
+      if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_NOT_FOUND))
+        ide_task_return_boolean (task, TRUE);
+      else
+        ide_task_return_error (task, g_steal_pointer (&error));
       IDE_EXIT;
     }
 


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