- Check if we had any changes in status before sending a notification for a new
inserted media. This fixes ticket #3921. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30774 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1466,9 +1466,15 @@ KDiskDeviceManager::_CheckMediaStatus()
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
bool hadMedia = device->HasMedia();
|
bool hadMedia = device->HasMedia();
|
||||||
|
bool changedMedia = device->MediaChanged();
|
||||||
device->UpdateMediaStatusIfNeeded();
|
device->UpdateMediaStatusIfNeeded();
|
||||||
|
|
||||||
if (!device->MediaChanged() && (device->HasMedia() || !hadMedia))
|
// Detect it there was any status change since last check.
|
||||||
|
bool updated = (hadMedia != device->HasMedia()) ||
|
||||||
|
(changedMedia != device->MediaChanged());
|
||||||
|
|
||||||
|
if ((!device->MediaChanged() &&
|
||||||
|
(device->HasMedia() || !hadMedia)) || !updated)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
device->MarkBusy(true);
|
device->MarkBusy(true);
|
||||||
|
|||||||
Reference in New Issue
Block a user