FileManager: Display message box if stat()'ing a file to activate fails

This commit is contained in:
Maciej 2022-12-14 16:43:05 +01:00 committed by Linus Groh
parent 569a035786
commit b409d3cf88
Notes: sideshowbarker 2024-07-17 03:18:29 +09:00

View file

@ -102,6 +102,8 @@ void DirectoryView::handle_activation(GUI::ModelIndex const& index)
struct stat st;
if (stat(path.characters(), &st) < 0) {
perror("stat");
auto error_message = DeprecatedString::formatted("Could not stat {}: {}", path, strerror(errno));
GUI::MessageBox::show(window(), error_message, "File Manager"sv, GUI::MessageBox::Type::Error);
return;
}