[gimp/gimp-2-10] libgimpwidgets: small details to better sync with `master` branch.



commit ae542e29eeddc955fd7f0bc725e1cd929f2eaaab
Author: Jehan <jehan girinstud io>
Date:   Sun Dec 19 16:02:50 2021 +0100

    libgimpwidgets: small details to better sync with `master` branch.
    
    The gimp-2-10 patch contributed as !514 was slightly different from the
    master one as !515, especially since the last one got the reviews. This
    syncs the 2 codebases (making it easier to backport future patches on
    the same piece of code) and do a few fixes.
    
    - Syncing alignments.
    - Fix a comment.
    - Use g_build_filename() for properly creating paths rather than string
      concatenations.

 libgimpwidgets/gimpwidgetsutils.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/libgimpwidgets/gimpwidgetsutils.c b/libgimpwidgets/gimpwidgetsutils.c
index db4b5db007..9cc507c4b7 100644
--- a/libgimpwidgets/gimpwidgetsutils.c
+++ b/libgimpwidgets/gimpwidgetsutils.c
@@ -584,11 +584,11 @@ gimp_screen_get_color_profile (GdkScreen *screen,
         if (EnumDisplayDevices (info.szDevice, 0, &display_device, 0))
           {
             gchar                        *device_key = g_convert (display_device.DeviceKey, -1, "UTF-16LE", 
"WINDOWS-1252", NULL, NULL, NULL);
-            gchar                        *filename = NULL;
-            gchar                        *dir = NULL;
-            gchar                        *fullpath = NULL;
+            gchar                        *filename   = NULL;
+            gchar                        *dir        = NULL;
+            gchar                        *fullpath   = NULL;
             GFile                        *file;
-            DWORD                         len = 0;
+            DWORD                         len        = 0;
             gboolean                      per_user;
             WCS_PROFILE_MANAGEMENT_SCOPE  scope;
 
@@ -612,7 +612,7 @@ gimp_screen_get_color_profile (GdkScreen *screen,
                                            len,
                                            (LPWSTR)filename_utf16);
 
-                /* _filename must be native endian */
+                /* filename_utf16 must be native endian */
                 filename = g_utf16_to_utf8 ((gunichar2 *)filename_utf16, -1, NULL, NULL, NULL);
                 g_free (filename_utf16);
               }
@@ -630,7 +630,7 @@ gimp_screen_get_color_profile (GdkScreen *screen,
             dir = g_new (gchar, len);
             GetColorDirectory (NULL, dir, &len);
 
-            fullpath = g_strdup_printf ("%s\\%s", dir, filename);
+            fullpath = g_build_filename (dir, filename, NULL);
             file = g_file_new_for_path (fullpath);
 
             profile = gimp_color_profile_new_from_file (file, NULL);


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