use `config_local_dir`

main
_ 2021-12-16 21:47:12 +00:00
parent 354a74aeaa
commit b05a87cc9c
3 changed files with 3 additions and 3 deletions

View File

@ -165,7 +165,7 @@ fn load_config_file () -> ConfigFile {
if let Some (proj_dirs) = find_project_dirs () { if let Some (proj_dirs) = find_project_dirs () {
let mut ini = Ini::new_cs (); let mut ini = Ini::new_cs ();
let path = proj_dirs.config_dir ().join ("client.ini"); let path = proj_dirs.config_local_dir ().join ("client.ini");
if ini.load (&path).is_ok () { if ini.load (&path).is_ok () {
let map_ref = ini.get_map_ref (); let map_ref = ini.get_map_ref ();
if let Some (x) = map_ref.get ("nicknames") { if let Some (x) = map_ref.get ("nicknames") {

View File

@ -44,7 +44,7 @@ async fn async_main () -> Result <(), AppError> {
fn config () { fn config () {
if let Some (proj_dirs) = ProjectDirs::from ("", "ReactorScram", "LookAround") { if let Some (proj_dirs) = ProjectDirs::from ("", "ReactorScram", "LookAround") {
println! ("Using config dir {:?}", proj_dirs.config_dir ()); println! ("Using config dir {:?}", proj_dirs.config_local_dir ());
} }
else { else {
println! ("Can't detect config dir."); println! ("Can't detect config dir.");

View File

@ -41,7 +41,7 @@ fn configure <I: Iterator <Item=String>> (mut args: I) -> Result <Params, AppErr
if let Some (proj_dirs) = find_project_dirs () { if let Some (proj_dirs) = find_project_dirs () {
let mut ini = Ini::new_cs (); let mut ini = Ini::new_cs ();
let path = proj_dirs.config_dir ().join ("server.ini"); let path = proj_dirs.config_local_dir ().join ("server.ini");
if ini.load (&path).is_ok () { if ini.load (&path).is_ok () {
if let Some (x) = ini.get ("server", "nickname") { if let Some (x) = ini.get ("server", "nickname") {
nickname = x; nickname = x;