mapping slide_model.rs to serviceItems better

This commit is contained in:
Chris Cochrun 2023-03-29 15:10:04 -05:00
parent fc1eb193dd
commit 7e8694eca2

View file

@ -250,7 +250,7 @@ mod slide_model {
#[qinvokable] #[qinvokable]
pub fn add_item_from_service( pub fn add_item_from_service(
mut self: Pin<&mut Self>, mut self: Pin<&mut Self>,
_index: i32, index: i32,
service_item: &QMap_QString_QVariant, service_item: &QMap_QString_QVariant,
) { ) {
println!("add rust slide"); println!("add rust slide");
@ -297,42 +297,38 @@ mod slide_model {
.value() .value()
.unwrap_or(QString::from("")), .unwrap_or(QString::from("")),
video_background: service_item video_background: service_item
.get(&QString::from("imageBackground")) .get(&QString::from("videoBackground"))
.unwrap_or(QVariant::from(&QString::from(""))) .unwrap_or(QVariant::from(&QString::from("")))
.value() .value()
.unwrap_or(QString::from("")), .unwrap_or(QString::from("")),
audio: service_item audio: service_item
.get(&QString::from("imageBackground")) .get(&QString::from("audio"))
.unwrap_or(QVariant::from(&QString::from(""))) .unwrap_or(QVariant::from(&QString::from("")))
.value() .value()
.unwrap_or(QString::from("")), .unwrap_or(QString::from("")),
font: service_item font: service_item
.get(&QString::from("imageBackground")) .get(&QString::from("font"))
.unwrap_or(QVariant::from(&QString::from(""))) .unwrap_or(QVariant::from(&QString::from("")))
.value() .value()
.unwrap_or(QString::from("")), .unwrap_or(QString::from("")),
font_size: service_item font_size: service_item
.get(&QString::from("imageBackground")) .get(&QString::from("fontSize"))
.unwrap_or(QVariant::from(&50)) .unwrap_or(QVariant::from(&50))
.value() .value()
.unwrap_or(50), .unwrap_or(50),
htext_alignment: service_item htext_alignment: service_item
.get(&QString::from("imageBackground")) .get(&QString::from("vtextAlignment"))
.unwrap_or(QVariant::from(&QString::from("center"))) .unwrap_or(QVariant::from(&QString::from("center")))
.value() .value()
.unwrap_or(QString::from("center")), .unwrap_or(QString::from("center")),
vtext_alignment: service_item vtext_alignment: service_item
.get(&QString::from("imageBackground")) .get(&QString::from("vtextAlignment"))
.unwrap_or(QVariant::from(&QString::from("center"))) .unwrap_or(QVariant::from(&QString::from("center")))
.value() .value()
.unwrap_or(QString::from("center")), .unwrap_or(QString::from("center")),
service_item_id: service_item service_item_id: index,
.get(&QString::from("imageBackground"))
.unwrap_or(QVariant::from(&0))
.value()
.unwrap_or(0),
slide_id: service_item slide_id: service_item
.get(&QString::from("slide")) .get(&QString::from("slideNumber"))
.unwrap_or(QVariant::from(&0)) .unwrap_or(QVariant::from(&0))
.value() .value()
.unwrap_or(0), .unwrap_or(0),