propertiesView: Disable open folder for non-native

The GTK API only support native files for opening the
parent directory.

Part-of: <https://gitlab.gnome.org/Incubator/loupe/-/merge_requests/207>
This commit is contained in:
Sophie Herold 2023-04-27 16:00:35 +02:00 • committed by Marge Bot
parent d4f351bf5b
commit bea6ad018b

View file

@ -150,7 +150,10 @@ impl LpPropertiesView {
fn set_file(&self, file: Option<&gio::File>) { fn set_file(&self, file: Option<&gio::File>) {
let imp = self.imp(); let imp = self.imp();
self.action_set_enabled("properties.open-folder", file.is_some()); self.action_set_enabled(
"properties.open-folder",
file.map_or(false, |x| x.is_native()),
);
if let Some(file) = file { if let Some(file) = file {
if let Some(current_file) = self.file() { if let Some(current_file) = self.file() {