[PATCH] Only consider selection when deciding whether deletion is possible
- From: Christian Neumair <chris gnome-de org>
- To: nautilus-list <nautilus-list gnome org>
- Subject: [PATCH] Only consider selection when deciding whether deletion is possible
- Date: Thu, 21 Dec 2006 20:49:37 +0100
Nautilus used to query whether the displayed location is readable when
deciding whether files are readable. It should rather consider the
selected files themselves.
Proposed patch attached, should fix bug 316301:
http://bugzilla.gnome.org/show_bug.cgi?id=316301
--
Christian Neumair <chris gnome-de org>
Index: src/file-manager/fm-directory-view.c
===================================================================
RCS file: /cvs/gnome/nautilus/src/file-manager/fm-directory-view.c,v
retrieving revision 1.754
diff -u -p -r1.754 fm-directory-view.c
--- src/file-manager/fm-directory-view.c 18 Dec 2006 09:32:21 -0000 1.754
+++ src/file-manager/fm-directory-view.c 21 Dec 2006 19:44:22 -0000
@@ -7610,6 +7660,25 @@ clipboard_changed_callback (NautilusClip
}
+static gboolean
+selection_can_write_all (FMDirectoryView *view)
+{
+ GList *selection, *l;
+
+ selection = fm_directory_view_get_selection (view);
+
+ for (l = selection; l != NULL; l = l->next) {
+ if (!nautilus_file_can_write (l->data)) {
+ return FALSE;
+ }
+ }
+
+ nautilus_file_list_free (selection);
+
+ return TRUE;
+}
+
+
static void
real_update_menus (FMDirectoryView *view)
{
@@ -7617,9 +7686,9 @@ real_update_menus (FMDirectoryView *view
gint selection_count;
const char *tip, *label;
char *label_with_underscore;
+ gboolean selection_can_write;
gboolean selection_contains_special_link;
gboolean selection_contains_desktop_or_home_dir;
- gboolean is_read_only;
gboolean can_create_files;
gboolean can_delete_files;
gboolean can_copy_files;
@@ -7642,11 +7711,11 @@ real_update_menus (FMDirectoryView *view
selection_contains_special_link = special_link_in_selection (view);
selection_contains_desktop_or_home_dir = desktop_or_home_dir_in_selection (view);
- is_read_only = fm_directory_view_is_read_only (view);
+ selection_can_write = selection_can_write_all (view);
can_create_files = fm_directory_view_supports_creating_files (view);
- can_delete_files = !is_read_only
- && selection_count != 0
+ can_delete_files = selection_count != 0
+ && selection_can_write
&& !selection_contains_special_link
&& !selection_contains_desktop_or_home_dir;
can_copy_files = selection_count != 0
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]