Commit bef04d93 authored by Christian Neumair's avatar Christian Neumair Committed by Christian Neumair
Browse files

Rename nautilus_drag_default_drop_action_for_url to

2006-07-25  Christian Neumair  <chris@gnome-de.org>

	* libnautilus-private/nautilus-dnd.c:
	Rename nautilus_drag_default_drop_action_for_url to
	nautilus_drag_default_drop_action_for_netscape_url.
	Don't offer netscape URL drags.

	* libnautilus-private/nautilus-dnd.h: Rename
	NAUTILUS_ICON_DND_URL(_TYPE) to NAUTILUS_ICON_DND_NETSCAPE_URL(_TYPE)
	and nautilus_drag_default_drop_action_for_url to
	nautilus_drag_default_drop_action_for_netscape_url.

	* libnautilus-private/nautilus-file-operations.c:
	(nautilus_file_operations_new_file_from_template):
	Filter out special URIs, handle gnome_vfs_uri_new() failure.

	* libnautilus-private/nautilus-file-utilities.c:
	(test_uri_exists), (nautilus_ensure_unique_file_name):
	Handle gnome_vfs_uri_new() failure by returning NULL.

	* libnautilus-private/nautilus-icon-container.c:
	* libnautilus-private/nautilus-icon-container.h:
	Rename HANDLE_URL signal to HANDLE_NETSCAPE_URL.

	* libnautilus-private/nautilus-icon-dnd.c:
	* libnautilus-private/nautilus-icon-dnd.h:
	* libnautilus-private/nautilus-tree-view-drag-dest.c:
	* libnautilus-private/nautilus-tree-view-drag-dest.h:
	Don't offer netscape URL drags, prefer netscape URL drops over
	"text/uri-list" drops. Also rename DND_URL symbols to DND_NETSCAPE_URL.

	* libnautilus-private/nautilus-link-desktop-file.c:
	(nautilus_link_desktop_file_local_create):
	Handle trash, desktop and search URIs, handle
	NULL retval of nautilus_ensure_unique_file_name.

	* src/nautilus-location-bar.c:
	* src/nautilus-spatial-window.c:
	* src/file-manager/fm-list-model.c:
	Don't offer/handle netscape URL drags.

	* src/file-manager/fm-directory-view.h:
	* src/file-manager/fm-icon-view.c:
	* src/file-manager/fm-list-view:
	Rename DND_URL symbols to DND_NETSCAPE_URL.

	Should fix #347673.
parent 094edd3c
2006-07-25 Christian Neumair <chris@gnome-de.org>
* libnautilus-private/nautilus-dnd.c:
Rename nautilus_drag_default_drop_action_for_url to
nautilus_drag_default_drop_action_for_netscape_url.
Don't offer netscape URL drags.
* libnautilus-private/nautilus-dnd.h: Rename
NAUTILUS_ICON_DND_URL(_TYPE) to NAUTILUS_ICON_DND_NETSCAPE_URL(_TYPE)
and nautilus_drag_default_drop_action_for_url to
nautilus_drag_default_drop_action_for_netscape_url.
* libnautilus-private/nautilus-file-operations.c:
(nautilus_file_operations_new_file_from_template):
Filter out special URIs, handle gnome_vfs_uri_new() failure.
* libnautilus-private/nautilus-file-utilities.c:
(test_uri_exists), (nautilus_ensure_unique_file_name):
Handle gnome_vfs_uri_new() failure by returning NULL.
* libnautilus-private/nautilus-icon-container.c:
* libnautilus-private/nautilus-icon-container.h:
Rename HANDLE_URL signal to HANDLE_NETSCAPE_URL.
* libnautilus-private/nautilus-icon-dnd.c:
* libnautilus-private/nautilus-icon-dnd.h:
* libnautilus-private/nautilus-tree-view-drag-dest.c:
* libnautilus-private/nautilus-tree-view-drag-dest.h:
Don't offer netscape URL drags, prefer netscape URL drops over
"text/uri-list" drops. Also rename DND_URL symbols to DND_NETSCAPE_URL.
* libnautilus-private/nautilus-link-desktop-file.c:
(nautilus_link_desktop_file_local_create):
Handle trash, desktop and search URIs, handle
NULL retval of nautilus_ensure_unique_file_name.
* src/nautilus-location-bar.c:
* src/nautilus-spatial-window.c:
* src/file-manager/fm-list-model.c:
Don't offer/handle netscape URL drags.
* src/file-manager/fm-directory-view.h:
* src/file-manager/fm-icon-view.c:
* src/file-manager/fm-list-view:
Rename DND_URL symbols to DND_NETSCAPE_URL.
Should fix #347673.
2006-07-25 Alexander Larsson <alexl@redhat.com>
* libnautilus-private/nautilus-file.c (nautilus_file_get_selinux_context):
......
......@@ -288,7 +288,7 @@ nautilus_drag_items_on_desktop (const GList *selection_list)
}
GdkDragAction
nautilus_drag_default_drop_action_for_url (GdkDragContext *context)
nautilus_drag_default_drop_action_for_netscape_url (GdkDragContext *context)
{
/* Mozilla defaults to copy, but unless thats the
only allowed thing (enforced by ctrl) we want to ASK */
......@@ -423,23 +423,6 @@ add_one_gnome_icon (const char *uri, int x, int y, int w, int h,
g_free (s);
}
/* Encode a "_NETSCAPE_URL_" selection.
* As far as I can tell, Netscape is expecting a single
* URL to be returned. I cannot discover a way to construct
* a list to be returned that Netscape can understand.
* GMC also fails to do this as well.
*/
static void
add_one_netscape_url (const char *url, int x, int y, int w, int h, gpointer data)
{
GString *result;
result = (GString *) data;
if (result->len == 0) {
g_string_append (result, url);
}
}
/*
* Cf. #48423
*/
......@@ -549,12 +532,7 @@ nautilus_drag_drag_data_get (GtkWidget *widget,
result = g_string_new (NULL);
(* each_selected_item_iterator) (add_one_uri, container_context, result);
break;
case NAUTILUS_ICON_DND_URL:
result = g_string_new (NULL);
(* each_selected_item_iterator) (add_one_netscape_url, container_context, result);
break;
default:
return FALSE;
}
......
......@@ -32,7 +32,7 @@
/* Drag & Drop target names. */
#define NAUTILUS_ICON_DND_GNOME_ICON_LIST_TYPE "x-special/gnome-icon-list"
#define NAUTILUS_ICON_DND_URI_LIST_TYPE "text/uri-list"
#define NAUTILUS_ICON_DND_URL_TYPE "_NETSCAPE_URL"
#define NAUTILUS_ICON_DND_NETSCAPE_URL_TYPE "_NETSCAPE_URL"
#define NAUTILUS_ICON_DND_COLOR_TYPE "application/x-color"
#define NAUTILUS_ICON_DND_BGIMAGE_TYPE "property/bgimage"
#define NAUTILUS_ICON_DND_KEYWORD_TYPE "property/keyword"
......@@ -51,7 +51,7 @@ typedef struct {
typedef enum {
NAUTILUS_ICON_DND_GNOME_ICON_LIST,
NAUTILUS_ICON_DND_URI_LIST,
NAUTILUS_ICON_DND_URL,
NAUTILUS_ICON_DND_NETSCAPE_URL,
NAUTILUS_ICON_DND_COLOR,
NAUTILUS_ICON_DND_BGIMAGE,
NAUTILUS_ICON_DND_KEYWORD,
......@@ -120,7 +120,7 @@ void nautilus_drag_default_drop_action_for_icons (GdkDrag
const char *target_uri,
const GList *items,
int *action);
GdkDragAction nautilus_drag_default_drop_action_for_url (GdkDragContext *context);
GdkDragAction nautilus_drag_default_drop_action_for_netscape_url (GdkDragContext *context);
gboolean nautilus_drag_drag_data_get (GtkWidget *widget,
GdkDragContext *context,
GtkSelectionData *selection_data,
......
......@@ -111,7 +111,7 @@ nautilus_drag_can_accept_info (NautilusFile *drop_target_item,
return nautilus_drag_can_accept_items (drop_target_item, items);
case NAUTILUS_ICON_DND_URI_LIST:
case NAUTILUS_ICON_DND_URL:
case NAUTILUS_ICON_DND_NETSCAPE_URL:
case NAUTILUS_ICON_DND_TEXT:
return nautilus_drag_can_accept_files (drop_target_item);
......
......@@ -2559,7 +2559,21 @@ nautilus_file_operations_new_file_from_template (GtkWidget *parent_view,
g_assert (template_uri != NULL);
/* pass in the target directory and the new folder name as a destination URI */
parent_uri = gnome_vfs_uri_new (parent_dir);
if (eel_uri_is_desktop (parent_dir)) {
tmp = nautilus_get_desktop_directory_uri ();
parent_uri = gnome_vfs_uri_new (tmp);
g_free (tmp);
} else if (eel_uri_is_trash (parent_dir) ||
eel_uri_is_search (parent_dir)) {
parent_uri = NULL;
} else {
parent_uri = gnome_vfs_uri_new (parent_dir);
}
if (parent_uri == NULL) {
(*done_callback) (NULL, data);
return;
}
source_uri = gnome_vfs_uri_new (template_uri);
if (source_uri == NULL) {
......
......@@ -444,17 +444,26 @@ nautilus_get_data_file_path (const char *partial_path)
return NULL;
}
static gboolean
/**
* < 0 invalid URI
* == 0 no
* > 0 yes
**/
static int
test_uri_exists (const char *path)
{
GnomeVFSURI *uri;
gboolean exists;
uri = gnome_vfs_uri_new (path);
exists = gnome_vfs_uri_exists (uri);
gnome_vfs_uri_unref (uri);
if (uri == NULL) {
return -1;
} else {
exists = gnome_vfs_uri_exists (uri);
gnome_vfs_uri_unref (uri);
return exists;
return exists ? 1 : 0;
}
}
char *
......@@ -463,7 +472,7 @@ nautilus_ensure_unique_file_name (const char *directory_uri,
const char *extension)
{
char *path, *escaped_name;
gboolean exists;
int exists;
int copy;
escaped_name = gnome_vfs_escape_string (base_name);
......@@ -475,7 +484,7 @@ nautilus_ensure_unique_file_name (const char *directory_uri,
exists = test_uri_exists (path);
copy = 1;
while (exists) {
while (exists > 0) {
g_free (path);
path = g_strdup_printf ("%s/%s-%d%s",
directory_uri,
......@@ -490,6 +499,11 @@ nautilus_ensure_unique_file_name (const char *directory_uri,
g_free (escaped_name);
if (exists < 0) {
g_free (path);
path = NULL;
}
return path;
}
......
......@@ -238,7 +238,7 @@ enum {
RENAMING_ICON,
LAYOUT_CHANGED,
MOVE_COPY_ITEMS,
HANDLE_URL,
HANDLE_NETSCAPE_URL,
HANDLE_URI_LIST,
HANDLE_TEXT,
PREVIEW,
......@@ -4589,12 +4589,12 @@ nautilus_icon_container_class_init (NautilusIconContainerClass *class)
GDK_TYPE_DRAG_ACTION,
G_TYPE_INT,
G_TYPE_INT);
signals[HANDLE_URL]
= g_signal_new ("handle_url",
signals[HANDLE_NETSCAPE_URL]
= g_signal_new ("handle_netscape_url",
G_TYPE_FROM_CLASS (class),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (NautilusIconContainerClass,
handle_url),
handle_netscape_url),
NULL, NULL,
nautilus_marshal_VOID__STRING_STRING_ENUM_INT_INT,
G_TYPE_NONE, 5,
......
......@@ -99,7 +99,7 @@ typedef struct {
GdkDragAction action,
int x,
int y);
void (* handle_url) (NautilusIconContainer *container,
void (* handle_netscape_url) (NautilusIconContainer *container,
const char *url,
const char *target_uri,
GdkDragAction action,
......
......@@ -64,13 +64,13 @@
static const GtkTargetEntry drag_types [] = {
{ NAUTILUS_ICON_DND_GNOME_ICON_LIST_TYPE, 0, NAUTILUS_ICON_DND_GNOME_ICON_LIST },
{ NAUTILUS_ICON_DND_URI_LIST_TYPE, 0, NAUTILUS_ICON_DND_URI_LIST },
{ NAUTILUS_ICON_DND_URL_TYPE, 0, NAUTILUS_ICON_DND_URL },
};
static const GtkTargetEntry drop_types [] = {
{ NAUTILUS_ICON_DND_GNOME_ICON_LIST_TYPE, 0, NAUTILUS_ICON_DND_GNOME_ICON_LIST },
/* prefer "_NETSCAPE_URL" over "text/uri-list" to satisfy web browsers. */
{ NAUTILUS_ICON_DND_NETSCAPE_URL_TYPE, 0, NAUTILUS_ICON_DND_NETSCAPE_URL },
{ NAUTILUS_ICON_DND_URI_LIST_TYPE, 0, NAUTILUS_ICON_DND_URI_LIST },
{ NAUTILUS_ICON_DND_URL_TYPE, 0, NAUTILUS_ICON_DND_URL },
{ NAUTILUS_ICON_DND_COLOR_TYPE, 0, NAUTILUS_ICON_DND_COLOR },
{ NAUTILUS_ICON_DND_BGIMAGE_TYPE, 0, NAUTILUS_ICON_DND_BGIMAGE },
{ NAUTILUS_ICON_DND_KEYWORD_TYPE, 0, NAUTILUS_ICON_DND_KEYWORD },
......@@ -622,7 +622,7 @@ receive_dropped_keyword (NautilusIconContainer *container, const char *keyword,
/* handle dropped url */
static void
receive_dropped_url (NautilusIconContainer *container, const char *encoded_url, GdkDragContext *context, int x, int y)
receive_dropped_netscape_url (NautilusIconContainer *container, const char *encoded_url, GdkDragContext *context, int x, int y)
{
char *drop_target;
......@@ -632,7 +632,7 @@ receive_dropped_url (NautilusIconContainer *container, const char *encoded_url,
drop_target = nautilus_icon_container_find_drop_target (container, context, x, y, NULL);
g_signal_emit_by_name (container, "handle_url",
g_signal_emit_by_name (container, "handle_netscape_url",
encoded_url,
drop_target,
context->action,
......@@ -1162,8 +1162,8 @@ nautilus_icon_container_get_drop_action (NautilusIconContainer *container,
}
break;
case NAUTILUS_ICON_DND_URL:
*action = nautilus_drag_default_drop_action_for_url (context);
case NAUTILUS_ICON_DND_NETSCAPE_URL:
*action = nautilus_drag_default_drop_action_for_netscape_url (context);
break;
case NAUTILUS_ICON_DND_COLOR:
......@@ -1629,7 +1629,7 @@ drag_data_received_callback (GtkWidget *widget,
break;
/* Netscape keeps sending us the data, even though we accept the first drag */
case NAUTILUS_ICON_DND_URL:
case NAUTILUS_ICON_DND_NETSCAPE_URL:
if (drag_info->selection_data != NULL) {
gtk_selection_data_free (drag_info->selection_data);
drag_info->selection_data = gtk_selection_data_copy (data);
......@@ -1670,8 +1670,8 @@ drag_data_received_callback (GtkWidget *widget,
(NAUTILUS_ICON_CONTAINER (widget),
(char *) data->data, x, y);
break;
case NAUTILUS_ICON_DND_URL:
receive_dropped_url
case NAUTILUS_ICON_DND_NETSCAPE_URL:
receive_dropped_netscape_url
(NAUTILUS_ICON_CONTAINER (widget),
(char *) data->data, context, x, y);
success = TRUE;
......
......@@ -87,6 +87,7 @@ nautilus_link_desktop_file_local_create (const char *directory_uri,
int screen,
gboolean unique_filename)
{
char *real_directory_uri;
char *uri, *contents, *escaped_name;
GnomeDesktopItem *desktop_item;
GList dummy_list;
......@@ -97,15 +98,32 @@ nautilus_link_desktop_file_local_create (const char *directory_uri,
g_return_val_if_fail (display_name != NULL, FALSE);
g_return_val_if_fail (target_uri != NULL, FALSE);
if (eel_uri_is_trash (directory_uri) ||
eel_uri_is_search (directory_uri)) {
return FALSE;
}
if (eel_uri_is_desktop (directory_uri)) {
real_directory_uri = nautilus_get_desktop_directory_uri ();
} else {
real_directory_uri = g_strdup (directory_uri);
}
if (unique_filename) {
uri = nautilus_ensure_unique_file_name (directory_uri,
uri = nautilus_ensure_unique_file_name (real_directory_uri,
base_name, ".desktop");
if (uri == NULL) {
g_free (real_directory_uri);
return FALSE;
}
} else {
escaped_name = gnome_vfs_escape_string (base_name);
uri = g_strdup_printf ("%s/%s.desktop", directory_uri, escaped_name);
uri = g_strdup_printf ("%s/%s.desktop", real_directory_uri, escaped_name);
g_free (escaped_name);
}
g_free (real_directory_uri);
contents = g_strdup_printf ("[Desktop Entry]\n"
"Encoding=UTF-8\n"
"Name=%s\n"
......
......@@ -63,7 +63,7 @@ enum {
GET_ROOT_URI,
GET_FILE_FOR_PATH,
MOVE_COPY_ITEMS,
HANDLE_URL,
HANDLE_NETSCAPE_URL,
HANDLE_URI_LIST,
HANDLE_TEXT,
LAST_SIGNAL
......@@ -80,8 +80,9 @@ GNOME_CLASS_BOILERPLATE (NautilusTreeViewDragDest,
static const GtkTargetEntry drag_types [] = {
{ NAUTILUS_ICON_DND_GNOME_ICON_LIST_TYPE, 0, NAUTILUS_ICON_DND_GNOME_ICON_LIST },
/* prefer "_NETSCAPE_URL" over "text/uri-list" to satisfy web browsers. */
{ NAUTILUS_ICON_DND_NETSCAPE_URL_TYPE, 0, NAUTILUS_ICON_DND_NETSCAPE_URL },
{ NAUTILUS_ICON_DND_URI_LIST_TYPE, 0, NAUTILUS_ICON_DND_URI_LIST },
{ NAUTILUS_ICON_DND_URL_TYPE, 0, NAUTILUS_ICON_DND_URL },
{ NAUTILUS_ICON_DND_KEYWORD_TYPE, 0, NAUTILUS_ICON_DND_KEYWORD }
};
......@@ -383,14 +384,14 @@ get_drop_action (NautilusTreeViewDragDest *dest,
return action;
case NAUTILUS_ICON_DND_URL:
case NAUTILUS_ICON_DND_NETSCAPE_URL:
drop_target = get_drop_target_uri_for_path (dest, path);
if (drop_target == NULL) {
return 0;
}
action = nautilus_drag_default_drop_action_for_url (context);
action = nautilus_drag_default_drop_action_for_netscape_url (context);
g_free (drop_target);
......@@ -668,9 +669,9 @@ receive_dropped_text (NautilusTreeViewDragDest *dest,
static void
receive_dropped_url (NautilusTreeViewDragDest *dest,
GdkDragContext *context,
int x, int y)
receive_dropped_netscape_url (NautilusTreeViewDragDest *dest,
GdkDragContext *context,
int x, int y)
{
char *drop_target;
......@@ -681,7 +682,7 @@ receive_dropped_url (NautilusTreeViewDragDest *dest,
drop_target = get_drop_target_uri_at_pos (dest, x, y);
g_assert (drop_target != NULL);
g_signal_emit (dest, signals[HANDLE_URL], 0,
g_signal_emit (dest, signals[HANDLE_NETSCAPE_URL], 0,
(char*)dest->details->drag_data->data,
drop_target,
context->action,
......@@ -749,8 +750,8 @@ drag_data_received_callback (GtkWidget *widget,
receive_dropped_icons (dest, context, x, y);
success = TRUE;
break;
case NAUTILUS_ICON_DND_URL :
receive_dropped_url (dest, context, x, y);
case NAUTILUS_ICON_DND_NETSCAPE_URL :
receive_dropped_netscape_url (dest, context, x, y);
success = TRUE;
break;
case NAUTILUS_ICON_DND_URI_LIST :
......@@ -899,12 +900,12 @@ nautilus_tree_view_drag_dest_class_init (NautilusTreeViewDragDestClass *class)
GDK_TYPE_DRAG_ACTION,
G_TYPE_INT,
G_TYPE_INT);
signals[HANDLE_URL] =
g_signal_new ("handle_url",
signals[HANDLE_NETSCAPE_URL] =
g_signal_new ("handle_netscape_url",
G_TYPE_FROM_CLASS (class),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (NautilusTreeViewDragDestClass,
handle_url),
handle_netscape_url),
NULL, NULL,
nautilus_marshal_VOID__STRING_STRING_ENUM_INT_INT,
G_TYPE_NONE, 5,
......
......@@ -64,7 +64,7 @@ struct _NautilusTreeViewDragDestClass {
GdkDragAction action,
int x,
int y);
void (* handle_url) (NautilusTreeViewDragDest *dest,
void (* handle_netscape_url) (NautilusTreeViewDragDest *dest,
const char *url,
const char *target_uri,
GdkDragAction action,
......
......@@ -9664,12 +9664,12 @@ ask_link_action (FMDirectoryView *view)
}
void
fm_directory_view_handle_url_drop (FMDirectoryView *view,
const char *encoded_url,
const char *target_uri,
GdkDragAction action,
int x,
int y)
fm_directory_view_handle_netscape_url_drop (FMDirectoryView *view,
const char *encoded_url,
const char *target_uri,
GdkDragAction action,
int x,
int y)
{
GdkPoint point;
GdkScreen *screen;
......
......@@ -408,7 +408,7 @@ void fm_directory_view_new_file (FMDirect
NautilusFile *source);
void fm_directory_view_ignore_hidden_file_preferences (FMDirectoryView *view);
void fm_directory_view_init_view_iface (NautilusViewIface *iface);
void fm_directory_view_handle_url_drop (FMDirectoryView *view,
void fm_directory_view_handle_netscape_url_drop (FMDirectoryView *view,
const char *encoded_url,
const char *target_uri,
GdkDragAction action,
......
......@@ -2526,12 +2526,12 @@ create_icon_container (FMIconView *icon_view)
/* Handles an URL received from Mozilla */
static void
icon_view_handle_url (NautilusIconContainer *container, const char *encoded_url,
const char *target_uri,
GdkDragAction action, int x, int y, FMIconView *view)
icon_view_handle_netscape_url (NautilusIconContainer *container, const char *encoded_url,
const char *target_uri,
GdkDragAction action, int x, int y, FMIconView *view)
{
fm_directory_view_handle_url_drop (FM_DIRECTORY_VIEW (view),
encoded_url, target_uri, action, x, y);
fm_directory_view_handle_netscape_url_drop (FM_DIRECTORY_VIEW (view),
encoded_url, target_uri, action, x, y);
}
static void
......@@ -2717,8 +2717,8 @@ fm_icon_view_init (FMIconView *icon_view)
labels_beside_icons_changed_callback,
icon_view, G_OBJECT (icon_view));
g_signal_connect_object (get_icon_container (icon_view), "handle_url",
G_CALLBACK (icon_view_handle_url), icon_view, 0);
g_signal_connect_object (get_icon_container (icon_view), "handle_netscape_url",
G_CALLBACK (icon_view_handle_netscape_url), icon_view, 0);
g_signal_connect_object (get_icon_container (icon_view), "handle_uri_list",
G_CALLBACK (icon_view_handle_uri_list), icon_view, 0);
g_signal_connect_object (get_icon_container (icon_view), "handle_text",
......
......@@ -94,7 +94,6 @@ struct FileEntry {
static const GtkTargetEntry drag_types [] = {
{ NAUTILUS_ICON_DND_GNOME_ICON_LIST_TYPE, 0, NAUTILUS_ICON_DND_GNOME_ICON_LIST },
{ NAUTILUS_ICON_DND_URI_LIST_TYPE, 0, NAUTILUS_ICON_DND_URI_LIST },
{ NAUTILUS_ICON_DND_URL_TYPE, 0, NAUTILUS_ICON_DND_URL },
};
static GtkTargetList *drag_target_list = NULL;
......
......@@ -1043,11 +1043,11 @@ get_file_for_path_callback (NautilusTreeViewDragDest *dest,
/* Handles an URL received from Mozilla */
static void
list_view_handle_url (NautilusTreeViewDragDest *dest, const char *encoded_url,
const char *target_uri, GdkDragAction action, int x, int y, FMListView *view)
list_view_handle_netscape_url (NautilusTreeViewDragDest *dest, const char *encoded_url,
const char *target_uri, GdkDragAction action, int x, int y, FMListView *view)
{
fm_directory_view_handle_url_drop (FM_DIRECTORY_VIEW (view),
encoded_url, target_uri, action, x, y);
fm_directory_view_handle_netscape_url_drop (FM_DIRECTORY_VIEW (view),
encoded_url, target_uri, action, x, y);
}
static void
......@@ -1217,8 +1217,8 @@ create_and_set_up_tree_view (FMListView *view)
"move_copy_items",
G_CALLBACK (move_copy_items_callback),
view, 0);
g_signal_connect_object (view->details->drag_dest, "handle_url",
G_CALLBACK (list_view_handle_url), view, 0);
g_signal_connect_object (view->details->drag_dest, "handle_netscape_url",
G_CALLBACK (list_view_handle_netscape_url), view, 0);
g_signal_connect_object (view->details->drag_dest, "handle_uri_list",
G_CALLBACK (list_view_handle_uri_list), view, 0);
g_signal_connect_object (view->details->drag_dest, "handle_text",
......
......@@ -55,7 +55,6 @@
#define NAUTILUS_DND_URI_LIST_TYPE "text/uri-list"
#define NAUTILUS_DND_TEXT_PLAIN_TYPE "text/plain"
#define NAUTILUS_DND_URL_TYPE "_NETSCAPE_URL"
static const char untranslated_location_label[] = N_("Location:");
static const char untranslated_go_to_label[] = N_("Go To:");
......@@ -78,20 +77,17 @@ enum {
NAUTILUS_DND_MC_DESKTOP_ICON,
NAUTILUS_DND_URI_LIST,
NAUTILUS_DND_TEXT_PLAIN,
NAUTILUS_DND_URL,
NAUTILUS_DND_NTARGETS
};
static const GtkTargetEntry drag_types [] = {
{ NAUTILUS_DND_URI_LIST_TYPE, 0, NAUTILUS_DND_URI_LIST },
{ NAUTILUS_DND_TEXT_PLAIN_TYPE, 0, NAUTILUS_DND_TEXT_PLAIN },
{ NAUTILUS_DND_URL_TYPE, 0, NAUTILUS_DND_URL }
};
static const GtkTargetEntry drop_types [] = {
{ NAUTILUS_DND_URI_LIST_TYPE, 0, NAUTILUS_DND_URI_LIST },
{ NAUTILUS_DND_TEXT_PLAIN_TYPE, 0, NAUTILUS_DND_TEXT_PLAIN },
{ NAUTILUS_DND_URL_TYPE, 0, NAUTILUS_DND_URL }
};
static char *nautilus_location_bar_get_location (NautilusNavigationBar *navigation_bar);
......@@ -217,7 +213,6 @@ drag_data_get_callback (GtkWidget *widget,
switch (info) {
case NAUTILUS_DND_URI_LIST:
case NAUTILUS_DND_TEXT_PLAIN:
case NAUTILUS_DND_URL:
gtk_selection_data_set (selection_data,
selection_data->target,
8, (guchar *) entry_text,
......
......@@ -110,7 +110,6 @@ struct _NautilusSpatialWindowDetails {
static const GtkTargetEntry location_button_drag_types[] = {
{ NAUTILUS_ICON_DND_GNOME_ICON_LIST_TYPE, 0, NAUTILUS_ICON_DND_GNOME_ICON_LIST },
{ NAUTILUS_ICON_DND_URI_LIST_TYPE, 0, NAUTILUS_ICON_DND_URI_LIST },
{ NAUTILUS_ICON_DND_URL_TYPE, 0, NAUTILUS_ICON_DND_URL },
};
GNOME_CLASS_BOILERPLATE (NautilusSpatialWindow, nautilus_spatial_window,
......
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