diff options
author | Gene Z. Ragan <gzr@eazel.com> | 2000-07-27 02:56:18 +0000 |
---|---|---|
committer | Gene Ragan <gzr@src.gnome.org> | 2000-07-27 02:56:18 +0000 |
commit | 67e2690926f5d0517eaf6839a1b39f51919c48ad (patch) | |
tree | 01e7ba707c8e2e3dcb1e9c6f228eb1f51ad77e71 /libnautilus-private/nautilus-link-set.c | |
parent | b7fa3e6901e926221afa8c0e17ce5362c25cc6b4 (diff) | |
download | nautilus-67e2690926f5d0517eaf6839a1b39f51919c48ad.tar.gz |
Renamed function nautilus_link_is_link_file_name to
2000-07-26 Gene Z. Ragan <gzr@eazel.com>
* libnautilus-extensions/nautilus-link.c:
* libnautilus-extensions/nautilus-link.h:
(nautilus_link_is_link_file):
Renamed function nautilus_link_is_link_file_name to
nautilus_link_is_link_fileand modified it to determine if
it is a link file using mime magic. Function now takes
a NautilusFile * as the argument.
* libnautilus-extensions/nautilus-link-set.c: (link_set_path_name),
(create_new_link), (nautilus_link_set_is_installed),
(nautilus_link_set_remove):
Modified to use the new mime magic within the link file.
* libnautilus-extensions/nautilus-directory-async.c:
(activation_uri_gmc_link_read_callback):
Changed nautilus_link_is_link_file_name to nautilus_link_is_link_file.
* libnautilus-extensions/nautilus-directory.c:
(construct_alternate_metafile_uri):
Changed nautilus_link_is_link_file_name to nautilus_link_is_link_file.
* libnautilus-extensions/nautilus-file.c:
(nautilus_file_contains_text), (nautilus_file_activate_custom):
Changed nautilus_link_is_link_file_name to nautilus_link_is_link_file.
* libnautilus-extensions/nautilus-icon-factory.c:
(nautilus_icon_factory_get_icon_for_file):
Removed old way of identifying mount volume links in anticipation
of using mime magic.
* src/file-manager/fm-desktop-icon-view.c:
(fm_desktop_icon_view_initialize), (mount_device_mount),
(mount_device_floppy_add), (add_mount_device), (make_desktop_link),
(get_ext2_volume_name), (place_home_directory):
Removed old way of indentifying mount link files in anticipation
of using mime magic.
Work in progress on placing a home directory on the desktop.
Diffstat (limited to 'libnautilus-private/nautilus-link-set.c')
-rw-r--r-- | libnautilus-private/nautilus-link-set.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/libnautilus-private/nautilus-link-set.c b/libnautilus-private/nautilus-link-set.c index 646d73c80..3fd217c11 100644 --- a/libnautilus-private/nautilus-link-set.c +++ b/libnautilus-private/nautilus-link-set.c @@ -59,7 +59,7 @@ link_set_path_name (const char *directory_path, const char *name) path_start = directory_path + 7; else path_start = directory_path; - return g_strdup_printf ("%s/%s.link", path_start, name); + return g_strdup_printf ("%s/%s", path_start, name); } /* routine to create a new .link file in the specified directory */ @@ -77,12 +77,17 @@ create_new_link (const char *directory_path, const char *name, const char *image /* add the root node to the output document */ root_node = xmlNewDocNode (output_document, NULL, "NAUTILUS_OBJECT", NULL); xmlDocSetRootElement (output_document, root_node); - + + /* Add mime magic string so that the mime sniffer can recognize us. + * Note: The value of the tag has no meaning. */ + xmlSetProp (root_node, "NAUTILUS_LINK", "Nautilus Link"); + + /* Add link and custom icon tags */ xmlSetProp (root_node, "CUSTOM_ICON", image); xmlSetProp (root_node, "LINK", uri); /* all done, so save the xml document as a link file */ - file_name = link_set_path_name(directory_path, name); + file_name = link_set_path_name (directory_path, name); result = xmlSaveFile (file_name, output_document); g_free (file_name); @@ -187,7 +192,7 @@ nautilus_link_set_is_installed (const char *directory_path, const char *link_set node != NULL; node = node->next) { if (strcmp (node->name, "link") == 0) { link_name = xmlGetProp (node, "name"); - file_name = link_set_path_name(directory_path, link_name); + file_name = link_set_path_name (directory_path, link_name); if (!g_file_exists(file_name)) { g_free(file_name); return FALSE; @@ -222,7 +227,7 @@ nautilus_link_set_remove (const char *directory_path, const char *link_set_name) if (strcmp (node->name, "link") == 0) { link_name = xmlGetProp (node, "name"); /* formulate the link file path name */ - file_name = link_set_path_name(directory_path, link_name); + file_name = link_set_path_name (directory_path, link_name); /* delete the file */ unlink(file_name); g_free(link_name); |