use `config_local_dir`
parent
354a74aeaa
commit
b05a87cc9c
|
@ -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") {
|
||||||
|
|
|
@ -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.");
|
||||||
|
|
|
@ -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;
|
||||||
|
|
Loading…
Reference in New Issue