PlacesMenu: don't fail for GIO errors getting the file name

Different GIO backends can fail in different ways trying to query
file infos. If that's the case, fail back to safe get_basename()
instead of crashing.
This commit is contained in:
Giovanni Campagna
2012-11-07 17:41:52 +01:00
parent a5ce94c6d3
commit 880758e470

View File

@@ -75,7 +75,7 @@ const PlaceInfo = new Lang.Class({
try {
let info = this.file.query_info('standard::display-name', 0, null);
return info.get_display_name();
} catch(e if e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.NOT_SUPPORTED)) {
} catch(e if e instanceof Gio.IOErrorEnum) {
return this.file.get_basename();
}
},