From d1a178301fbed1edb0ec6571e442949538532a1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Sat, 20 Mar 2010 14:52:40 +0100 Subject: [PATCH] [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 --- js/ui/placeDisplay.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/js/ui/placeDisplay.js b/js/ui/placeDisplay.js index cd9167fee..50879cfbf 100644 --- a/js/ui/placeDisplay.js +++ b/js/ui/placeDisplay.js @@ -93,12 +93,18 @@ PlaceDeviceInfo.prototype = { if (!this.isRemovable()) return; - this._mount.unmount(0, null, Lang.bind(this, this._removeFinish)); + 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 { - this._mount.unmount_finish(res); + 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()); Main.overview.infoBar.setMessage(message,