summaryrefslogtreecommitdiff
path: root/libnautilus-private/nautilus-file-operations.c
diff options
context:
space:
mode:
authorChristian Neumair <cneumair@gnome.org>2009-02-20 14:40:20 +0000
committerChristian Neumair <cneumair@src.gnome.org>2009-02-20 14:40:20 +0000
commit51e71c6a6bcbf063ed7237b1368fca1c108035a2 (patch)
tree9959fcb38de07e256c190ba06cfec268bae86723 /libnautilus-private/nautilus-file-operations.c
parent07eb59633ae355279f824db4c90e3cc56b9e5248 (diff)
downloadnautilus-51e71c6a6bcbf063ed7237b1368fca1c108035a2.tar.gz
Do not put "Link to ..." in front of symbolic links that are created in
2009-02-20 Christian Neumair <cneumair@gnome.org> * libnautilus-private/nautilus-file-operations.c (get_link_name), (link_file): Do not put "Link to ..." in front of symbolic links that are created in another directory via DND. Fixes #534432. svn path=/trunk/; revision=14982
Diffstat (limited to 'libnautilus-private/nautilus-file-operations.c')
-rw-r--r--libnautilus-private/nautilus-file-operations.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/libnautilus-private/nautilus-file-operations.c b/libnautilus-private/nautilus-file-operations.c
index dde651099..0dc2ce0fb 100644
--- a/libnautilus-private/nautilus-file-operations.c
+++ b/libnautilus-private/nautilus-file-operations.c
@@ -336,9 +336,9 @@ get_link_name (const char *name, int count, int max_length)
g_assert (name != NULL);
- if (count < 1) {
+ if (count < 0) {
g_warning ("bad count in get_link_name");
- count = 1;
+ count = 0;
}
if (count <= 2) {
@@ -349,6 +349,10 @@ get_link_name (const char *name, int count, int max_length)
default:
g_assert_not_reached ();
/* fall through */
+ case 0:
+ /* duplicate original file name */
+ format = _("%s");
+ break;
case 1:
/* appended to new link file */
format = _("Link to %s");
@@ -4888,7 +4892,7 @@ link_file (CopyMoveJob *job,
GdkPoint *position,
int files_left)
{
- GFile *dest, *new_dest;
+ GFile *src_dir, *dest, *new_dest;
int count;
char *path;
gboolean not_local;
@@ -4900,7 +4904,14 @@ link_file (CopyMoveJob *job,
common = (CommonJob *)job;
- count = 1;
+ count = 0;
+
+ src_dir = g_file_get_parent (src);
+ if (src_dir == dest_dir) {
+ count = 1;
+ }
+ g_object_unref (src_dir);
+
handled_invalid_filename = *dest_fs_type != NULL;
dest = get_target_file_for_link (src, dest_dir, *dest_fs_type, count);