We need flags to track what properties of the partition change.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22609 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold
2007-10-18 03:39:50 +00:00
parent 77f02aaead
commit 013e7894b7
2 changed files with 25 additions and 1 deletions
@@ -66,6 +66,9 @@ public:
int32 CountChildren() const; int32 CountChildren() const;
int32 IndexOfChild(BMutablePartition* child) const; int32 IndexOfChild(BMutablePartition* child) const;
void SetChangeFlags(uint32 flags);
uint32 ChangeFlags() const;
// for the partitioning system managing the parent // for the partitioning system managing the parent
void* ChildCookie() const; void* ChildCookie() const;
void SetChildCookie(void* cookie); void SetChildCookie(void* cookie);
@@ -89,6 +92,7 @@ private:
user_partition_data* fData; user_partition_data* fData;
BMutablePartition* fParent; BMutablePartition* fParent;
BList fChildren; BList fChildren;
uint32 fChangeFlags;
void* fChildCookie; void* fChildCookie;
}; };
@@ -321,7 +321,10 @@ BMutablePartition::DeleteChild(int32 index)
if (!child) if (!child)
return B_BAD_VALUE; return B_BAD_VALUE;
delete child->fDelegate->Partition(); // This will delete not only all delegates in the child's hierarchy, but
// also the respective partitions themselves, if they are no longer
// referenced.
child->fDelegate->Partition()->_DeleteDelegates();
return B_OK; return B_OK;
} }
@@ -369,6 +372,22 @@ BMutablePartition::IndexOfChild(BMutablePartition* child) const
} }
// SetChangeFlags
void
BMutablePartition::SetChangeFlags(uint32 flags)
{
fChangeFlags = flags;
}
// ChangeFlags
uint32
BMutablePartition::ChangeFlags() const
{
return fChangeFlags;
}
// ChildCookie // ChildCookie
void* void*
BMutablePartition::ChildCookie() const BMutablePartition::ChildCookie() const
@@ -390,6 +409,7 @@ BMutablePartition::BMutablePartition(BPartition::Delegate* delegate)
: fDelegate(delegate), : fDelegate(delegate),
fData(NULL), fData(NULL),
fParent(NULL), fParent(NULL),
fChangeFlags(0),
fChildCookie(NULL) fChildCookie(NULL)
{ {
} }