timeline: Fix iter type

`GtkFlattenListModel`'s item type is always `GObject`
This commit is contained in:
Kévin Commaille 2023-11-04 12:36:12 +01:00
parent bcee8bfd9f
commit 08d10991f5
No known key found for this signature in database
GPG key ID: 29A48C1F03620416

View file

@ -434,8 +434,13 @@ impl Timeline {
/// Get the position of the event with the given key in this `Timeline`.
pub fn find_event_position(&self, key: &EventKey) -> Option<usize> {
for (pos, item) in self.items().iter::<TimelineItem>().enumerate() {
let Ok(item) = item else {
for (pos, item) in self
.items()
.iter::<glib::Object>()
.map(|o| o.ok().and_downcast::<TimelineItem>())
.enumerate()
{
let Some(item) = item else {
break;
};