[gnome-shell] [placeDisplay] Prefer eject over unmount when applicable



commit d1a178301fbed1edb0ec6571e442949538532a1e
Author: Florian Müllner <fmuellner src gnome org>
Date:   Sat Mar 20 14:52:40 2010 +0100

    [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 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/js/ui/placeDisplay.js b/js/ui/placeDisplay.js
index cd9167f..50879cf 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,



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]