image: File doesn't have to be a property anymore

This commit is contained in:
Sophie Herold 2023-12-04 18:42:21 +01:00
parent 33bcd4a7ac
commit cfed1d3d63
2 changed files with 5 additions and 6 deletions

View file

@ -113,7 +113,6 @@ mod imp {
#[derive(Debug, Default, Properties)]
#[properties(wrapper_type = super::LpImage)]
pub struct LpImage {
#[property(get, explicit_notify)]
pub(super) file: RefCell<Option<gio::File>>,
#[property(get)]
pub(super) is_deleted: Cell<bool>,
@ -834,8 +833,6 @@ impl LpImage {
imp.file.replace(Some(file.clone()));
self.reload_file_info().await;
self.setup_file_monitor().await;
self.notify_file();
}
/// Set filename after filename changed
@ -854,8 +851,6 @@ impl LpImage {
}
self.setup_file_monitor().await;
self.notify_file();
}
async fn reload_file_info(&self) {
@ -1860,6 +1855,10 @@ impl LpImage {
.ok()?
}
pub fn file(&self) -> Option<gio::File> {
self.imp().file.borrow().clone()
}
pub fn metadata(&self) -> impl Deref<Target = Metadata> + '_ {
self.imp().metadata.borrow()
}