Sync viewer navigation with browser sorting
This commit is contained in:
parent
bb73c1abea
commit
f0d5cf3496
5 changed files with 375 additions and 87 deletions
|
|
@ -10,6 +10,7 @@ use serde::{Deserialize, Serialize};
|
|||
pub struct AppConfig {
|
||||
pub cache_quota_gb: u64,
|
||||
pub fast_image_loading: bool,
|
||||
pub case_insensitive_sort: bool,
|
||||
pub viewer_mode: ViewerMode,
|
||||
pub locations: Vec<LocationProfile>,
|
||||
pub favorites: Vec<FavoriteEntry>,
|
||||
|
|
@ -20,6 +21,7 @@ impl Default for AppConfig {
|
|||
Self {
|
||||
cache_quota_gb: 10,
|
||||
fast_image_loading: true,
|
||||
case_insensitive_sort: true,
|
||||
viewer_mode: ViewerMode::FitWidth,
|
||||
locations: Vec::new(),
|
||||
favorites: Vec::new(),
|
||||
|
|
@ -167,6 +169,7 @@ mod tests {
|
|||
#[test]
|
||||
fn default_cache_quota_is_ten_gigabytes() {
|
||||
assert_eq!(AppConfig::default().cache_quota_gb, 10);
|
||||
assert!(AppConfig::default().case_insensitive_sort);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
@ -174,6 +177,7 @@ mod tests {
|
|||
let config = AppConfig {
|
||||
cache_quota_gb: 0,
|
||||
fast_image_loading: true,
|
||||
case_insensitive_sort: true,
|
||||
viewer_mode: ViewerMode::FitWidth,
|
||||
locations: vec![LocationProfile {
|
||||
name: "테스트".into(),
|
||||
|
|
@ -209,6 +213,7 @@ mod tests {
|
|||
fn fast_image_loading_is_enabled_for_existing_configs() {
|
||||
let decoded: AppConfig = toml::from_str("cache_quota_gb = 10\n").unwrap();
|
||||
assert!(decoded.fast_image_loading);
|
||||
assert!(decoded.case_insensitive_sort);
|
||||
assert_eq!(decoded.viewer_mode, ViewerMode::FitWidth);
|
||||
assert!(decoded.favorites.is_empty());
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue