Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 0 additions & 34 deletions Backend/src/settings.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use std::{fs, io};
use std::path::PathBuf;
use std::time::Duration;
use directories::ProjectDirs;
use serde::{Deserialize, Serialize};

Expand All @@ -18,7 +17,6 @@ pub struct AppConfig {
#[serde(default)] pub advanced: Advanced,
#[serde(default)] pub experimental: Experimental,
#[serde(default)] pub logging: Logging,
#[serde(default)] pub network: Network,
}

impl Default for AppConfig {
Expand All @@ -36,7 +34,6 @@ impl Default for AppConfig {
advanced: Default::default(),
experimental: Default::default(),
logging: Default::default(),
network: Default::default(),
}
}
}
Expand Down Expand Up @@ -263,22 +260,6 @@ impl Default for Logging {

fn default_retain_archives() -> u32 { 10 }

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Network {
#[serde(default)] pub http_low_speed_time_secs: u64,
#[serde(default)] pub http_low_speed_limit: u32, // bytes/sec
#[serde(default)] pub extra_ssl_roots: Vec<PathBuf>,
}
impl Default for Network {
fn default() -> Self {
Self {
http_low_speed_time_secs: 30,
http_low_speed_limit: 1024,
extra_ssl_roots: vec![],
}
}
}

#[derive(Debug, Clone, Copy, Serialize, Deserialize, PartialEq, Eq)]
#[serde(rename_all = "kebab-case")]
pub enum Theme { Light, Dark, System }
Expand Down Expand Up @@ -376,15 +357,6 @@ pub enum LogLevel { Trace, Debug, Info, Warn, Error }
impl Default for LogLevel { fn default() -> Self { LogLevel::Info } }

//
// ──────────────────────────────────────────────────────────────────────────────
// Convenience
// ──────────────────────────────────────────────────────────────────────────────
impl Network {
pub fn http_low_speed_time(&self) -> Duration {
Duration::from_secs(self.http_low_speed_time_secs)
}
}

impl AppConfig {
/// ~/.config/openvcs/openvcs.conf (XDG/macOS/Windows aware)
pub fn path() -> PathBuf {
Expand Down Expand Up @@ -444,12 +416,6 @@ impl AppConfig {

// Performance

// Network
self.network.http_low_speed_time_secs =
self.network.http_low_speed_time_secs.clamp(1, 600);
self.network.http_low_speed_limit =
self.network.http_low_speed_limit.clamp(128, 10_000_000);

// UX
self.ux.recents_limit = self.ux.recents_limit.clamp(1, 100);

Expand Down
Loading