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:
Augustin Cavalier 2024-12-19 17:21:04 -05:00
parent 74ae79fed9
commit 01e97ff280
2 changed files with 2 additions and 12 deletions

View File

@ -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);

View File

@ -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);