diff options
author | Joe <rbo@gmx.us> | 2024-02-01 20:20:20 +0100 |
---|---|---|
committer | Joe <rbo@gmx.us> | 2024-02-01 20:20:20 +0100 |
commit | 84daefea1ae1dec8fe511707664c9a9fe12aef0b (patch) | |
tree | 4be83c9109062a43d51a36bdcea857fcfe4628d0 | |
parent | conf (diff) | |
download | hardflip-84daefea1ae1dec8fe511707664c9a9fe12aef0b.tar.gz hardflip-84daefea1ae1dec8fe511707664c9a9fe12aef0b.tar.bz2 hardflip-84daefea1ae1dec8fe511707664c9a9fe12aef0b.tar.xz hardflip-84daefea1ae1dec8fe511707664c9a9fe12aef0b.tar.zst hardflip-84daefea1ae1dec8fe511707664c9a9fe12aef0b.zip |
will read conf
Diffstat (limited to '')
-rw-r--r-- | src/c_defs.go | 4 | ||||
-rw-r--r-- | src/i_events.go | 7 |
2 files changed, 8 insertions, 3 deletions
diff --git a/src/c_defs.go b/src/c_defs.go index 2fd8c6a..6c2db1c 100644 --- a/src/c_defs.go +++ b/src/c_defs.go @@ -52,7 +52,7 @@ package main const ( - CONF_FILE_NAME = "hf.yml" + CONF_FILE_NAME = "config.yml" CONF_DIR_NAME = "hf" DATA_DIR_NAME = "hf" VERSION = "v0.2" @@ -98,7 +98,7 @@ var ( var DEFAULT_OPTS = HardOpts{ true, true, - "6FF3AD08C158D2E163B77CFA0EAB41FC2D9F762A", + "", false, "", } diff --git a/src/i_events.go b/src/i_events.go index 974de32..71b7386 100644 --- a/src/i_events.go +++ b/src/i_events.go @@ -166,6 +166,12 @@ func i_fold_dir(data *HardData, item *ItemsNode) { } func i_reload_data(data *HardData) { + conf_dir := c_get_conf_dir(&data.load_err) + if conf_dir == "" { + data.opts = DEFAULT_OPTS + } else { + data.opts = c_get_options(conf_dir, &data.load_err) + } data.data_dir = c_get_data_dir(&data.ui) if data.data_dir == "" { return @@ -174,7 +180,6 @@ func i_reload_data(data *HardData) { data.ldirs, data.litems, data.load_err = i_load_ui(data.data_dir, data.opts, &data.ui, &data.load_err) data.folds = make(map[*DirsNode]*ItemsList) - // TODO: reload conf } func i_delete_dir(data *HardData) error { |