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:
@@ -15,6 +15,7 @@
|
|||||||
class BDirectory;
|
class BDirectory;
|
||||||
class BDiskDevice;
|
class BDiskDevice;
|
||||||
class BDiskDeviceJob;
|
class BDiskDeviceJob;
|
||||||
|
class BDiskDeviceVisiting;
|
||||||
class BDiskDeviceVisitor;
|
class BDiskDeviceVisitor;
|
||||||
class BDiskScannerPartitionAddOn;
|
class BDiskScannerPartitionAddOn;
|
||||||
class BDiskSystem;
|
class BDiskSystem;
|
||||||
@@ -108,7 +109,6 @@ public:
|
|||||||
bool VisitEachPartition(BDiskDeviceVisitor *visitor,
|
bool VisitEachPartition(BDiskDeviceVisitor *visitor,
|
||||||
BDiskDevice *device = NULL,
|
BDiskDevice *device = NULL,
|
||||||
BPartition **partition = NULL);
|
BPartition **partition = NULL);
|
||||||
bool VisitAll(BDiskDeviceVisitor *visitor);
|
|
||||||
|
|
||||||
bool VisitEachMountedPartition(BDiskDeviceVisitor *visitor,
|
bool VisitEachMountedPartition(BDiskDeviceVisitor *visitor,
|
||||||
BDiskDevice *device = NULL,
|
BDiskDevice *device = NULL,
|
||||||
|
|||||||
@@ -202,9 +202,11 @@ BDiskDeviceRoster::VisitEachDevice(BDiskDeviceVisitor *visitor,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// VisitEachPartition
|
// 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
|
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
|
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.
|
and in \a partition the pointer to the partition object is returned.
|
||||||
@@ -232,8 +234,6 @@ BDiskDeviceRoster::VisitEachPartition(BDiskDeviceVisitor *visitor,
|
|||||||
BPartition *foundPartition = NULL;
|
BPartition *foundPartition = NULL;
|
||||||
while (!foundPartition && GetNextDevice(useDevice) == B_OK)
|
while (!foundPartition && GetNextDevice(useDevice) == B_OK)
|
||||||
foundPartition = useDevice->VisitEachDescendant(visitor);
|
foundPartition = useDevice->VisitEachDescendant(visitor);
|
||||||
// TODO: That probably not correct. VisitEachDescendant()
|
|
||||||
// should also invoke Visit(BDiskDevice*).
|
|
||||||
fDeviceCookie = oldCookie;
|
fDeviceCookie = oldCookie;
|
||||||
if (!terminatedEarly)
|
if (!terminatedEarly)
|
||||||
useDevice->Unset();
|
useDevice->Unset();
|
||||||
@@ -243,33 +243,6 @@ BDiskDeviceRoster::VisitEachPartition(BDiskDeviceVisitor *visitor,
|
|||||||
return terminatedEarly;
|
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
|
// VisitEachMountedPartition
|
||||||
/*! \brief Iterates through the all devices' partitions that are mounted.
|
/*! \brief Iterates through the all devices' partitions that are mounted.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user