diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-09-04 20:20:36 +0200 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-09-04 20:20:36 +0200 |
commit | 5cfd67ecbb7c7f8ba148632dc5756649aa652b0e (patch) | |
tree | 6bdee22611d82aebcc3ae5821e169c65400dbc64 /Applications | |
parent | 1188a036e9b5e7a28a563ffbadae9b24ea8c4c67 (diff) | |
download | serenity-5cfd67ecbb7c7f8ba148632dc5756649aa652b0e.zip |
FileManager: Open ".wav" files in SoundPlayer when activated
Now you can double-click on WAV files in the FileManager. Neato! :^)
Diffstat (limited to 'Applications')
-rw-r--r-- | Applications/FileManager/DirectoryView.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Applications/FileManager/DirectoryView.cpp b/Applications/FileManager/DirectoryView.cpp index 6e682af4f8..5ba971c335 100644 --- a/Applications/FileManager/DirectoryView.cpp +++ b/Applications/FileManager/DirectoryView.cpp @@ -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) |