summaryrefslogtreecommitdiff
path: root/Userland/Applications/FileManager
diff options
context:
space:
mode:
authorKarol Kosek <krkk@serenityos.org>2021-10-09 17:55:55 +0200
committerLinus Groh <mail@linusgroh.de>2023-01-24 20:13:30 +0000
commit798154fbbca019a90a8b26b61cda4e6328511aad (patch)
tree40b48320ac05708f3b1f3923c1839609b95f8d47 /Userland/Applications/FileManager
parent4d9b4e13816b90e32822ef9f4926486dbdeec948 (diff)
downloadserenity-798154fbbca019a90a8b26b61cda4e6328511aad.zip
FileManager: Calculate file action permissions for subsequent columns
Previously, the permission for the action was always calculated according to the first column.
Diffstat (limited to 'Userland/Applications/FileManager')
-rw-r--r--Userland/Applications/FileManager/DirectoryView.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/Userland/Applications/FileManager/DirectoryView.cpp b/Userland/Applications/FileManager/DirectoryView.cpp
index 4dd5682f17..d9f571bebf 100644
--- a/Userland/Applications/FileManager/DirectoryView.cpp
+++ b/Userland/Applications/FileManager/DirectoryView.cpp
@@ -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()