propertiesView: Use decoder format
Use the format that we actually used when decoding. The mime type is usually derived from the file extension which might not always be correct. Issue #43 Part-of: <https://gitlab.gnome.org/Incubator/loupe/-/merge_requests/132>
This commit is contained in:
parent
f8e64d9805
commit
a2a9b4134b
6 changed files with 44 additions and 38 deletions
|
|
@ -380,18 +380,6 @@ impl LpPropertiesView {
|
|||
.unwrap_or_else(|| FALLBACK.to_owned()) // and if we get nothing, use `FALLBACK`
|
||||
}
|
||||
|
||||
#[template_callback]
|
||||
fn file_type(&self, info: Option<gio::FileInfo>) -> String {
|
||||
info.and_then(|i| i.content_type())
|
||||
.map(|t| t.to_string())
|
||||
.map(|t| {
|
||||
t.rsplit('/').collect::<Vec<&str>>()[0]
|
||||
.to_owned()
|
||||
.to_uppercase()
|
||||
})
|
||||
.unwrap_or_else(|| FALLBACK.to_owned())
|
||||
}
|
||||
|
||||
#[template_callback]
|
||||
fn file_size(&self, info: Option<gio::FileInfo>) -> String {
|
||||
info.map(|info| {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue