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:
parent
1188a036e9
commit
5cfd67ecbb
1 changed files with 10 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue