1
0
mirror of https://github.com/pcvolkmer/osc-variant.git synced 2025-04-20 20:26:50 +00:00

Do not modify forms included in system library

This commit is contained in:
Paul-Christian Volkmer 2023-08-31 12:08:34 +02:00
parent a8851c5e4f
commit a605018176

View File

@ -35,7 +35,7 @@ use crate::model::data_form::DataForm;
use crate::model::property_catalogue::PropertyCatalogue; use crate::model::property_catalogue::PropertyCatalogue;
use crate::model::requirements::Requires; use crate::model::requirements::Requires;
use crate::model::unterformular::Unterformular; use crate::model::unterformular::Unterformular;
use crate::model::{Comparable, FormEntryContainer, Listable, Sortable}; use crate::model::{Comparable, FolderContent, FormEntryContainer, Listable, Sortable};
use crate::profile::Profile; use crate::profile::Profile;
#[derive(Serialize, Deserialize, Debug)] #[derive(Serialize, Deserialize, Debug)]
@ -75,12 +75,20 @@ impl OnkostarEditor {
} }
pub fn apply_profile(&mut self, profile: &Profile) { pub fn apply_profile(&mut self, profile: &Profile) {
self.editor.data_form.iter_mut().for_each(|data_form| { self.editor
data_form.apply_profile(profile); .data_form
}); .iter_mut()
self.editor.unterformular.iter_mut().for_each(|data_form| { .filter(|data_form| !data_form.is_system_library_content())
data_form.apply_profile(profile); .for_each(|data_form| {
}) data_form.apply_profile(profile);
});
self.editor
.unterformular
.iter_mut()
.filter(|data_form| !data_form.is_system_library_content())
.for_each(|data_form| {
data_form.apply_profile(profile);
});
} }
pub fn print_list(&self) { pub fn print_list(&self) {