Commit 3e8345a8 authored by Pavel Cisler's avatar Pavel Cisler Committed by Pavel Cisler

Fix 6401 (Create Link yields "You cannot link a file to itself" error)

2001-02-08  Pavel Cisler  <pavel@eazel.com>

	Fix 6401 (Create Link yields "You cannot link a file to itself"
		  error)
	* libnautilus-extensions/nautilus-file-operations.c:
	(nautilus_file_operations_copy_move):
	Remove a confused link to self check.
	Pass the GNOME_VFS_XFER_USE_UNIQUE_NAMES option to xfer.
parent e2fe602c
2001-02-08 Pavel Cisler <pavel@eazel.com>
Fix 6401 (Create Link yields "You cannot link a file to itself"
error)
* libnautilus-extensions/nautilus-file-operations.c:
(nautilus_file_operations_copy_move):
Remove a confused link to self check.
Pass the GNOME_VFS_XFER_USE_UNIQUE_NAMES option to xfer.
2001-02-08 Fatih Demir <kabalak@kabalak.net> 2001-02-08 Fatih Demir <kabalak@kabalak.net>
* components/services/install/lib/eazel-package-system-rpm3.c: * components/services/install/lib/eazel-package-system-rpm3.c:
......
...@@ -1819,6 +1819,8 @@ nautilus_file_operations_copy_move (const GList *item_uris, ...@@ -1819,6 +1819,8 @@ nautilus_file_operations_copy_move (const GList *item_uris,
transfer_info->show_progress_dialog = transfer_info->show_progress_dialog =
!same_fs || g_list_length ((GList *)item_uris) > 20; !same_fs || g_list_length ((GList *)item_uris) > 20;
} else if ((move_options & GNOME_VFS_XFER_LINK_ITEMS) != 0) { } else if ((move_options & GNOME_VFS_XFER_LINK_ITEMS) != 0) {
/* when creating links, handle name conflicts automatically */
move_options |= GNOME_VFS_XFER_USE_UNIQUE_NAMES;
/* localizers: progress dialog title */ /* localizers: progress dialog title */
transfer_info->operation_title = _("Creating links to files"); transfer_info->operation_title = _("Creating links to files");
/* localizers: label prepended to the progress count */ /* localizers: label prepended to the progress count */
...@@ -1882,8 +1884,6 @@ nautilus_file_operations_copy_move (const GList *item_uris, ...@@ -1882,8 +1884,6 @@ nautilus_file_operations_copy_move (const GList *item_uris,
nautilus_run_simple_dialog nautilus_run_simple_dialog
(parent_view, (parent_view,
FALSE, FALSE,
((move_options & GNOME_VFS_XFER_REMOVESOURCE) != 0) ((move_options & GNOME_VFS_XFER_REMOVESOURCE) != 0)
? (is_desktop_trash_link ? (is_desktop_trash_link
? _("The Trash must remain on the desktop.") ? _("The Trash must remain on the desktop.")
...@@ -1920,21 +1920,16 @@ nautilus_file_operations_copy_move (const GList *item_uris, ...@@ -1920,21 +1920,16 @@ nautilus_file_operations_copy_move (const GList *item_uris,
result = GNOME_VFS_ERROR_NOT_PERMITTED; result = GNOME_VFS_ERROR_NOT_PERMITTED;
break; break;
} }
if (((move_options & GNOME_VFS_XFER_LINK_ITEMS) != 0 if (((move_options & GNOME_VFS_XFER_REMOVESOURCE) != 0
|| (move_options & GNOME_VFS_XFER_REMOVESOURCE) != 0
|| (move_options & GNOME_VFS_XFER_USE_UNIQUE_NAMES) == 0) || (move_options & GNOME_VFS_XFER_USE_UNIQUE_NAMES) == 0)
&& gnome_vfs_uri_is_parent (target_dir_uri, uri, FALSE)) { && gnome_vfs_uri_is_parent (target_dir_uri, uri, FALSE)) {
nautilus_run_simple_dialog nautilus_run_simple_dialog
(parent_view, (parent_view,
FALSE, FALSE,
((move_options & GNOME_VFS_XFER_LINK_ITEMS) != 0) ((move_options & GNOME_VFS_XFER_REMOVESOURCE) != 0)
? _("You cannot link a file to itself.")
: ((move_options & GNOME_VFS_XFER_REMOVESOURCE) != 0)
? _("You cannot move a file onto itself.") ? _("You cannot move a file onto itself.")
: _("You cannot copy a file over itself."), : _("You cannot copy a file over itself."),
((move_options & GNOME_VFS_XFER_LINK_ITEMS) != 0) ((move_options & GNOME_VFS_XFER_REMOVESOURCE) != 0)
? _("Can't Link To Self")
: ((move_options & GNOME_VFS_XFER_REMOVESOURCE) != 0)
? _("Can't Move Onto Self") ? _("Can't Move Onto Self")
: _("Can't Copy Over Self"), : _("Can't Copy Over Self"),
GNOME_STOCK_BUTTON_OK, NULL, NULL); GNOME_STOCK_BUTTON_OK, NULL, NULL);
......
...@@ -1819,6 +1819,8 @@ nautilus_file_operations_copy_move (const GList *item_uris, ...@@ -1819,6 +1819,8 @@ nautilus_file_operations_copy_move (const GList *item_uris,
transfer_info->show_progress_dialog = transfer_info->show_progress_dialog =
!same_fs || g_list_length ((GList *)item_uris) > 20; !same_fs || g_list_length ((GList *)item_uris) > 20;
} else if ((move_options & GNOME_VFS_XFER_LINK_ITEMS) != 0) { } else if ((move_options & GNOME_VFS_XFER_LINK_ITEMS) != 0) {
/* when creating links, handle name conflicts automatically */
move_options |= GNOME_VFS_XFER_USE_UNIQUE_NAMES;
/* localizers: progress dialog title */ /* localizers: progress dialog title */
transfer_info->operation_title = _("Creating links to files"); transfer_info->operation_title = _("Creating links to files");
/* localizers: label prepended to the progress count */ /* localizers: label prepended to the progress count */
...@@ -1882,8 +1884,6 @@ nautilus_file_operations_copy_move (const GList *item_uris, ...@@ -1882,8 +1884,6 @@ nautilus_file_operations_copy_move (const GList *item_uris,
nautilus_run_simple_dialog nautilus_run_simple_dialog
(parent_view, (parent_view,
FALSE, FALSE,
((move_options & GNOME_VFS_XFER_REMOVESOURCE) != 0) ((move_options & GNOME_VFS_XFER_REMOVESOURCE) != 0)
? (is_desktop_trash_link ? (is_desktop_trash_link
? _("The Trash must remain on the desktop.") ? _("The Trash must remain on the desktop.")
...@@ -1920,21 +1920,16 @@ nautilus_file_operations_copy_move (const GList *item_uris, ...@@ -1920,21 +1920,16 @@ nautilus_file_operations_copy_move (const GList *item_uris,
result = GNOME_VFS_ERROR_NOT_PERMITTED; result = GNOME_VFS_ERROR_NOT_PERMITTED;
break; break;
} }
if (((move_options & GNOME_VFS_XFER_LINK_ITEMS) != 0 if (((move_options & GNOME_VFS_XFER_REMOVESOURCE) != 0
|| (move_options & GNOME_VFS_XFER_REMOVESOURCE) != 0
|| (move_options & GNOME_VFS_XFER_USE_UNIQUE_NAMES) == 0) || (move_options & GNOME_VFS_XFER_USE_UNIQUE_NAMES) == 0)
&& gnome_vfs_uri_is_parent (target_dir_uri, uri, FALSE)) { && gnome_vfs_uri_is_parent (target_dir_uri, uri, FALSE)) {
nautilus_run_simple_dialog nautilus_run_simple_dialog
(parent_view, (parent_view,
FALSE, FALSE,
((move_options & GNOME_VFS_XFER_LINK_ITEMS) != 0) ((move_options & GNOME_VFS_XFER_REMOVESOURCE) != 0)
? _("You cannot link a file to itself.")
: ((move_options & GNOME_VFS_XFER_REMOVESOURCE) != 0)
? _("You cannot move a file onto itself.") ? _("You cannot move a file onto itself.")
: _("You cannot copy a file over itself."), : _("You cannot copy a file over itself."),
((move_options & GNOME_VFS_XFER_LINK_ITEMS) != 0) ((move_options & GNOME_VFS_XFER_REMOVESOURCE) != 0)
? _("Can't Link To Self")
: ((move_options & GNOME_VFS_XFER_REMOVESOURCE) != 0)
? _("Can't Move Onto Self") ? _("Can't Move Onto Self")
: _("Can't Copy Over Self"), : _("Can't Copy Over Self"),
GNOME_STOCK_BUTTON_OK, NULL, NULL); GNOME_STOCK_BUTTON_OK, NULL, NULL);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment