diff options
author | Barnabás Pőcze <pobrn@protonmail.com> | 2021-07-01 16:30:35 +0200 |
---|---|---|
committer | António Fernandes <antoniof@gnome.org> | 2021-09-03 21:27:29 +0100 |
commit | c82c31d994656c0cc72d7dde89546fc78da70b96 (patch) | |
tree | c26e197589363b8a3efdad3cc8fb3dc480096b35 | |
parent | bf113781d0caa26db2b992f14e328e4cd7c038f4 (diff) | |
download | nautilus-c82c31d994656c0cc72d7dde89546fc78da70b96.tar.gz |
files-view: Simplify file object creation
Use `g_file_new_build_filename()` to create the file object
for the "Wallpapers" directory instead of the previously
used `g_file_new_for_path()` + `g_file_get_child()` in
`set_wallpaper_fallback()`.
-rw-r--r-- | src/nautilus-files-view.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/nautilus-files-view.c b/src/nautilus-files-view.c index 5f3e10d46..17f397322 100644 --- a/src/nautilus-files-view.c +++ b/src/nautilus-files-view.c @@ -6856,13 +6856,13 @@ set_wallpaper_fallback (NautilusFile *file, { g_autofree char *target_uri = NULL; GList *uris; - g_autoptr (GFile) parent = NULL; g_autoptr (GFile) target = NULL; /* Copy the item to Pictures/Wallpaper (internationalized) since it may be * remote. Then set it as the current wallpaper. */ - parent = g_file_new_for_path (g_get_user_special_dir (G_USER_DIRECTORY_PICTURES)); - target = g_file_get_child (parent, _("Wallpapers")); + target = g_file_new_build_filename (g_get_user_special_dir (G_USER_DIRECTORY_PICTURES), + _("Wallpapers"), + NULL); g_file_make_directory_with_parents (target, NULL, NULL); target_uri = g_file_get_uri (target); uris = g_list_prepend (NULL, nautilus_file_get_uri (file)); |