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.
This commit is contained in:
Jehan 2021-12-19 16:02:50 +01:00
parent ccb94344fc
commit ae542e29ee

View File

@ -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);