[gnome-shell] automount: don't allow autorun for things we mount at startup



commit 646435ee3ed47ea2130237495237aa6df3c0fba6
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Tue Jun 19 14:49:40 2012 -0400

    automount: don't allow autorun for things we mount at startup
    
    We don't want to potentially flood the user with notifications about
    mounts when starting up the system.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=660595

 js/ui/automountManager.js |   16 ++++++++++------
 1 files changed, 10 insertions(+), 6 deletions(-)
---
diff --git a/js/ui/automountManager.js b/js/ui/automountManager.js
index 0d3b6c9..e3db54f 100644
--- a/js/ui/automountManager.js
+++ b/js/ui/automountManager.js
@@ -123,7 +123,8 @@ const AutomountManager = new Lang.Class({
         let volumes = this._volumeMonitor.get_volumes();
         volumes.forEach(Lang.bind(this, function(volume) {
             this._checkAndMountVolume(volume, { checkSession: false,
-                                                useMountOp: false });
+                                                useMountOp: false,
+                                                allowAutorun: false });
         }));
 
         return false;
@@ -201,7 +202,8 @@ const AutomountManager = new Lang.Class({
 
     _checkAndMountVolume: function(volume, params) {
         params = Params.parse(params, { checkSession: true,
-                                        useMountOp: true });
+                                        useMountOp: true,
+                                        allowAutorun: true });
 
         if (params.checkSession) {
             // if we're not in the current ConsoleKit session,
@@ -236,14 +238,16 @@ const AutomountManager = new Lang.Class({
 
         if (params.useMountOp) {
             let operation = new ShellMountOperation.ShellMountOperation(volume);
-            this._mountVolume(volume, operation.mountOp);
+            this._mountVolume(volume, operation.mountOp, params.allowAutorun);
         } else {
-            this._mountVolume(volume, null);
+            this._mountVolume(volume, null, params.allowAutorun);
         }
     },
 
-    _mountVolume: function(volume, operation) {
-        this._allowAutorun(volume);
+    _mountVolume: function(volume, operation, allowAutorun) {
+        if (allowAutorun)
+            this._allowAutorun(volume);
+
         volume.mount(0, operation, null,
                      Lang.bind(this, this._onVolumeMounted));
     },



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