Skip to content

Instantly share code, notes, and snippets.

@sgnn7
Last active October 7, 2020 15:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sgnn7/1b368eaf6c0d63d68a35 to your computer and use it in GitHub Desktop.
Save sgnn7/1b368eaf6c0d63d68a35 to your computer and use it in GitHub Desktop.
Index: gnome-control-center-3.8.2/panels/background/cc-background-xml.c
===================================================================
--- gnome-control-center-3.8.2.orig/panels/background/cc-background-xml.c 2013-11-27 15:52:21.000000000 -0500
+++ gnome-control-center-3.8.2/panels/background/cc-background-xml.c 2013-11-27 16:27:56.893478447 -0500
@@ -329,10 +329,24 @@
}
/* Resolve symlink if present */
- if (g_file_info_get_is_symlink (file_info))
- id = g_filename_to_uri (g_file_info_get_symlink_target (file_info),
- NULL, NULL);
- else
+ if (g_file_info_get_is_symlink (file_info)) {
+ GFile *parent_path;
+ GFile *resolved_file;
+ const char *target;
+ char *resolved_uri;
+
+ parent_path = g_file_get_parent (file);
+ target = g_file_info_get_symlink_target (file_info);
+ g_assert (target);
+
+ resolved_file = g_file_resolve_relative_path (parent_path, target);
+ resolved_uri = g_file_get_uri (resolved_file);
+
+ id = g_strdup (resolved_uri);
+
+ g_object_unref (resolved_file);
+ g_free (resolved_uri);
+ } else
id = g_strdup (item_uri);
g_object_unref (file_info);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment