[gimp] app: check extensionrc existence before trying to parse it.



commit 9c4860b31ef9178b785b1bfc5d037b8f17c1bfb2
Author: Jehan <jehan girinstud io>
Date:   Thu Oct 8 18:19:22 2020 +0200

    app: check extensionrc existence before trying to parse it.
    
    On first run, it would not exist (which is normal) which was producing
    an error message on stderr.

 app/core/gimpextensionmanager.c | 23 +++++++++++++----------
 1 file changed, 13 insertions(+), 10 deletions(-)
---
diff --git a/app/core/gimpextensionmanager.c b/app/core/gimpextensionmanager.c
index ba5b232914..37c00f0822 100644
--- a/app/core/gimpextensionmanager.c
+++ b/app/core/gimpextensionmanager.c
@@ -571,18 +571,21 @@ gimp_extension_manager_initialize (GimpExtensionManager *manager)
 
   file = gimp_directory_file ("extensionrc", NULL);
 
-  if (manager->p->gimp->be_verbose)
-    g_print ("Parsing '%s'\n", gimp_file_get_utf8_name (file));
-
   processed_ids = NULL;
-  gimp_config_deserialize_file (GIMP_CONFIG (manager),
-                                file, &processed_ids, &error);
-  if (error)
+  if (g_file_query_exists (file, NULL))
     {
-      g_printerr ("Failed to parse '%s': %s\n",
-                  gimp_file_get_utf8_name (file),
-                  error->message);
-      g_error_free (error);
+      if (manager->p->gimp->be_verbose)
+        g_print ("Parsing '%s'\n", gimp_file_get_utf8_name (file));
+
+      gimp_config_deserialize_file (GIMP_CONFIG (manager),
+                                    file, &processed_ids, &error);
+      if (error)
+        {
+          g_printerr ("Failed to parse '%s': %s\n",
+                      gimp_file_get_utf8_name (file),
+                      error->message);
+          g_error_free (error);
+        }
     }
   g_object_unref (file);
 


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