image: File doesn't have to be a property anymore
This commit is contained in:
parent
33bcd4a7ac
commit
cfed1d3d63
2 changed files with 5 additions and 6 deletions
|
|
@ -113,7 +113,6 @@ mod imp {
|
||||||
#[derive(Debug, Default, Properties)]
|
#[derive(Debug, Default, Properties)]
|
||||||
#[properties(wrapper_type = super::LpImage)]
|
#[properties(wrapper_type = super::LpImage)]
|
||||||
pub struct LpImage {
|
pub struct LpImage {
|
||||||
#[property(get, explicit_notify)]
|
|
||||||
pub(super) file: RefCell<Option<gio::File>>,
|
pub(super) file: RefCell<Option<gio::File>>,
|
||||||
#[property(get)]
|
#[property(get)]
|
||||||
pub(super) is_deleted: Cell<bool>,
|
pub(super) is_deleted: Cell<bool>,
|
||||||
|
|
@ -834,8 +833,6 @@ impl LpImage {
|
||||||
imp.file.replace(Some(file.clone()));
|
imp.file.replace(Some(file.clone()));
|
||||||
self.reload_file_info().await;
|
self.reload_file_info().await;
|
||||||
self.setup_file_monitor().await;
|
self.setup_file_monitor().await;
|
||||||
|
|
||||||
self.notify_file();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Set filename after filename changed
|
/// Set filename after filename changed
|
||||||
|
|
@ -854,8 +851,6 @@ impl LpImage {
|
||||||
}
|
}
|
||||||
|
|
||||||
self.setup_file_monitor().await;
|
self.setup_file_monitor().await;
|
||||||
|
|
||||||
self.notify_file();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn reload_file_info(&self) {
|
async fn reload_file_info(&self) {
|
||||||
|
|
@ -1860,6 +1855,10 @@ impl LpImage {
|
||||||
.ok()?
|
.ok()?
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn file(&self) -> Option<gio::File> {
|
||||||
|
self.imp().file.borrow().clone()
|
||||||
|
}
|
||||||
|
|
||||||
pub fn metadata(&self) -> impl Deref<Target = Metadata> + '_ {
|
pub fn metadata(&self) -> impl Deref<Target = Metadata> + '_ {
|
||||||
self.imp().metadata.borrow()
|
self.imp().metadata.borrow()
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -184,7 +184,7 @@ mod imp {
|
||||||
// Dates
|
// Dates
|
||||||
let has_dates = [
|
let has_dates = [
|
||||||
Self::update_row(&self.file_created, metadata.file_created()),
|
Self::update_row(&self.file_created, metadata.file_created()),
|
||||||
Self::update_row(&self.file_modified, dbg!(metadata.file_modified())),
|
Self::update_row(&self.file_modified, metadata.file_modified()),
|
||||||
]
|
]
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.any(|x| x);
|
.any(|x| x);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue