mirror of
https://review.haiku-os.org/haiku
synced 2025-01-18 12:38:51 +01:00
KPartition: Drop SetParent().
A comment indicated it "must" only be called in Add/RemoveChild only. So the field is just modified there now.
This commit is contained in:
parent
74ae79fed9
commit
01e97ff280
@ -137,8 +137,6 @@ public:
|
||||
|
||||
void SetDevice(KDiskDevice *device);
|
||||
KDiskDevice *Device() const;
|
||||
|
||||
void SetParent(KPartition *parent);
|
||||
KPartition *Parent() const;
|
||||
|
||||
status_t AddChild(KPartition *partition, int32 index = -1);
|
||||
|
@ -858,14 +858,6 @@ KPartition::Device() const
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
KPartition::SetParent(KPartition* parent)
|
||||
{
|
||||
// Must be called in a {Add,Remove}Child() only!
|
||||
fParent = parent;
|
||||
}
|
||||
|
||||
|
||||
KPartition*
|
||||
KPartition::Parent() const
|
||||
{
|
||||
@ -898,7 +890,7 @@ KPartition::AddChild(KPartition* partition, int32 index)
|
||||
_UpdateChildIndices(count, index);
|
||||
fPartitionData.child_count++;
|
||||
|
||||
partition->SetParent(this);
|
||||
partition->fParent = this;
|
||||
partition->SetDevice(Device());
|
||||
partition->SetPhysicalBlockSize(PhysicalBlockSize());
|
||||
|
||||
@ -961,7 +953,7 @@ KPartition::RemoveChild(int32 index)
|
||||
_UpdateChildIndices(index, fChildren.Count());
|
||||
partition->SetIndex(-1);
|
||||
fPartitionData.child_count--;
|
||||
partition->SetParent(NULL);
|
||||
partition->fParent = NULL;
|
||||
partition->SetDevice(NULL);
|
||||
// notify listeners
|
||||
FireChildRemoved(partition, index);
|
||||
|
Loading…
Reference in New Issue
Block a user