Skip to content

Commit

Permalink
Change save path
Browse files Browse the repository at this point in the history
  • Loading branch information
iewnfod committed Oct 31, 2023
1 parent 8a739e2 commit 7ef6026
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ async fn main() {
};
}
);
let mut subjects_updated = false;
let mut subjects_updated = true;

// 软件运行
let mut app = fltk::app::App::default();
Expand Down
13 changes: 9 additions & 4 deletions src/ui/data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,18 +51,23 @@ pub const SEASONS: &[&str] = &["Jun", "Nov", "Mar", "Gen"];

/// 获取基础路径,也就是设置文件所在的目录
pub fn base_dir() -> PathBuf {
let id = "com.iewnfod.getPaperRs";
if let Some(home) = dirs::home_dir() {
if cfg!(target_os = "windows") {
return home.join("AppData\\Local\\get-paper-rs").to_path_buf();
return home
.join("AppData\\Local")
.join(id)
.to_path_buf();
} else if cfg!(target_os = "macos") {
return home
.join("Library/Application Support/get-paper-rs")
.join("Library/Application Support/")
.join(id)
.to_path_buf();
} else {
return home.join("get-paper-rs").to_path_buf();
return home.join(id).to_path_buf();
}
} else {
Path::new("get-paper-rs").to_path_buf()
Path::new(id).to_path_buf()
}
}

Expand Down

0 comments on commit 7ef6026

Please sign in to comment.