summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@src.gnome.org>2002-07-22 16:36:40 +0000
committerAlexander Larsson <alexl@src.gnome.org>2002-07-22 16:36:40 +0000
commita0cde05ec63f2f07fd1bde0e44bb2b57a3c9a61a (patch)
treea8f21366683ccb6cee57051edb4a4bf0b2f3a18a
parentf669811a6562f8472f7d37b62d53eda803fbe442 (diff)
downloadnautilus-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--ChangeLog5
-rw-r--r--libnautilus-private/nautilus-file.c15
2 files changed, 16 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 6ab6bb053..a510c8513 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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);