decoder: Use GFile instead of PathBuf
This allows to show images from locations that don't have a representation with path. This also works around not being able to read files in trash:/// Closes #56 Part-of: <https://gitlab.gnome.org/Incubator/loupe/-/merge_requests/174>
This commit is contained in:
parent
032707a210
commit
fad8bb7939
15 changed files with 119 additions and 107 deletions
|
|
@ -31,8 +31,6 @@ use gtk::prelude::*;
|
|||
use gtk::CompositeTemplate;
|
||||
use once_cell::sync::Lazy;
|
||||
|
||||
use std::path::PathBuf;
|
||||
|
||||
mod imp {
|
||||
use super::*;
|
||||
|
||||
|
|
@ -151,7 +149,7 @@ impl LpImagePage {
|
|||
pub fn from_file(file: &gio::File) -> Self {
|
||||
let obj = glib::Object::new::<Self>();
|
||||
|
||||
obj.imp().image.set_file(&file);
|
||||
obj.imp().image.set_file(file);
|
||||
|
||||
spawn(clone!(@weak obj, @strong file => async move {
|
||||
let imp = obj.imp();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue