refactor: pass globally mutable config reference

Before, copies of the configuration were passed over. This change also
causes configuration reloads to affect the entire application and is
easier to maintain but introduces some RwLock overhead.
This commit is contained in:
Henrik Friedrichsen
2020-10-18 13:09:45 +02:00
parent e1b4892b8a
commit 013beb245b
12 changed files with 132 additions and 80 deletions

View File

@@ -154,7 +154,7 @@ impl ListItem for Track {
}
fn display_center(&self, library: Arc<Library>) -> String {
if library.config().album_column.unwrap_or(true) {
if library.cfg.values().album_column.unwrap_or(true) {
self.album.to_string()
} else {
"".to_string()
@@ -163,7 +163,7 @@ impl ListItem for Track {
fn display_right(&self, library: Arc<Library>) -> String {
let saved = if library.is_saved_track(&Playable::Track(self.clone())) {
if library.use_nerdfont {
if library.cfg.values().use_nerdfont.unwrap_or(false) {
"\u{f62b} "
} else {
""