diff options
author | Alexander Larsson <alexl@src.gnome.org> | 2002-07-22 16:36:40 +0000 |
---|---|---|
committer | Alexander Larsson <alexl@src.gnome.org> | 2002-07-22 16:36:40 +0000 |
commit | a0cde05ec63f2f07fd1bde0e44bb2b57a3c9a61a (patch) | |
tree | a8f21366683ccb6cee57051edb4a4bf0b2f3a18a | |
parent | f669811a6562f8472f7d37b62d53eda803fbe442 (diff) | |
download | nautilus-a0cde05ec63f2f07fd1bde0e44bb2b57a3c9a61a.tar.gz |
i2002-07-22 Alexander Larsson <alexl@redhat.com>
* libnautilus-private/nautilus-file.c (rename_guts):
Allow renaming desktop files to have a slash in them.
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | libnautilus-private/nautilus-file.c | 15 |
2 files changed, 16 insertions, 4 deletions
@@ -1,5 +1,10 @@ 2002-07-22 Alexander Larsson <alexl@redhat.com> + * libnautilus-private/nautilus-file.c (rename_guts): + Allow renaming desktop files to have a slash in them. + +2002-07-22 Alexander Larsson <alexl@redhat.com> + * components/history/Nautilus_View_history.server.in.in: * components/notes/Nautilus_View_notes.server.in.in: Fix wrong location. diff --git a/libnautilus-private/nautilus-file.c b/libnautilus-private/nautilus-file.c index 0d8819f60..edbdccde1 100644 --- a/libnautilus-private/nautilus-file.c +++ b/libnautilus-private/nautilus-file.c @@ -976,13 +976,21 @@ rename_guts (NautilusFile *file, GnomeVFSURI *vfs_uri; char *uri; gboolean success; + gboolean is_local_desktop_file; g_return_if_fail (NAUTILUS_IS_FILE (file)); g_return_if_fail (new_name != NULL); g_return_if_fail (callback != NULL); - /* Return an error for incoming names containing path separators. */ - if (strstr (new_name, "/") != NULL) { + is_local_desktop_file = + (nautilus_file_is_mime_type (file, "application/x-gnome-app-info") || + nautilus_file_is_mime_type (file, "application/x-desktop")) && + has_local_path (file); + + /* Return an error for incoming names containing path separators. + * But not for .desktop files as '/' are allowed for them */ + uri = nautilus_file_get_uri (file); + if (strstr (new_name, "/") != NULL && !is_local_desktop_file) { (* callback) (file, GNOME_VFS_ERROR_NOT_PERMITTED, callback_data); return; } @@ -1025,8 +1033,7 @@ rename_guts (NautilusFile *file, return; } - if (nautilus_file_is_mime_type (file, "application/x-gnome-app-info") && - nautilus_file_is_local (file)) { + if (is_local_desktop_file) { uri = nautilus_file_get_uri (file); success = nautilus_link_desktop_file_local_set_text (uri, new_name); g_free (uri); |