[placeDisplay] Prefer eject over unmount when applicable
Clicking the eject button in the places display always triggers an unmount action. In some cases like USB drives or DVDs, eject makes more sense - it is also consistent with nautilus' behavior. https://bugzilla.gnome.org/show_bug.cgi?id=613405
This commit is contained in:
parent
8b3d4857aa
commit
d1a178301f
@ -93,11 +93,17 @@ PlaceDeviceInfo.prototype = {
|
||||
if (!this.isRemovable())
|
||||
return;
|
||||
|
||||
if (this._mount.can_eject())
|
||||
this._mount.eject(0, null, Lang.bind(this, this._removeFinish));
|
||||
else
|
||||
this._mount.unmount(0, null, Lang.bind(this, this._removeFinish));
|
||||
},
|
||||
|
||||
_removeFinish: function(o, res, data) {
|
||||
try {
|
||||
if (this._mount.can_eject())
|
||||
this._mount.eject_finish(res);
|
||||
else
|
||||
this._mount.unmount_finish(res);
|
||||
} catch (e) {
|
||||
let message = _("Failed to unmount '%s'").format(o.get_name());
|
||||
|
Loading…
Reference in New Issue
Block a user