1
0
Fork 0
mirror of https://github.com/LadybirdBrowser/ladybird.git synced 2025-06-10 01:51:03 +09:00

FileManager: Open ".wav" files in SoundPlayer when activated

Now you can double-click on WAV files in the FileManager. Neato! :^)
This commit is contained in:
Andreas Kling 2019-09-04 20:20:36 +02:00
parent 1188a036e9
commit 5cfd67ecbb
Notes: sideshowbarker 2024-07-19 12:18:13 +09:00

View file

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