trying to fix the slides not showing a newly created video_thumbnail
This commit is contained in:
parent
9b75c366de
commit
4659cb6de5
2 changed files with 21 additions and 9 deletions
|
@ -50,6 +50,12 @@ Item {
|
|||
chosenFont: model.font
|
||||
text: model.text
|
||||
pdfIndex: model.slideIndex
|
||||
Connections {
|
||||
target: slideModel
|
||||
function onDataChanged() {
|
||||
Utils.dbg("hi")
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
/* WebEngineView { */
|
||||
|
|
|
@ -315,10 +315,16 @@ impl slide_model::SlideModel {
|
|||
mut self: Pin<&mut Self>,
|
||||
index: i32,
|
||||
) -> bool {
|
||||
let (id, index, roles) = self.as_mut().get_indices(index, SlideRoles::VideoThumbnail);
|
||||
let mut vector_roles = QVector_i32::default();
|
||||
vector_roles.append(self.get_role(SlideRoles::VideoThumbnail));
|
||||
vector_roles.append(self.get_role(SlideRoles::VideoBackground));
|
||||
vector_roles.append(self.get_role(SlideRoles::ImageBackground));
|
||||
let rc = self.as_ref().count() - 1;
|
||||
let tl = self.as_ref().index(0, 0, &QModelIndex::default());
|
||||
let br = self.as_ref().index(rc, 0, &QModelIndex::default());
|
||||
let thread = self.qt_thread();
|
||||
if let Some(slide) =
|
||||
self.as_mut().rust_mut().slides.get_mut(id)
|
||||
self.as_mut().rust_mut().slides.get_mut(index as usize)
|
||||
{
|
||||
if !slide.video_background.is_empty() {
|
||||
let path =
|
||||
|
@ -340,9 +346,9 @@ impl slide_model::SlideModel {
|
|||
|
||||
match thread.queue(move |mut slide_model| {
|
||||
slide_model.as_mut().data_changed(
|
||||
&index,
|
||||
&index,
|
||||
&roles,
|
||||
&tl,
|
||||
&br,
|
||||
&vector_roles,
|
||||
)
|
||||
}) {
|
||||
Ok(_o) => {
|
||||
|
@ -1223,15 +1229,15 @@ impl slide_model::SlideModel {
|
|||
) -> (usize, QModelIndex, QVector_i32) {
|
||||
let mut vector_roles = QVector_i32::default();
|
||||
vector_roles.append(self.as_ref().get_role(role));
|
||||
if let Some(index) =
|
||||
self.as_ref().slides.iter().enumerate().nth(item_id)
|
||||
if let Some(_slide) =
|
||||
self.as_ref().slides.get(item_id as usize)
|
||||
{
|
||||
let model_index = self.as_ref().index(
|
||||
index as i32,
|
||||
item_id,
|
||||
0,
|
||||
&QModelIndex::default(),
|
||||
);
|
||||
(index, model_index, vector_roles)
|
||||
(item_id as usize, model_index, vector_roles)
|
||||
} else {
|
||||
error!(item_id, "This item appears to be missing");
|
||||
(0, QModelIndex::default(), vector_roles)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue