Commit 7bbdb3ad authored by Alexander Larsson's avatar Alexander Larsson Committed by Alexander Larsson

Make nautilus_link_desktop_file_local_create take both display name and

2004-10-12  Alexander Larsson  <alexl@redhat.com>

	* libnautilus-private/nautilus-link-desktop-file.[ch]:
	Make nautilus_link_desktop_file_local_create take both
	display name and file name.
	* libnautilus-private/nautilus-link.[ch]:
	Make nautilus_link_local_create take both
	display name and file name.
	* src/file-manager/fm-icon-view.c: (icon_view_handle_uri_list):
	Create desktop file ending in ".desktop".
parent bd2cd41b
2004-10-12 Alexander Larsson <alexl@redhat.com>
* libnautilus-private/nautilus-link-desktop-file.[ch]:
Make nautilus_link_desktop_file_local_create take both
display name and file name.
* libnautilus-private/nautilus-link.[ch]:
Make nautilus_link_local_create take both
display name and file name.
* src/file-manager/fm-icon-view.c: (icon_view_handle_uri_list):
Create desktop file ending in ".desktop".
2004-10-12 Alexander Larsson <alexl@redhat.com>
* src/file-manager/fm-directory-view.c (activate_check_mime_types):
......
......@@ -97,7 +97,8 @@ slurp_key_string (const char *uri,
gboolean
nautilus_link_desktop_file_local_create (const char *directory_uri,
const char *name,
const char *file_name,
const char *display_name,
const char *image,
const char *target_uri,
const GdkPoint *point,
......@@ -110,10 +111,11 @@ nautilus_link_desktop_file_local_create (const char *directory_uri,
NautilusFileChangesQueuePosition item;
g_return_val_if_fail (directory_uri != NULL, FALSE);
g_return_val_if_fail (name != NULL, FALSE);
g_return_val_if_fail (file_name != NULL, FALSE);
g_return_val_if_fail (display_name != NULL, FALSE);
g_return_val_if_fail (target_uri != NULL, FALSE);
escaped_name = gnome_vfs_escape_string (name);
escaped_name = gnome_vfs_escape_string (file_name);
uri = g_strdup_printf ("%s/%s", directory_uri, escaped_name);
g_free (escaped_name);
......@@ -123,7 +125,7 @@ nautilus_link_desktop_file_local_create (const char *directory_uri,
"Type=%s\n"
"URL=%s\n"
"%s%s\n",
name,
display_name,
get_tag (type),
target_uri,
image != NULL ? "X-Nautilus-Icon=" : "",
......
......@@ -28,7 +28,8 @@
#include <libnautilus-private/nautilus-link.h>
gboolean nautilus_link_desktop_file_local_create (const char *directory_uri,
const char *name,
const char *file_name,
const char *display_name,
const char *image,
const char *target_uri,
const GdkPoint *point,
......
......@@ -109,7 +109,8 @@ get_link_style_for_data (const char *file_contents, int file_size)
gboolean
nautilus_link_local_create (const char *directory_uri,
const char *name,
const char *file_name,
const char *display_name,
const char *image,
const char *target_uri,
const GdkPoint *point,
......@@ -117,7 +118,8 @@ nautilus_link_local_create (const char *directory_uri,
NautilusLinkType type)
{
return nautilus_link_desktop_file_local_create (directory_uri,
name, image,
file_name,
display_name, image,
target_uri,
point, screen,
type);
......
......@@ -42,7 +42,8 @@ typedef enum {
* Returns TRUE if it succeeds, FALSE if it fails.
*/
gboolean nautilus_link_local_create (const char *directory_uri,
const char *name,
const char *file_name,
const char *display_name,
const char *image,
const char *target_uri,
const GdkPoint *point,
......
......@@ -2601,6 +2601,7 @@ icon_view_handle_uri_list (NautilusIconContainer *container, const char *item_ur
char *container_uri;
char *mime_type;
const char *last_slash, *link_name;
char *link_file_name;
int n_uris, n_links;
gboolean all_local;
GArray *points;
......@@ -2742,12 +2743,16 @@ icon_view_handle_uri_list (NautilusIconContainer *container, const char *item_ur
link_name = last_slash == NULL ? NULL : last_slash + 1;
if (!eel_str_is_empty (link_name)) {
link_file_name = g_strconcat (link_name, ".desktop", NULL);
/* FIXME: Handle name conflicts? */
nautilus_link_local_create (container_uri, link_name,
nautilus_link_local_create (container_uri,
link_file_name,
link_name,
NULL, uri,
(n_links > 0) ? NULL: &point,
screen_num,
NAUTILUS_LINK_GENERIC);
g_free (link_file_name);
}
n_links++;
......
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