예제 #1
0
        void HandleMountAdded(object o, MountAddedArgs args)
        {
            // FIXME: due to a bug in GIO#, this will crash when trying to get args.Mount
            Mount m = MountAdapter.GetObject(args.Args[0] as GLib.Object);

            if (IsTrash(m))
            {
                return;
            }

            Mounts.Add(new MountItem(m));
            Log <MountProvider> .Info("{0} mounted.", m.Name);

            Items = Mounts.Cast <AbstractDockItem> ();
        }
예제 #2
0
        void HandleMonitorMountAdded(object o, MountAddedArgs args)
        {
            // Manually get the mount as gio-sharp translates it to the wrong managed object
            var mount = GLib.MountAdapter.GetObject((GLib.Object)args.Args [0]);

            if (mount.Volume == null)
            {
                return;
            }

            var device = GudevDeviceFromGioMount(mount);

            volume_device_map [mount.Volume.Handle] = device;
            var h = DeviceAdded;

            if (h != null)
            {
                var v = new RawVolume(mount.Volume,
                                      this,
                                      new GioVolumeMetadataSource(mount.Volume),
                                      new UdevMetadataSource(device));
                h(this, new MountArgs(HardwareManager.Resolve(new Device(v))));
            }
        }
예제 #3
0
 void HandleMonitorMountAdded(object o, MountAddedArgs args)
 {
     Hyena.Log.Debug("Gio.Manager: received MountAdded signal");
     VolumeChanged(args.Mount.Volume);
 }