mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-10 13:00:29 +03:00
FileManager: Calculate file action permissions for subsequent columns
Previously, the permission for the action was always calculated according to the first column.
This commit is contained in:
parent
4d9b4e1381
commit
798154fbbc
Notes:
sideshowbarker
2024-07-17 01:18:18 +09:00
Author: https://github.com/krkk Commit: https://github.com/SerenityOS/serenity/commit/798154fbbc Pull-request: https://github.com/SerenityOS/serenity/pull/17006 Reviewed-by: https://github.com/kleinesfilmroellchen ✅
@ -551,7 +551,13 @@ void DirectoryView::do_delete(bool should_confirm)
|
||||
|
||||
bool DirectoryView::can_modify_current_selection()
|
||||
{
|
||||
return !current_view().selection().is_empty() && access(path().characters(), W_OK) == 0;
|
||||
auto selections = current_view().selection().indices();
|
||||
// FIXME: remove once Clang formats this properly.
|
||||
// clang-format off
|
||||
return selections.first_matching([&](auto& index) {
|
||||
return !Core::System::access(node(index.parent()).full_path(), W_OK).is_error();
|
||||
}).has_value();
|
||||
// clang-format on
|
||||
}
|
||||
|
||||
void DirectoryView::handle_selection_change()
|
||||
|
Loading…
Reference in New Issue
Block a user