Skip to content

Commit 75cdf73

Browse files
committed
nemo-view.c: Follow the same invocation rules for bulk renaming as
we do for normal renaming. If any part of the selection is read-only, disable renaming.
1 parent e4ff79b commit 75cdf73

1 file changed

Lines changed: 18 additions & 6 deletions

File tree

src/nemo-view.c

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9661,12 +9661,24 @@ real_update_menus (NemoView *view)
96619661
is_desktop_view = get_is_desktop_view (view);
96629662
trash_supported = eel_vfs_supports_uri_scheme ("trash");
96639663

9664-
action = gtk_action_group_get_action (view->details->dir_action_group,
9665-
NEMO_ACTION_RENAME);
9666-
/* rename sensitivity depending on selection */
9667-
if (selection_count > 1) {
9668-
/* If multiple files are selected, sensitivity depends on whether a bulk renamer is registered. */
9669-
gtk_action_set_sensitive (action, have_bulk_rename_tool ());
9664+
action = gtk_action_group_get_action (view->details->dir_action_group,
9665+
NEMO_ACTION_RENAME);
9666+
/* rename sensitivity depending on selection */
9667+
if (selection_count > 1) {
9668+
GList *ptr;
9669+
gboolean can_rename = TRUE;
9670+
9671+
for (ptr = selection; ptr != NULL; ptr = ptr->next) {
9672+
NemoFile *item = NEMO_FILE (ptr->data);
9673+
// Favorites can be renamed, but only one at a time - bulk renamers don't know about the
9674+
// xapp favorites api.
9675+
if (!nemo_view_can_rename_file (view, item) || nemo_file_is_in_favorites (item)) {
9676+
can_rename = FALSE;
9677+
break;
9678+
}
9679+
}
9680+
9681+
gtk_action_set_sensitive (action, can_rename);
96709682
} else {
96719683
gtk_action_set_sensitive (action,
96729684
selection_count == 1 &&

0 commit comments

Comments
 (0)