diff options
author | Pavel Cisler <pavel@eazel.com> | 2001-01-19 11:36:52 +0000 |
---|---|---|
committer | Pavel Cisler <pce@src.gnome.org> | 2001-01-19 11:36:52 +0000 |
commit | 8caa91c1630c11d97def53fa501c5c14a82c0c4a (patch) | |
tree | d7c8d4468a591a131e320121813b3308917da28c | |
parent | 734006730b1d16da3f7b786a72c66d0b50303336 (diff) | |
download | nautilus-8caa91c1630c11d97def53fa501c5c14a82c0c4a.tar.gz |
reviewed by: Ramiro Estrugo <ramiro@eazel.com>
2001-01-19 Pavel Cisler <pavel@eazel.com>
reviewed by: Ramiro Estrugo <ramiro@eazel.com>
Fixed 4348: trying to trash a file already deleted outside Nautilus crashes.
* libnautilus-extensions/nautilus-file-operations.c:
(nautilus_file_operations_copy_move):
The problem was that the "find trash near" operation was failing because
the trahsed file was non-existent.
Added code that deals with a NULL target_directory_uri handle.
-rw-r--r-- | ChangeLog | 11 | ||||
-rw-r--r-- | libnautilus-extensions/nautilus-file-operations.c | 24 | ||||
-rw-r--r-- | libnautilus-private/nautilus-file-operations.c | 24 |
3 files changed, 39 insertions, 20 deletions
@@ -1,3 +1,14 @@ +2001-01-19 Pavel Cisler <pavel@eazel.com> + + reviewed by: Ramiro Estrugo <ramiro@eazel.com> + + Fixed 4348: trying to trash a file already deleted outside Nautilus crashes. + * libnautilus-extensions/nautilus-file-operations.c: + (nautilus_file_operations_copy_move): + The problem was that the "find trash near" operation was failing because + the trahsed file was non-existent. + Added code that deals with a NULL target_directory_uri handle. + 2001-01-19 Stanislav Visnovsky <visnovsky@nenya.ms.mff.cuni.cz> * configure.in: Added sk to ALL_LINGUAS. diff --git a/libnautilus-extensions/nautilus-file-operations.c b/libnautilus-extensions/nautilus-file-operations.c index 3c58562ca..661e33172 100644 --- a/libnautilus-extensions/nautilus-file-operations.c +++ b/libnautilus-extensions/nautilus-file-operations.c @@ -1678,15 +1678,16 @@ nautilus_file_operations_copy_move (const GList *item_uris, } source_uri = gnome_vfs_uri_new ((const char *) p->data); - source_uri_list = g_list_prepend (source_uri_list, source_uri); source_dir_uri = gnome_vfs_uri_get_parent (source_uri); - + target_uri = NULL; if (target_dir != NULL) { if (is_trash_move) { gnome_vfs_find_directory (source_uri, GNOME_VFS_DIRECTORY_KIND_TRASH, &target_dir_uri, FALSE, FALSE, 0777); } - target_uri = append_basename (target_dir_uri, source_uri); + if (target_dir_uri != NULL) { + target_uri = append_basename (target_dir_uri, source_uri); + } } else { /* duplication */ target_uri = gnome_vfs_uri_ref (source_uri); @@ -1694,13 +1695,16 @@ nautilus_file_operations_copy_move (const GList *item_uris, target_dir_uri = gnome_vfs_uri_ref (source_dir_uri); } } - target_uri_list = g_list_prepend (target_uri_list, target_uri); - gnome_vfs_check_same_fs_uris (source_uri, target_uri, &same_fs); - - g_assert (target_dir_uri != NULL); - duplicate &= same_fs; - duplicate &= gnome_vfs_uri_equal (source_dir_uri, target_dir_uri); - + + if (target_uri != NULL) { + target_uri_list = g_list_prepend (target_uri_list, target_uri); + source_uri_list = g_list_prepend (source_uri_list, source_uri); + gnome_vfs_check_same_fs_uris (source_uri, target_uri, &same_fs); + + g_assert (target_dir_uri != NULL); + duplicate &= same_fs; + duplicate &= gnome_vfs_uri_equal (source_dir_uri, target_dir_uri); + } gnome_vfs_uri_unref (source_dir_uri); } diff --git a/libnautilus-private/nautilus-file-operations.c b/libnautilus-private/nautilus-file-operations.c index 3c58562ca..661e33172 100644 --- a/libnautilus-private/nautilus-file-operations.c +++ b/libnautilus-private/nautilus-file-operations.c @@ -1678,15 +1678,16 @@ nautilus_file_operations_copy_move (const GList *item_uris, } source_uri = gnome_vfs_uri_new ((const char *) p->data); - source_uri_list = g_list_prepend (source_uri_list, source_uri); source_dir_uri = gnome_vfs_uri_get_parent (source_uri); - + target_uri = NULL; if (target_dir != NULL) { if (is_trash_move) { gnome_vfs_find_directory (source_uri, GNOME_VFS_DIRECTORY_KIND_TRASH, &target_dir_uri, FALSE, FALSE, 0777); } - target_uri = append_basename (target_dir_uri, source_uri); + if (target_dir_uri != NULL) { + target_uri = append_basename (target_dir_uri, source_uri); + } } else { /* duplication */ target_uri = gnome_vfs_uri_ref (source_uri); @@ -1694,13 +1695,16 @@ nautilus_file_operations_copy_move (const GList *item_uris, target_dir_uri = gnome_vfs_uri_ref (source_dir_uri); } } - target_uri_list = g_list_prepend (target_uri_list, target_uri); - gnome_vfs_check_same_fs_uris (source_uri, target_uri, &same_fs); - - g_assert (target_dir_uri != NULL); - duplicate &= same_fs; - duplicate &= gnome_vfs_uri_equal (source_dir_uri, target_dir_uri); - + + if (target_uri != NULL) { + target_uri_list = g_list_prepend (target_uri_list, target_uri); + source_uri_list = g_list_prepend (source_uri_list, source_uri); + gnome_vfs_check_same_fs_uris (source_uri, target_uri, &same_fs); + + g_assert (target_dir_uri != NULL); + duplicate &= same_fs; + duplicate &= gnome_vfs_uri_equal (source_dir_uri, target_dir_uri); + } gnome_vfs_uri_unref (source_dir_uri); } |