change name of sounds dir function

This commit is contained in:
Max Bradbury 2021-04-26 21:59:24 +01:00
parent 3aad33189c
commit fa7361d20f
1 changed files with 3 additions and 3 deletions

View File

@ -93,7 +93,7 @@ fn error_popup(message: &str) {
popup.show_all(); popup.show_all();
} }
fn get_data_dir() -> PathBuf { fn get_sounds_dir() -> PathBuf {
let mut data_dir = dirs::data_dir().expect("Couldn't find user data directory"); let mut data_dir = dirs::data_dir().expect("Couldn't find user data directory");
data_dir.push("ruin"); data_dir.push("ruin");
@ -123,7 +123,7 @@ fn build_ui(application: &gtk::Application) {
button_manage_sounds.connect_clicked(|_| { button_manage_sounds.connect_clicked(|_| {
let mut file_manager = Command::new(file_manager()); let mut file_manager = Command::new(file_manager());
file_manager.arg(get_data_dir()); file_manager.arg(get_sounds_dir());
file_manager.output().unwrap(); file_manager.output().unwrap();
}); });
@ -147,7 +147,7 @@ fn build_ui(application: &gtk::Application) {
let device = rodio::default_output_device().unwrap(); let device = rodio::default_output_device().unwrap();
let mut paths = std::fs::read_dir(get_data_dir()) let mut paths = std::fs::read_dir(get_sounds_dir())
.expect("Couldn't read lull sounds directory") .expect("Couldn't read lull sounds directory")
.map(|res| res.map(|e| e.path())) .map(|res| res.map(|e| e.path()))
.collect::<Result<Vec<_>, std::io::Error>>() .collect::<Result<Vec<_>, std::io::Error>>()