summaryrefslogtreecommitdiff
path: root/libnautilus-private
diff options
context:
space:
mode:
authorMartin Wehner <martin.wehner@gmail.com>2005-08-08 23:35:11 +0000
committerMartin Wehner <mwehner@src.gnome.org>2005-08-08 23:35:11 +0000
commit85e703eb939d1ff882235b32341fa78482fbbecd (patch)
treef9d748aee63dd34ef608ac635a55c4a7a216af2b /libnautilus-private
parentf3bb6d8387e5119e8955f8dda7f23a1fdbc03279 (diff)
downloadnautilus-85e703eb939d1ff882235b32341fa78482fbbecd.tar.gz
Don't allow renaming of the desktop folder. Closes #125637.
2005-08-09 Martin Wehner <martin.wehner@gmail.com> * libnautilus-private/nautilus-file.c: (file_is_desktop), (nautilus_file_can_rename): Don't allow renaming of the desktop folder. Closes #125637. Patch from Christian Neumair <chris@gnome-de.org>
Diffstat (limited to 'libnautilus-private')
-rw-r--r--libnautilus-private/nautilus-file.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/libnautilus-private/nautilus-file.c b/libnautilus-private/nautilus-file.c
index ec6d514d5..fc9e42ebe 100644
--- a/libnautilus-private/nautilus-file.c
+++ b/libnautilus-private/nautilus-file.c
@@ -810,6 +810,22 @@ nautilus_file_can_execute (NautilusFile *file)
}
static gboolean
+file_is_desktop (NautilusFile *file)
+{
+ GnomeVFSURI *dir_vfs_uri;
+
+ dir_vfs_uri = file->details->directory->details->vfs_uri;
+
+ if (dir_vfs_uri == NULL ||
+ strcmp (dir_vfs_uri->method_string, "file") != 0) {
+ return FALSE;
+ }
+
+ return nautilus_is_desktop_directory_file_escaped (dir_vfs_uri->text,
+ file->details->relative_uri);
+}
+
+static gboolean
is_desktop_file (NautilusFile *file)
{
return nautilus_file_is_mime_type (file, "application/x-desktop");
@@ -859,7 +875,7 @@ nautilus_file_can_rename (NautilusFile *file)
return FALSE;
}
- if (is_desktop_file (file) && !can_rename_desktop_file (file)) {
+ if ((is_desktop_file (file) && !can_rename_desktop_file (file)) || file_is_desktop (file)) {
return FALSE;
}
@@ -1878,22 +1894,6 @@ file_has_note (NautilusFile *file)
return res;
}
-static gboolean
-file_is_desktop (NautilusFile *file)
-{
- GnomeVFSURI *dir_vfs_uri;
-
- dir_vfs_uri = file->details->directory->details->vfs_uri;
-
- if (dir_vfs_uri == NULL ||
- strcmp (dir_vfs_uri->method_string, "file") != 0) {
- return FALSE;
- }
-
- return nautilus_is_desktop_directory_file_escaped (dir_vfs_uri->text,
- file->details->relative_uri);
-}
-
static GList *
prepend_automatic_emblem_names (NautilusFile *file,
GList *names)