From 0ebdaf29211d5117b02583c5a9c57b5dde826f92 Mon Sep 17 00:00:00 2001 From: Chris Cochrun Date: Wed, 4 Sep 2024 14:17:40 -0500 Subject: [PATCH] builds correctly now --- src/qml/presenter/MainWindow.qml | 2 +- src/rust/slide_model.rs | 94 ++++++++++++++++---------------- 2 files changed, 48 insertions(+), 48 deletions(-) diff --git a/src/qml/presenter/MainWindow.qml b/src/qml/presenter/MainWindow.qml index 2c8776b..24820a6 100644 --- a/src/qml/presenter/MainWindow.qml +++ b/src/qml/presenter/MainWindow.qml @@ -180,7 +180,7 @@ Controls.Page { ImageProxyModel { id: imageProxyModel } PresentationProxyModel { id: presProxyModel } VideoProxyModel { id: videoProxyModel } - /* ServiceThing { id: serviceThing } */ + /* ServiceThing { id: serviceThing } */ FileHelper { id: fileHelper } SlideHelper { id: slideHelper } SongEditor { diff --git a/src/rust/slide_model.rs b/src/rust/slide_model.rs index 51f8262..2fb40f9 100644 --- a/src/rust/slide_model.rs +++ b/src/rust/slide_model.rs @@ -332,7 +332,7 @@ impl slide_model::SlideModel { let path = PathBuf::from(slide.video_background.to_string()); let screenshot = ffmpeg::bg_path_from_video(&path); - let mut screenshot_string = screenshot.into_os_string().into_string().unwrap_or_default(); + let mut screenshot_string = screenshot.clone().into_os_string().into_string().unwrap_or_default(); screenshot_string.insert_str(0, "file://"); slide.video_thumbnail = screenshot_string; std::thread::spawn(move || { @@ -575,9 +575,9 @@ impl slide_model::SlideModel { match ty { Some(ty) if ty == QString::from("image") => { - slide.ty = ty; - slide.image_background = background; - slide.video_background = QString::from(""); + slide.ty = ty.to_string(); + slide.image_background = background.to_string(); + slide.video_background = String::from(""); slide.slide_index = 0; self.as_mut().insert_slide(&slide, slide_index); debug!("Image added to slide model!"); @@ -589,26 +589,26 @@ impl slide_model::SlideModel { "rust: add song of {:?} length at index {:?}", &count, &slide_index ); - slide.ty = ty.clone(); + slide.ty = ty.clone().to_string(); // debug!("{:?}", text_vec[i].clone()); - slide.text = text.clone(); + slide.text = text.clone().to_string(); slide.slide_count = count as i32; slide.slide_index = i as i32; if background_type == QString::from("image") { - slide.image_background = background.clone(); - slide.video_background = QString::from(""); + slide.image_background = background.clone().to_string(); + slide.video_background = String::from(""); } else { - slide.video_background = background.clone(); - slide.image_background = QString::from(""); + slide.video_background = background.clone().to_string(); + slide.image_background = String::from(""); } self.as_mut() .insert_slide(&slide, slide_index + i as i32); } } Some(ty) if ty == QString::from("video") => { - slide.ty = ty; - slide.image_background = QString::from(""); - slide.video_background = background; + slide.ty = ty.to_string(); + slide.image_background = String::from(""); + slide.video_background = background.to_string(); slide.slide_index = 0; self.as_mut().insert_slide(&slide, slide_index); } @@ -618,17 +618,17 @@ impl slide_model::SlideModel { &QString::from(".html"), CaseSensitivity::CaseInsensitive, ) { - slide.ty = ty.clone(); + slide.ty = ty.clone().to_string(); slide.html = true; - slide.image_background = background.clone(); - slide.video_background = QString::from(""); + slide.image_background = background.clone().to_string(); + slide.video_background = String::from(""); slide.slide_index = 0; self.as_mut().insert_slide(&slide, slide_index); } else { for i in 0..slide.slide_count { - slide.ty = ty.clone(); - slide.image_background = background.clone(); - slide.video_background = QString::from(""); + slide.ty = ty.clone().to_string(); + slide.image_background = background.clone().to_string(); + slide.video_background = String::from(""); slide.slide_index = i; self.as_mut() .insert_slide(&slide, slide_index + i); @@ -705,32 +705,32 @@ impl slide_model::SlideModel { .get(&QString::from("type")) .unwrap_or(QVariant::from(&QString::from(""))) .value() - .unwrap_or(QString::from("")); + .unwrap_or(QString::from("")).to_string(); slide.text = service_item .get(&QString::from("text")) .unwrap_or(QVariant::from(&QString::from(""))) .value() - .unwrap_or(QString::from("")); + .unwrap_or(QString::from("")).to_string(); slide.image_background = service_item .get(&QString::from("imageBackground")) .unwrap_or(QVariant::from(&QString::from(""))) .value() - .unwrap_or(QString::from("")); + .unwrap_or(QString::from("")).to_string(); slide.video_background = service_item .get(&QString::from("videoBackground")) .unwrap_or(QVariant::from(&QString::from(""))) .value() - .unwrap_or(QString::from("")); + .unwrap_or(QString::from("")).to_string(); slide.audio = service_item .get(&QString::from("audio")) .unwrap_or(QVariant::from(&QString::from(""))) .value() - .unwrap_or(QString::from("")); + .unwrap_or(QString::from("")).to_string(); slide.font = service_item .get(&QString::from("font")) .unwrap_or(QVariant::from(&QString::from(""))) .value() - .unwrap_or(QString::from("")); + .unwrap_or(QString::from("")).to_string(); slide.font_size = service_item .get(&QString::from("fontSize")) .unwrap_or(QVariant::from(&50)) @@ -740,12 +740,12 @@ impl slide_model::SlideModel { .get(&QString::from("vtextAlignment")) .unwrap_or(QVariant::from(&QString::from("center"))) .value() - .unwrap_or(QString::from("center")); + .unwrap_or(QString::from("center")).to_string(); slide.vtext_alignment = service_item .get(&QString::from("vtextAlignment")) .unwrap_or(QVariant::from(&QString::from("center"))) .value() - .unwrap_or(QString::from("center")); + .unwrap_or(QString::from("center")).to_string(); slide.service_item_id = index; slide.slide_index = service_item .get(&QString::from("slideNumber")) @@ -772,37 +772,37 @@ impl slide_model::SlideModel { .unwrap_or(QVariant::from(&false)) .value() .unwrap_or(false); - slide.video_thumbnail = QString::from(""); + slide.video_thumbnail = String::from(""); match ty { Some(ty) if ty == QString::from("image") => { - slide.ty = ty; - slide.image_background = background; - slide.video_background = QString::from(""); + slide.ty = ty.to_string(); + slide.image_background = background.to_string(); + slide.video_background = String::from(""); slide.slide_index = 0; self.as_mut().add_slide(&slide); } Some(ty) if ty == QString::from("song") => { for (i, text) in text_vec.iter().enumerate() { - slide.ty = ty.clone(); + slide.ty = ty.clone().to_string(); // debug!("{:?}", text_vec[i].clone()); - slide.text = text.clone(); + slide.text = text.clone().to_string(); slide.slide_count = text_vec.len() as i32; slide.slide_index = i as i32; if background_type == QString::from("image") { - slide.image_background = background.clone(); - slide.video_background = QString::from(""); + slide.image_background = background.clone().to_string(); + slide.video_background = String::from(""); } else { - slide.video_background = background.clone(); - slide.image_background = QString::from(""); + slide.video_background = background.clone().to_string(); + slide.image_background = String::from(""); } self.as_mut().add_slide(&slide); } } Some(ty) if ty == QString::from("video") => { - slide.ty = ty; - slide.image_background = QString::from(""); - slide.video_background = background; + slide.ty = ty.to_string(); + slide.image_background = String::from(""); + slide.video_background = background.to_string(); slide.slide_index = 0; self.as_mut().add_slide(&slide); } @@ -812,17 +812,17 @@ impl slide_model::SlideModel { &QString::from(".html"), CaseSensitivity::CaseInsensitive, ) { - slide.ty = ty.clone(); + slide.ty = ty.clone().to_string(); slide.html = true; - slide.image_background = background.clone(); - slide.video_background = QString::from(""); + slide.image_background = background.clone().to_string(); + slide.video_background = String::from(""); slide.slide_index = 0; self.as_mut().add_slide(&slide); } else { for i in 0..slide.slide_count { - slide.ty = ty.clone(); - slide.image_background = background.clone(); - slide.video_background = QString::from(""); + slide.ty = ty.clone().to_string(); + slide.image_background = background.clone().to_string(); + slide.video_background = String::from(""); slide.slide_index = i; self.as_mut().add_slide(&slide); } @@ -1213,7 +1213,7 @@ impl slide_model::SlideModel { if let Some(slide) = self.as_mut().rust_mut().slides.get_mut(index as usize) { - slide.obs_scene = obs_scene; + slide.obs_scene = obs_scene.to_string(); self.as_mut().data_changed(tl, br, &vector_roles); } }