mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 13:28:11 +00:00
FileManager+HackStudio+SpaceAnalyzer: Use File::can_delete_or_move
This commit is contained in:
parent
b810f7f88a
commit
e45434c0c7
3 changed files with 3 additions and 13 deletions
|
@ -1245,7 +1245,7 @@ void HackStudioWidget::configure_project_tree_view()
|
|||
|
||||
auto selections = m_project_tree_view->selection().indices();
|
||||
auto it = selections.find_if([&](auto selected_file) {
|
||||
return access(m_project->model().full_path(selected_file.parent()).characters(), W_OK) == 0;
|
||||
return Core::File::can_delete_or_move(m_project->model().full_path(selected_file));
|
||||
});
|
||||
bool has_permissions = it != selections.end();
|
||||
m_tree_view_rename_action->set_enabled(has_permissions);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue