Exemplo n.º 1
0
bool
BFilePanelPoseView::FSNotification(const BMessage* message)
{
	if (IsDesktopView()) {
		// Pretty much copied straight from DesktopPoseView.
		// Would be better if the code could be shared somehow.
		switch (message->FindInt32("opcode")) {
			case B_DEVICE_MOUNTED:
			{
				dev_t device;
				if (message->FindInt32("new device", &device) != B_OK)
					break;

				ASSERT(TargetModel() != NULL);
				TrackerSettings settings;

				BVolume volume(device);
				if (volume.InitCheck() != B_OK)
					break;

				if (settings.MountVolumesOntoDesktop()
					&& (!volume.IsShared()
						|| settings.MountSharedVolumesOntoDesktop())) {
					// place an icon for the volume onto the desktop
					CreateVolumePose(&volume, true);
				}
			}
			break;
		}
	}
	return _inherited::FSNotification(message);
}
Exemplo n.º 2
0
bool
DesktopPoseView::FSNotification(const BMessage* message)
{
    switch (message->FindInt32("opcode")) {
    case B_DEVICE_MOUNTED:
    {
        dev_t device;
        if (message->FindInt32("new device", &device) != B_OK)
            break;

        ASSERT(TargetModel());
        TrackerSettings settings;

        BVolume volume(device);
        if (volume.InitCheck() != B_OK)
            break;

        if (settings.MountVolumesOntoDesktop()
                && (!volume.IsShared()
                    || settings.MountSharedVolumesOntoDesktop())) {
            // place an icon for the volume onto the desktop
            CreateVolumePose(&volume, true);
        }
    }
    break;
    }

    return _inherited::FSNotification(message);
}