summaryrefslogtreecommitdiff
path: root/Applications
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-09-29 21:00:41 +0200
committerAndreas Kling <awesomekling@gmail.com>2019-09-29 21:00:41 +0200
commit3900eebf15683d160047cb7ef7755fa6c1313ef2 (patch)
tree2cbd7527ac76bb510b8d373081704c56f43c1955 /Applications
parente38b454e110d85c893e6cdc71fd71467562ec9c1 (diff)
downloadserenity-3900eebf15683d160047cb7ef7755fa6c1313ef2.zip
FileManager+LibGUI+html: Add an icon to represent HTML files
This also becomes the app icon for the little "html" program. :^)
Diffstat (limited to 'Applications')
-rw-r--r--Applications/FileManager/DirectoryView.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/Applications/FileManager/DirectoryView.cpp b/Applications/FileManager/DirectoryView.cpp
index 326fae02ab..1243d3bee7 100644
--- a/Applications/FileManager/DirectoryView.cpp
+++ b/Applications/FileManager/DirectoryView.cpp
@@ -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);