1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-28 16:15:10 +00: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

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)