[nautilus] files-view: Simplify file object creation



commit c82c31d994656c0cc72d7dde89546fc78da70b96
Author: Barnabás Pőcze <pobrn protonmail com>
Date:   Thu Jul 1 16:30:35 2021 +0200

    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()`.

 src/nautilus-files-view.c | 6 +++---
 1 file 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));


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