diff --git a/headers/private/storage/DiskDevicePrivate.h b/headers/private/storage/DiskDevicePrivate.h index 02175b2eac..9c18dd01ee 100644 --- a/headers/private/storage/DiskDevicePrivate.h +++ b/headers/private/storage/DiskDevicePrivate.h @@ -1,22 +1,27 @@ -//---------------------------------------------------------------------- -// This software is part of the OpenBeOS distribution and is covered -// by the OpenBeOS license. -//--------------------------------------------------------------------- - +/* + * Copyright 2003-2006, Haiku Inc. + * Distributed under the terms of the MIT License. + * + * Authors: + * Ingo Weinhold, bonefish@users.sf.net + */ #ifndef _DISK_DEVICE_PRIVATE_H #define _DISK_DEVICE_PRIVATE_H + #include #include class BMessenger; class BPath; + namespace BPrivate { // PartitionFilter class PartitionFilter { public: + virtual ~PartitionFilter(); virtual bool Filter(BPartition *partition, int32 level) = 0; }; diff --git a/src/kits/storage/DiskDeviceList.cpp b/src/kits/storage/DiskDeviceList.cpp index 5cf399d25e..cd65868a17 100644 --- a/src/kits/storage/DiskDeviceList.cpp +++ b/src/kits/storage/DiskDeviceList.cpp @@ -1,10 +1,11 @@ -//---------------------------------------------------------------------- -// This software is part of the OpenBeOS distribution and is covered -// by the OpenBeOS license. -//--------------------------------------------------------------------- +/* + * Copyright 2003-2006, Haiku Inc. + * Distributed under the terms of the MIT License. + * + * Authors: + * Ingo Weinhold, bonefish@users.sf.net + */ -#include -using namespace std; #include #include @@ -15,6 +16,9 @@ using namespace std; #include #include +#include +using namespace std; + using BPrivate::BObjectLocker; // constructor @@ -612,7 +616,7 @@ BDiskDeviceList::_StopWatching() void BDiskDeviceList::_MountPointMoved(BMessage *message) { - if (BDiskDevice *device = _UpdateDevice(message)) { + if (_UpdateDevice(message) != NULL) { if (BPartition *partition = _FindPartition(message)) MountPointMoved(partition); } @@ -625,7 +629,7 @@ BDiskDeviceList::_MountPointMoved(BMessage *message) void BDiskDeviceList::_PartitionMounted(BMessage *message) { - if (BDiskDevice *device = _UpdateDevice(message)) { + if (_UpdateDevice(message) != NULL) { if (BPartition *partition = _FindPartition(message)) PartitionMounted(partition); } @@ -638,7 +642,7 @@ BDiskDeviceList::_PartitionMounted(BMessage *message) void BDiskDeviceList::_PartitionUnmounted(BMessage *message) { - if (BDiskDevice *device = _UpdateDevice(message)) { + if (_UpdateDevice(message) != NULL) { if (BPartition *partition = _FindPartition(message)) PartitionUnmounted(partition); } @@ -651,7 +655,7 @@ BDiskDeviceList::_PartitionUnmounted(BMessage *message) void BDiskDeviceList::_PartitionInitialized(BMessage *message) { - if (BDiskDevice *device = _UpdateDevice(message)) { + if (_UpdateDevice(message) != NULL) { if (BPartition *partition = _FindPartition(message)) PartitionInitialized(partition); } @@ -664,7 +668,7 @@ BDiskDeviceList::_PartitionInitialized(BMessage *message) void BDiskDeviceList::_PartitionResized(BMessage *message) { - if (BDiskDevice *device = _UpdateDevice(message)) { + if (_UpdateDevice(message) != NULL) { if (BPartition *partition = _FindPartition(message)) PartitionResized(partition); } @@ -677,7 +681,7 @@ BDiskDeviceList::_PartitionResized(BMessage *message) void BDiskDeviceList::_PartitionMoved(BMessage *message) { - if (BDiskDevice *device = _UpdateDevice(message)) { + if (_UpdateDevice(message) != NULL) { if (BPartition *partition = _FindPartition(message)) PartitionMoved(partition); } @@ -690,7 +694,7 @@ BDiskDeviceList::_PartitionMoved(BMessage *message) void BDiskDeviceList::_PartitionCreated(BMessage *message) { - if (BDiskDevice *device = _UpdateDevice(message)) { + if (_UpdateDevice(message) != NULL) { if (BPartition *partition = _FindPartition(message)) PartitionCreated(partition); } @@ -718,7 +722,7 @@ BDiskDeviceList::_PartitionDeleted(BMessage *message) void BDiskDeviceList::_PartitionDefragmented(BMessage *message) { - if (BDiskDevice *device = _UpdateDevice(message)) { + if (_UpdateDevice(message) != NULL) { if (BPartition *partition = _FindPartition(message)) PartitionDefragmented(partition); } @@ -731,7 +735,7 @@ BDiskDeviceList::_PartitionDefragmented(BMessage *message) void BDiskDeviceList::_PartitionRepaired(BMessage *message) { - if (BDiskDevice *device = _UpdateDevice(message)) { + if (_UpdateDevice(message) != NULL) { if (BPartition *partition = _FindPartition(message)) PartitionRepaired(partition); } diff --git a/src/kits/storage/DiskDevicePrivate.cpp b/src/kits/storage/DiskDevicePrivate.cpp index 2805a88f29..b2e5db8f54 100644 --- a/src/kits/storage/DiskDevicePrivate.cpp +++ b/src/kits/storage/DiskDevicePrivate.cpp @@ -1,13 +1,23 @@ -//---------------------------------------------------------------------- -// This software is part of the OpenBeOS distribution and is covered -// by the OpenBeOS license. -//--------------------------------------------------------------------- +/* + * Copyright 2003-2006, Haiku Inc. + * Distributed under the terms of the MIT License. + * + * Authors: + * Ingo Weinhold, bonefish@users.sf.net + */ + #include #include #include -// PartitionFilterVisitor + +PartitionFilter::~PartitionFilter() +{ +} + + +// #pragma mark - PartitionFilterVisitor // constructor PartitionFilterVisitor::PartitionFilterVisitor(BDiskDeviceVisitor *visitor,