Removed VisitAll(). That's exactly what VisitEachPartition() does (since disk devices are special partitions).
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9708 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
de0807a907
commit
08387795eb
@ -15,6 +15,7 @@
|
||||
class BDirectory;
|
||||
class BDiskDevice;
|
||||
class BDiskDeviceJob;
|
||||
class BDiskDeviceVisiting;
|
||||
class BDiskDeviceVisitor;
|
||||
class BDiskScannerPartitionAddOn;
|
||||
class BDiskSystem;
|
||||
@ -108,7 +109,6 @@ public:
|
||||
bool VisitEachPartition(BDiskDeviceVisitor *visitor,
|
||||
BDiskDevice *device = NULL,
|
||||
BPartition **partition = NULL);
|
||||
bool VisitAll(BDiskDeviceVisitor *visitor);
|
||||
|
||||
bool VisitEachMountedPartition(BDiskDeviceVisitor *visitor,
|
||||
BDiskDevice *device = NULL,
|
||||
|
@ -202,9 +202,11 @@ BDiskDeviceRoster::VisitEachDevice(BDiskDeviceVisitor *visitor,
|
||||
}
|
||||
|
||||
// VisitEachPartition
|
||||
/*! \brief Iterates through the all devices' partitions.
|
||||
/*! \brief Pre-order traverses the trees spanned by the BDiskDevices and their
|
||||
subobjects.
|
||||
|
||||
The supplied visitor's Visit(BPartition*) is invoked for each partition.
|
||||
The supplied visitor's Visit(BDiskDevice*) method is invoked for each
|
||||
disk device and Visit(BPartition*) for each (non-disk device) partition.
|
||||
If Visit() returns \c true, the iteration is terminated and this method
|
||||
returns \c true. If supplied, \a device is set to the concerned device
|
||||
and in \a partition the pointer to the partition object is returned.
|
||||
@ -232,8 +234,6 @@ BDiskDeviceRoster::VisitEachPartition(BDiskDeviceVisitor *visitor,
|
||||
BPartition *foundPartition = NULL;
|
||||
while (!foundPartition && GetNextDevice(useDevice) == B_OK)
|
||||
foundPartition = useDevice->VisitEachDescendant(visitor);
|
||||
// TODO: That probably not correct. VisitEachDescendant()
|
||||
// should also invoke Visit(BDiskDevice*).
|
||||
fDeviceCookie = oldCookie;
|
||||
if (!terminatedEarly)
|
||||
useDevice->Unset();
|
||||
@ -243,33 +243,6 @@ BDiskDeviceRoster::VisitEachPartition(BDiskDeviceVisitor *visitor,
|
||||
return terminatedEarly;
|
||||
}
|
||||
|
||||
// VisitAll
|
||||
/*! \brief Pre-order traverses the trees of the spanned by the BDiskDevices
|
||||
and their subobjects.
|
||||
|
||||
The supplied visitor's Visit() is invoked for each device, for each
|
||||
session and for each partition.
|
||||
If Visit() returns \c true, the iteration is terminated and this method
|
||||
returns \c true as well.
|
||||
|
||||
\param visitor The visitor.
|
||||
\return \c true, if the iteration was terminated, \c false otherwise.
|
||||
*/
|
||||
bool
|
||||
BDiskDeviceRoster::VisitAll(BDiskDeviceVisitor *visitor)
|
||||
{
|
||||
bool terminatedEarly = false;
|
||||
if (visitor) {
|
||||
int32 oldCookie = fDeviceCookie;
|
||||
fDeviceCookie = 0;
|
||||
BDiskDevice device;
|
||||
while (!terminatedEarly && GetNextDevice(&device) == B_OK)
|
||||
terminatedEarly = device.VisitEachDescendant(visitor);
|
||||
fDeviceCookie = oldCookie;
|
||||
}
|
||||
return terminatedEarly;
|
||||
}
|
||||
|
||||
// VisitEachMountedPartition
|
||||
/*! \brief Iterates through the all devices' partitions that are mounted.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user