HackStudio: Disable the Rename action on insufficient permissions

This patch will disable the Rename action in the project Tree View
if a user does not have write access to the selected file directory.
This commit is contained in:
Karol Kosek 2021-10-10 01:00:32 +02:00 committed by Andreas Kling
parent 0264d3de45
commit 5f3e9886f7
Notes: sideshowbarker 2024-07-18 00:53:05 +09:00

View File

@ -983,6 +983,7 @@ void HackStudioWidget::configure_project_tree_view()
return access(m_project->model().full_path(selected_file.parent()).characters(), W_OK) == 0;
});
bool has_permissions = it != selections.end();
m_tree_view_rename_action->set_enabled(has_permissions);
m_delete_action->set_enabled(has_permissions);
};