saving some updates

This commit is contained in:
Chris Cochrun 2024-09-17 15:32:34 -05:00
parent bb3a5d9b7b
commit 9b75c366de
4 changed files with 70 additions and 39 deletions

View file

@ -1356,6 +1356,29 @@ impl service_item_model::ServiceItemModel {
}
}
fn get_indices(
self: Pin<&mut Self>,
item_id: i32,
role: ServiceRoles,
) -> (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().service_items.iter().position(|x| x.id == item_id)
{
let model_index = self.as_ref().index(
index as i32,
0,
&QModelIndex::default(),
);
(index, model_index, vector_roles)
} else {
error!(item_id, "This item appears to be missing");
(0, QModelIndex::default(), vector_roles)
}
}
pub fn load_last_saved(self: Pin<&mut Self>) -> bool {
todo!();
// Don't actually need