From 646435ee3ed47ea2130237495237aa6df3c0fba6 Mon Sep 17 00:00:00 2001 From: Cosimo Cecchi Date: Tue, 19 Jun 2012 14:49:40 -0400 Subject: [PATCH] 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 file changed, 10 insertions(+), 6 deletions(-) diff --git a/js/ui/automountManager.js b/js/ui/automountManager.js index 0d3b6c962..e3db54f0b 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)); },