mirror of
https://github.com/an-anime-team/an-anime-game-launcher.git
synced 2025-03-11 02:29:37 +03:00
refactor: used std::env::temp_dir()
instead of std::path::PathBuf::from("/tmp")
This commit is contained in:
parent
b5f8f7a490
commit
2d81e50e68
3 changed files with 5 additions and 5 deletions
|
@ -1 +1 @@
|
|||
Subproject commit c977382d270f1414c1691077120516ff27f01ee4
|
||||
Subproject commit e1ec9f7796763de558ca49c9c15dae864db9fcda
|
|
@ -239,7 +239,7 @@ impl SimpleAsyncComponent for DefaultPathsApp {
|
|||
patch: CONFIG.patch.path.clone(),
|
||||
|
||||
#[allow(clippy::or_fun_call)]
|
||||
temp: CONFIG.launcher.temp.clone().unwrap_or(PathBuf::from("/tmp"))
|
||||
temp: CONFIG.launcher.temp.clone().unwrap_or(std::env::temp_dir())
|
||||
};
|
||||
|
||||
let widgets = view_output!();
|
||||
|
|
|
@ -322,7 +322,7 @@ impl SimpleComponent for App {
|
|||
set_sensitive: match model.state.as_ref() {
|
||||
Some(LauncherState::PredownloadAvailable { game, voices }) => {
|
||||
let config = config::get().unwrap();
|
||||
let temp = config.launcher.temp.unwrap_or_else(|| PathBuf::from("/tmp"));
|
||||
let temp = config.launcher.temp.unwrap_or_else(std::env::temp_dir);
|
||||
|
||||
let downloaded = temp.join(game.file_name().unwrap()).exists() &&
|
||||
voices.iter().all(|voice| temp.join(voice.file_name().unwrap()).exists());
|
||||
|
@ -337,7 +337,7 @@ impl SimpleComponent for App {
|
|||
set_css_classes: match model.state.as_ref() {
|
||||
Some(LauncherState::PredownloadAvailable { game, voices }) => {
|
||||
let config = config::get().unwrap();
|
||||
let temp = config.launcher.temp.unwrap_or_else(|| PathBuf::from("/tmp"));
|
||||
let temp = config.launcher.temp.unwrap_or_else(std::env::temp_dir);
|
||||
|
||||
let downloaded = temp.join(game.file_name().unwrap()).exists() &&
|
||||
voices.iter().all(|voice| temp.join(voice.file_name().unwrap()).exists());
|
||||
|
@ -893,7 +893,7 @@ impl SimpleComponent for App {
|
|||
#[allow(unused_must_use)]
|
||||
AppMsg::PredownloadUpdate => {
|
||||
if let Some(LauncherState::PredownloadAvailable { game, mut voices }) = self.state.clone() {
|
||||
let tmp = config::get().unwrap().launcher.temp.unwrap_or_else(|| PathBuf::from("/tmp"));
|
||||
let tmp = config::get().unwrap().launcher.temp.unwrap_or_else(std::env::temp_dir);
|
||||
|
||||
self.downloading = true;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue