From 0b09cc8e57bc5fa701dd685d648fd338b92b2c48 Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Thu, 08 Oct 2009 13:11:10 +0000 Subject: Don't always overwrite on trash restore We want to get overwrite dialogs when restoring from trash. https://bugzilla.gnome.org/show_bug.cgi?id=596618 --- diff --git a/daemon/gvfsbackendtrash.c b/daemon/gvfsbackendtrash.c index 166bd04..e515fb8 100644 --- a/daemon/gvfsbackendtrash.c +++ b/daemon/gvfsbackendtrash.c @@ -447,7 +447,7 @@ trash_backend_pull (GVfsBackend *vfs_backend, destination = g_file_new_for_path (local_path); if (remove_source) - it_worked = trash_item_restore (item, destination, &error); + it_worked = trash_item_restore (item, destination, flags, &error); else it_worked = g_file_copy (real, destination, flags, G_VFS_JOB (job)->cancellable, diff --git a/daemon/trashlib/trashitem.c b/daemon/trashlib/trashitem.c index 335e8d4..bcfc301 100644 --- a/daemon/trashlib/trashitem.c +++ b/daemon/trashlib/trashitem.c @@ -486,7 +486,9 @@ trash_item_delete (TrashItem *item, temp_name = g_file_get_child (expunged, buffer); /* "restore" the item into the expunged folder */ - if (trash_item_restore (item, temp_name, NULL)) + if (trash_item_restore (item, temp_name, + G_FILE_COPY_OVERWRITE | G_FILE_COPY_NOFOLLOW_SYMLINKS, + NULL)) { trash_expunge (expunged); success = TRUE; @@ -507,11 +509,11 @@ trash_item_delete (TrashItem *item, gboolean trash_item_restore (TrashItem *item, GFile *dest, + GFileCopyFlags flags, GError **error) { if (g_file_move (item->file, dest, - G_FILE_COPY_OVERWRITE | - G_FILE_COPY_NOFOLLOW_SYMLINKS | + flags | G_FILE_COPY_NO_FALLBACK_FOR_MOVE, NULL, NULL, NULL, error)) { diff --git a/daemon/trashlib/trashitem.h b/daemon/trashlib/trashitem.h index 0fe0938..ad78202 100644 --- a/daemon/trashlib/trashitem.h +++ b/daemon/trashlib/trashitem.h @@ -54,6 +54,7 @@ gboolean trash_item_delete (TrashItem *item, GError **error); gboolean trash_item_restore (TrashItem *item, GFile *dest, + GFileCopyFlags flags, GError **error); #endif /* _trashitem_h_ */ -- cgit v0.8.2