Add settings reset defaults

This commit is contained in:
2026-05-09 01:14:15 -04:00
parent 89a8e05eeb
commit d193f5a400
13 changed files with 465 additions and 136 deletions
@@ -90,6 +90,10 @@ impl BrowserCore {
self.set_profile_download_policy(&profile_id, download_policy)
}
pub fn reset_active_profile_download_settings(&mut self) -> Result<(), CoreError> {
self.set_active_profile_download_policy(DownloadPolicy::ask_every_time())
}
pub fn set_profile_sync_policy(
&mut self,
profile_id: &ProfileId,
@@ -108,6 +112,12 @@ impl BrowserCore {
Ok(())
}
pub fn reset_profile_sync_settings(&mut self) {
for profile in &mut self.profiles {
profile.set_sync_policy(ProfileSyncPolicy::default());
}
}
pub(super) fn cleanup_private_profile_session_data(&mut self, profile_id: &ProfileId) {
if self
.profiles
@@ -66,6 +66,10 @@ impl BrowserCore {
self.sync_object_policies.set(kind, policy);
}
pub fn reset_sync_settings(&mut self) {
self.sync_object_policies = SyncObjectPolicies::default();
}
#[must_use]
pub fn sync_object_policy(&self, kind: SyncObjectKind) -> SyncObjectPolicy {
self.sync_object_policies.get(kind)