[gimp] app: try to move the compat filter config to its new place



commit 70d428591fcc82419c28c71bc51db0070b2c5515
Author: Michael Natterer <mitch gimp org>
Date:   Fri Mar 24 11:44:02 2017 +0100

    app: try to move the compat filter config to its new place
    
    from gimpdir/tool-options/ to gimpdir/filters/, and only if moving
    fails try reading from the old location as fallback. We don't normally
    move files around, but this one-liner nicely avoids cluttering
    gimpdir.

 app/operations/gimp-operation-config.c |   22 ++++++++++++++--------
 1 files changed, 14 insertions(+), 8 deletions(-)
---
diff --git a/app/operations/gimp-operation-config.c b/app/operations/gimp-operation-config.c
index 6d0f01d..18251a3 100644
--- a/app/operations/gimp-operation-config.c
+++ b/app/operations/gimp-operation-config.c
@@ -368,17 +368,23 @@ gimp_operation_config_get_container (Gimp         *gimp,
 
           if (! g_file_query_exists (file, NULL))
             {
-              GQuark quark = g_quark_from_static_string ("compat-file");
+              GQuark  quark = g_quark_from_static_string ("compat-file");
+              GFile  *compat_file;
 
-              g_object_unref (file);
+              compat_file = g_type_get_qdata (config_type, quark);
 
-              file = g_type_get_qdata (config_type, quark);
-
-              if (file)
+              if (compat_file)
                 {
-                  g_object_ref (file);
-
-                  gimp_operation_config_deserialize (gimp, container, file);
+                  if (! g_file_move (compat_file, file, 0,
+                                     NULL, NULL, NULL, NULL))
+                    {
+                      gimp_operation_config_deserialize (gimp, container,
+                                                         compat_file);
+                    }
+                  else
+                    {
+                      gimp_operation_config_deserialize (gimp, container, NULL);
+                    }
                 }
             }
 


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