diff options
author | Darin Adler <darin@src.gnome.org> | 2001-05-03 17:33:17 +0000 |
---|---|---|
committer | Darin Adler <darin@src.gnome.org> | 2001-05-03 17:33:17 +0000 |
commit | 6de9bc5e739cdb40cd260280401e4b140185f58d (patch) | |
tree | b71c22e6bc8a1fdb27016abbaab3d4a667ba5c56 /libnautilus-private/nautilus-link.c | |
parent | 003ab2da6cafd5d7b95944bae8e249ac8e6beae7 (diff) | |
download | nautilus-6de9bc5e739cdb40cd260280401e4b140185f58d.tar.gz |
reviewed by: John Sullivan <sullivan@eazel.com>
Fixed bug 8230 (launchers dragged from panel don't get icons as
they did in Ximian's Nautilus 1.0.2):
* libnautilus-extensions/nautilus-link.c:
(nautilus_link_local_create_from_gnome_entry): Changed to use
eel_make_uri_from_half_baked_uri so we can handle the kind of
"URI"s that are in most .desktop files. Also did a lot of code
cleanup.
* src/file-manager/fm-desktop-icon-view.c:
(icon_view_handle_uri_list): Changed to use
eel_make_uri_from_half_baked_uri so we can handle the kind of
"URI"s that are passed when dragging from old programs. Also did a
lot of code cleanup.
Diffstat (limited to 'libnautilus-private/nautilus-link.c')
-rw-r--r-- | libnautilus-private/nautilus-link.c | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/libnautilus-private/nautilus-link.c b/libnautilus-private/nautilus-link.c index 8d00b5bef..545fe493b 100644 --- a/libnautilus-private/nautilus-link.c +++ b/libnautilus-private/nautilus-link.c @@ -497,26 +497,24 @@ nautilus_link_local_is_trash_link (const char *path) void nautilus_link_local_create_from_gnome_entry (GnomeDesktopEntry *entry, const char *dest_path, const GdkPoint *position) { - const char *icon_name; + char *icon_name; char *launch_string, *terminal_command; char *quoted, *arguments, *temp_str; - gboolean create_link; - int index; + int i; if (entry == NULL || dest_path == NULL) { return; } - create_link = TRUE; - - /* Extract arguments from exec array */ - for (index = 0, arguments = NULL; index < entry->exec_length; ++index) { - quoted = eel_shell_quote (entry->exec[index]); + /* Extract arguments from exec array */ + arguments = NULL; + for (i = 0; i < entry->exec_length; ++i) { + quoted = eel_shell_quote (entry->exec[i]); if (arguments == NULL) { arguments = quoted; } else { temp_str = arguments; - arguments = g_strdup_printf ("%s %s", temp_str, quoted); + arguments = g_strconcat (arguments, " ", quoted, NULL); g_free (temp_str); g_free (quoted); } @@ -535,21 +533,20 @@ nautilus_link_local_create_from_gnome_entry (GnomeDesktopEntry *entry, const cha } else { /* Unknown .desktop file type */ launch_string = NULL; - create_link = TRUE; } if (entry->icon != NULL) { - icon_name = entry->icon; + icon_name = eel_make_uri_from_half_baked_uri (entry->icon); } else { - icon_name = "gnome-unknown.png"; + icon_name = g_strdup ("gnome-unknown.png"); } - if (create_link) { + if (launch_string != NULL) { nautilus_link_local_create (dest_path, entry->name, icon_name, launch_string, position, NAUTILUS_LINK_GENERIC); } - + + g_free (icon_name); g_free (launch_string); g_free (arguments); } - |