From 4549b3ce9754bb3b592bb845052addd3694d8b14 Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Tue, 8 Aug 2006 09:16:56 +0000 Subject: Handle desktop drops from panel. (#347673) Patch from Christian Neumair 2006-08-08 Alexander Larsson * libnautilus-private/nautilus-file-operations.c: Handle desktop drops from panel. (#347673) Patch from Christian Neumair --- ChangeLog | 6 ++++++ libnautilus-private/nautilus-file-operations.c | 20 ++++++++++++++++++-- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7d0e20c88..0d4ec4b63 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2006-08-08 Alexander Larsson + + * libnautilus-private/nautilus-file-operations.c: + Handle desktop drops from panel. (#347673) + Patch from Christian Neumair + 2006-08-04 Martin Wehner * 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); -- cgit v1.2.1