automount: add an AutomountManager class

The AutomountManager class is the low-level counterpart of the
previously introduced AutorunManager, and takes care of extracting the
list of valid mounts from a GVolume or a GDrive and mounting them,
provided a number of conditions and requirements are met.

AutomountManager also keeps track of the current session availability
(using the ConsoleKit and gnome-screensaver DBus interfaces) and
inhibits mounting if the current session is locked, or another session
is in use instead.

https://bugzilla.gnome.org/show_bug.cgi?id=653520
This commit is contained in:
Cosimo Cecchi
2011-06-20 15:16:40 -04:00
parent 534b371d42
commit acc053302d
4 changed files with 185 additions and 0 deletions

View File

@ -118,6 +118,11 @@ AutorunManager.prototype = {
},
_onMountAdded: function(monitor, mount) {
// don't do anything if our session is not the currently
// active one
if (!Main.automountManager.ckListener.sessionActive)
return;
let discoverer = new ContentTypeDiscoverer(Lang.bind (this,
function (mount, contentTypes) {
this._transDispatcher.addMount(mount, contentTypes);