pub unsafe fn save_from_detailed_view(&self, index: Ref<QModelIndex>) {
        let mut data: HashMap<String, String> = serde_json::from_str(&index.data_1a(FACTION_DATA).to_string().to_std_string()).unwrap();

        // Only save if checked. If not, remove the data we have, if we have any.
        if self.banner_groupbox.is_checked() {
            self.tool.save_fields_from_detailed_view_editor_combo_color(&mut data, self.get_ref_banner_colour_primary(), "banner_primary");
            self.tool.save_fields_from_detailed_view_editor_combo_color(&mut data, self.get_ref_banner_colour_secondary(), "banner_secondary");
            self.tool.save_fields_from_detailed_view_editor_combo_color(&mut data, self.get_ref_banner_colour_tertiary(), "banner_tertiary");
        } else {
            data.remove("banner_primary");
            data.remove("banner_secondary");
            data.remove("banner_tertiary");
        }

        if self.uniform_groupbox.is_checked() {
            self.tool.save_fields_from_detailed_view_editor_combo_color(&mut data, self.get_ref_uniform_colour_primary(), "uniform_primary");
            self.tool.save_fields_from_detailed_view_editor_combo_color(&mut data, self.get_ref_uniform_colour_secondary(), "uniform_secondary");
            self.tool.save_fields_from_detailed_view_editor_combo_color(&mut data, self.get_ref_uniform_colour_tertiary(), "uniform_tertiary");
        } else {
            data.remove("uniform_primary");
            data.remove("uniform_secondary");
            data.remove("uniform_tertiary");
        }

        self.faction_list_model.item_from_index(index).set_data_2a(&QVariant::from_q_string(&QString::from_std_str(&serde_json::to_string(&data).unwrap())), FACTION_DATA);
    }
/// This function saves the data of the detailed view to its item in the faction list.
This function saves the data of the detailed view to its item in the faction list.
This function saves the data of the detailed view to its item in the faction list .
pub unsafe fn save_from_detailed_view(&self, index: Ref<QModelIndex>) {
        let mut data: HashMap<String, String> = serde_json::from_str(&index.data_1a(FACTION_DATA).to_string().to_std_string()).unwrap();
        // Only save if checked. If not, remove the data we have, if we have any.
        if self.banner_groupbox.is_checked() {
            self.tool.save_fields_from_detailed_view_editor_combo_color(&mut data, self.get_ref_banner_colour_primary(), "banner_primary");
            self.tool.save_fields_from_detailed_view_editor_combo_color(&mut data, self.get_ref_banner_colour_secondary(), "banner_secondary");
            self.tool.save_fields_from_detailed_view_editor_combo_color(&mut data, self.get_ref_banner_colour_tertiary(), "banner_tertiary");
        } else {
            data.remove("banner_primary");
            data.remove("banner_secondary");
            data.remove("banner_tertiary");
        }
        if self.uniform_groupbox.is_checked() {
            self.tool.save_fields_from_detailed_view_editor_combo_color(&mut data, self.get_ref_uniform_colour_primary(), "uniform_primary");
            self.tool.save_fields_from_detailed_view_editor_combo_color(&mut data, self.get_ref_uniform_colour_secondary(), "uniform_secondary");
            self.tool.save_fields_from_detailed_view_editor_combo_color(&mut data, self.get_ref_uniform_colour_tertiary(), "uniform_tertiary");
        } else {
            data.remove("uniform_primary");
            data.remove("uniform_secondary");
            data.remove("uniform_tertiary");
        }
        self.faction_list_model.item_from_index(index).set_data_2a(&QVariant::from_q_string(&QString::from_std_str(&serde_json::to_string(&data).unwrap())), FACTION_DATA);
    }
pub unsafe fn save_from_detailed_view ( & self , index : Ref < QModelIndex > ) { let mut data : HashMap < String , String > = serde_json :: from_str ( & index . data_1a ( FACTION_DATA ) . to_string ( ) . to_std_string ( ) ) . unwrap ( ) ; // Only save if checked. If not, remove the data we have, if we have any. if self . banner_groupbox . is_checked ( ) { self . tool . save_fields_from_detailed_view_editor_combo_color ( & mut data , self . get_ref_banner_colour_primary ( ) , " " ) ; self . tool . save_fields_from_detailed_view_editor_combo_color ( & mut data , self . get_ref_banner_colour_secondary ( ) , " " ) ; self . tool . save_fields_from_detailed_view_editor_combo_color ( & mut data , self . get_ref_banner_colour_tertiary ( ) , " " ) ; } else { data . remove ( " " ) ; data . remove ( " " ) ; data . remove ( " " ) ; } if self . uniform_groupbox . is_checked ( ) { self . tool . save_fields_from_detailed_view_editor_combo_color ( & mut data , self . get_ref_uniform_colour_primary ( ) , " " ) ; self . tool . save_fields_from_detailed_view_editor_combo_color ( & mut data , self . get_ref_uniform_colour_secondary ( ) , " " ) ; self . tool . save_fields_from_detailed_view_editor_combo_color ( & mut data , self . get_ref_uniform_colour_tertiary ( ) , " " ) ; } else { data . remove ( " " ) ; data . remove ( " " ) ; data . remove ( " " ) ; } self . faction_list_model . item_from_index ( index ) . set_data_2a ( & QVariant :: from_q_string ( & QString :: from_std_str ( & serde_json :: to_string ( & data ) . unwrap ( ) ) ) , FACTION_DATA ) ; }
This function saves the data of the detailed view to its item in the faction list.
This function saves the data of the detailed view to its item in the faction list .
&self
index
Ref<QModelIndex>
&self
index
Ref<QModelIndex>