diff options
author | Alexander Larsson <alexl@redhat.com> | 2006-08-08 09:16:56 +0000 |
---|---|---|
committer | Alexander Larsson <alexl@src.gnome.org> | 2006-08-08 09:16:56 +0000 |
commit | 4549b3ce9754bb3b592bb845052addd3694d8b14 (patch) | |
tree | 358187d4e344d487404bb543f4c1b8921787af28 | |
parent | 171c2a41a86c635e69f3f9779745e45f1ac1f5d1 (diff) | |
download | nautilus-4549b3ce9754bb3b592bb845052addd3694d8b14.tar.gz |
Handle desktop drops from panel. (#347673) Patch from Christian Neumair
2006-08-08 Alexander Larsson <alexl@redhat.com>
* libnautilus-private/nautilus-file-operations.c:
Handle desktop drops from panel. (#347673)
Patch from Christian Neumair
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | libnautilus-private/nautilus-file-operations.c | 20 |
2 files changed, 24 insertions, 2 deletions
@@ -1,3 +1,9 @@ +2006-08-08 Alexander Larsson <alexl@redhat.com> + + * libnautilus-private/nautilus-file-operations.c: + Handle desktop drops from panel. (#347673) + Patch from Christian Neumair + 2006-08-04 Martin Wehner <martin.wehner@gmail.com> * libnautilus-private/nautilus-directory-async.c: diff --git a/libnautilus-private/nautilus-file-operations.c b/libnautilus-private/nautilus-file-operations.c index e7f73545c..65c925b79 100644 --- a/libnautilus-private/nautilus-file-operations.c +++ b/libnautilus-private/nautilus-file-operations.c @@ -1916,6 +1916,12 @@ nautilus_file_operations_copy_move (const GList *item_uris, if (target_dir != NULL) { if (eel_uri_is_trash (target_dir)) { target_is_trash = TRUE; + } else if (eel_uri_is_desktop (target_dir)) { + char *desktop_dir_uri; + + desktop_dir_uri = nautilus_get_desktop_directory_uri (); + target_dir_uri = gnome_vfs_uri_new (desktop_dir_uri); + g_free (desktop_dir_uri); } else { target_dir_uri = gnome_vfs_uri_new (target_dir); } @@ -2368,10 +2374,20 @@ nautilus_file_operations_new_folder (GtkWidget *parent_view, NewFolderTransferState *state; SyncTransferInfo *sync_transfer_info; + g_assert (parent_dir != NULL); + /* pass in the target directory and the new folder name as a destination URI */ - parent_uri = gnome_vfs_uri_new (parent_dir); - /* localizers: the initial name of a new folder */ + if (eel_uri_is_desktop (parent_dir)) { + char *desktop_dir_uri; + desktop_dir_uri = nautilus_get_desktop_directory_uri (); + parent_uri = gnome_vfs_uri_new (desktop_dir_uri); + g_free (desktop_dir_uri); + } else { + parent_uri = gnome_vfs_uri_new (parent_dir); + } + + /* localizers: the initial name of a new folder */ dirname = g_filename_from_utf8 (_("untitled folder"), -1, NULL, NULL, NULL); uri = gnome_vfs_uri_append_file_name (parent_uri, dirname); g_free (dirname); |