* Added support for automatic mount on media change. Not yet tested, though,
and probably only works for CDs as is (ie. not for USB sticks). git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29584 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -85,12 +85,14 @@ AutoMounter::AutoMounter()
|
|||||||
fRemovableMode = kNoVolumes;
|
fRemovableMode = kNoVolumes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BDiskDeviceRoster().StartWatching(this, B_DEVICE_REQUEST_DEVICE);
|
||||||
PostMessage(kMsgInitialScan);
|
PostMessage(kMsgInitialScan);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
AutoMounter::~AutoMounter()
|
AutoMounter::~AutoMounter()
|
||||||
{
|
{
|
||||||
|
BDiskDeviceRoster().StopWatching(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -629,6 +631,16 @@ AutoMounter::MessageReceived(BMessage* message)
|
|||||||
_MountVolumes(kAllVolumes, kAllVolumes, false);
|
_MountVolumes(kAllVolumes, kAllVolumes, false);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case B_DEVICE_UPDATE:
|
||||||
|
message->PrintToStream();
|
||||||
|
int32 event;
|
||||||
|
if (message->FindInt32("event", &event) != B_OK
|
||||||
|
|| event != B_DEVICE_MEDIA_CHANGED)
|
||||||
|
break;
|
||||||
|
|
||||||
|
_MountVolumes(kNoVolumes, fRemovableMode, false);
|
||||||
|
break;
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
case B_NODE_MONITOR:
|
case B_NODE_MONITOR:
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user