[gimp] app: forgot to also properly migrate the docks size.



commit 753e994e1d9c842d3d94e4ac14c6d45bfba55b90
Author: Jehan <jehan girinstud io>
Date:   Mon Aug 23 13:57:38 2021 +0200

    app: forgot to also properly migrate the docks size.
    
    Same as last commit, avoiding to end up with twice too big docks.

 app/core/gimp-user-install.c | 27 ++++++++++++++++++---------
 1 file changed, 18 insertions(+), 9 deletions(-)
---
diff --git a/app/core/gimp-user-install.c b/app/core/gimp-user-install.c
index 232f69e91c..13920723e3 100644
--- a/app/core/gimp-user-install.c
+++ b/app/core/gimp-user-install.c
@@ -618,8 +618,10 @@ user_update_controllerrc (const GMatchInfo *matched_value,
 }
 
 #define SESSIONRC_UPDATE_PATTERN \
-  "\\(position [0-9]* [0-9]*\\)"    "|" \
-  "\\(size [0-9]* [0-9]*\\)"
+  "\\(position [0-9]* [0-9]*\\)"        "|"  \
+  "\\(size [0-9]* [0-9]*\\)"            "|" \
+  "\\(left-docks-width \"?[0-9]*\"?\\)" "|" \
+  "\\(right-docks-width \"?[0-9]*\"?\\)"
 
 static gboolean
 user_update_sessionrc (const GMatchInfo *matched_value,
@@ -647,7 +649,7 @@ user_update_sessionrc (const GMatchInfo *matched_value,
       gchar      *match;
 
       /* First copy the pattern title. */
-      regexp = g_regex_new ("\\((position|size) ", 0, 0, NULL);
+      regexp = g_regex_new ("\\([a-z-]* ", 0, 0, NULL);
       g_regex_match (regexp, original, 0, &match_info);
       match = g_match_info_fetch (match_info, 0);
       g_string_append (new_value, match);
@@ -657,18 +659,25 @@ user_update_sessionrc (const GMatchInfo *matched_value,
       g_free (match);
 
       /* Now copy the numbers. */
-      regexp = g_regex_new ("[0-9]+", 0, 0, NULL);
+      regexp = g_regex_new ("[0-9]+|\"", 0, 0, NULL);
       g_regex_match (regexp, original, 0, &match_info);
 
       while (g_match_info_matches (match_info))
         {
-          gint num;
-
           match = g_match_info_fetch (match_info, 0);
-          num = g_ascii_strtoll (match, NULL, 10);
-          num /= install->scale_factor;
+          if (g_strcmp0 (match, "\"") == 0)
+            {
+              g_string_append (new_value, match);
+            }
+          else
+            {
+              gint num;
+
+              num = g_ascii_strtoll (match, NULL, 10);
+              num /= install->scale_factor;
 
-          g_string_append_printf (new_value, " %d", num);
+              g_string_append_printf (new_value, " %d", num);
+            }
 
           g_free (match);
           g_match_info_next (match_info, NULL);


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