1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 20:27:45 +00:00

FileManager+LibGUI+html: Add an icon to represent HTML files

This also becomes the app icon for the little "html" program. :^)
This commit is contained in:
Andreas Kling 2019-09-29 21:00:41 +02:00
parent e38b454e11
commit 3900eebf15
6 changed files with 36 additions and 0 deletions

View file

@ -53,6 +53,16 @@ void DirectoryView::handle_activation(const GModelIndex& index)
return;
}
if (path.to_lowercase().ends_with(".html")) {
if (fork() == 0) {
int rc = execl("/bin/html", "/bin/html", path.characters(), nullptr);
if (rc < 0)
perror("exec");
ASSERT_NOT_REACHED();
}
return;
}
if (path.to_lowercase().ends_with(".wav")) {
if (fork() == 0) {
int rc = execl("/bin/SoundPlayer", "/bin/SoundPlayer", path.characters(), nullptr);