diff options
author | Alexander Larsson <alexl@redhat.com> | 2008-02-13 12:22:39 +0000 |
---|---|---|
committer | Alexander Larsson <alexl@src.gnome.org> | 2008-02-13 12:22:39 +0000 |
commit | 454b224ec78d740ae46673869f22ce1a7294c7db (patch) | |
tree | 7b229c9e8a2da61cf424de7b27d5c080b421ddd5 /libnautilus-private/nautilus-dnd.c | |
parent | 13b72557feb3128f8efdcec8cc9abc82479a0928 (diff) | |
download | nautilus-454b224ec78d740ae46673869f22ce1a7294c7db.tar.gz |
Add nautilus_file_is_launcher()
2008-02-13 Alexander Larsson <alexl@redhat.com>
* libnautilus-private/nautilus-file.[ch]:
* libnautilus-private/nautilus-file-private.h:
Add nautilus_file_is_launcher()
* libnautilus-private/nautilus-directory-async.c:
* libnautilus-private/nautilus-dnd.c:
* libnautilus-private/nautilus-link.[ch]
* libnautilus-private/nautilus-mime-actions.c:
* libnautilus-private/nautilus-program-choosing.[ch]:
* src/file-manager/fm-directory-view.c:
* src/file-manager/fm-tree-view.c:
Remove weird desktop-file: and command: hacks, and
replace with usage and implementation of
nautilus_file_is_launcher().
This fixes some problems where the old desktop-file uri
was interpreted as an actual file.
svn path=/trunk/; revision=13734
Diffstat (limited to 'libnautilus-private/nautilus-dnd.c')
-rw-r--r-- | libnautilus-private/nautilus-dnd.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/libnautilus-private/nautilus-dnd.c b/libnautilus-private/nautilus-dnd.c index baeef00f7..accb87294 100644 --- a/libnautilus-private/nautilus-dnd.c +++ b/libnautilus-private/nautilus-dnd.c @@ -368,6 +368,7 @@ nautilus_drag_default_drop_action_for_icons (GdkDragContext *context, const char *dropped_uri; GFile *target, *dropped; GdkDragAction actions; + NautilusFile *target_file; if (target_uri_string == NULL) { *action = 0; @@ -388,6 +389,7 @@ nautilus_drag_default_drop_action_for_icons (GdkDragContext *context, } dropped_uri = ((NautilusDragSelectionItem *)items->data)->uri; + target_file = nautilus_file_get_existing_by_uri (dropped_uri); /* * Check for trash URI. We do a find_directory for any Trash directory. @@ -400,13 +402,14 @@ nautilus_drag_default_drop_action_for_icons (GdkDragContext *context, *action = GDK_ACTION_MOVE; } + nautilus_file_unref (target_file); return; - } else if (g_str_has_prefix (target_uri_string, NAUTILUS_COMMAND_SPECIFIER) || - g_str_has_prefix (target_uri_string, NAUTILUS_DESKTOP_COMMAND_SPECIFIER) ) { + } else if (target_file != NULL && nautilus_file_is_launcher (target_file)) { if (actions & GDK_ACTION_MOVE) { *action = GDK_ACTION_MOVE; } + nautilus_file_unref (target_file); return; } else if (eel_uri_is_desktop (target_uri_string)) { target = nautilus_get_desktop_location (); @@ -416,12 +419,15 @@ nautilus_drag_default_drop_action_for_icons (GdkDragContext *context, *action = GDK_ACTION_MOVE; } + nautilus_file_unref (target_file); return; } } else { target = g_file_new_for_uri (target_uri_string); } + nautilus_file_unref (target_file); + /* Compare the first dropped uri with the target uri for same fs match. */ dropped = g_file_new_for_uri (dropped_uri); same_fs = check_same_fs (target, dropped); |