[gimp/wip/wormnest/fix-themes-windows: 2/2] fix: themes_theme_change_notify: error parsing theme.css on Windows.
- From: Jacob Boerema <jboerema src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/wip/wormnest/fix-themes-windows: 2/2] fix: themes_theme_change_notify: error parsing theme.css on Windows.
- Date: Fri, 25 Sep 2020 18:29:40 +0000 (UTC)
commit 92b74a660283bf518c9297bd1413d967f431b2bb
Author: Jacob Boerema <jgboerema gmail com>
Date: Fri Sep 25 13:24:28 2020 -0400
fix: themes_theme_change_notify: error parsing theme.css on Windows.
When loading a theme on Windows we always get an error like:
themes_theme_change_notify: error parsing [path including drive letter to:]\theme.css:
theme.css:8:99Failed to import: Operation not supported
The location points to the end of the filename of the first @ import url string.
This is caused by the string not being an url.
Based on suggestions from Jehan and lillolollo we replace g_file_get_path
with g_file_get_uri since an url is what is expected here.
Since that function already escapes the string we also remove
g_str_escape here.
app/gui/themes.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
---
diff --git a/app/gui/themes.c b/app/gui/themes.c
index 065af8ad11..4603a80597 100644
--- a/app/gui/themes.c
+++ b/app/gui/themes.c
@@ -290,18 +290,15 @@ themes_apply_theme (Gimp *gimp,
if (g_file_query_exists (file, NULL))
{
gchar *path;
- gchar *esc_path;
- path = g_file_get_path (file);
- esc_path = g_strescape (path, NULL);
- g_free (path);
+ path = g_file_get_uri (file);
g_output_stream_printf (
output, NULL, NULL, &error,
"@import url(\"%s\");\n",
- esc_path);
+ path);
- g_free (esc_path);
+ g_free (path);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]