Fix notifications when adding package link dir
When adding a new package link directory, the volume would only be notified about the addition of the directory itself, not of the addition of its contents. Add a new PackageLinkDirectory::NotifyDirectoryAdded() which does the whole job and use it in PackageLinksDirectory::AddPackage().
This commit is contained in:
parent
a70f4da47e
commit
166412ff77
@ -149,6 +149,26 @@ PackageLinkDirectory::UpdatePackageDependencies(Package* package,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
PackageLinkDirectory::NotifyDirectoryAdded(PackageLinksListener* listener)
|
||||||
|
{
|
||||||
|
NodeWriteLocker writeLocker(this);
|
||||||
|
|
||||||
|
listener->PackageLinkNodeAdded(this);
|
||||||
|
|
||||||
|
if (fSelfLink != NULL) {
|
||||||
|
NodeWriteLocker selfLinkLocker(fSelfLink);
|
||||||
|
listener->PackageLinkNodeAdded(fSelfLink);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (FamilyDependencyList::Iterator it = fDependencyLinks.GetIterator();
|
||||||
|
DependencyLink* link = it.Next();) {
|
||||||
|
NodeWriteLocker linkLocker(link);
|
||||||
|
listener->PackageLinkNodeAdded(link);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
PackageLinkDirectory::_Update(PackageLinksListener* listener)
|
PackageLinkDirectory::_Update(PackageLinksListener* listener)
|
||||||
{
|
{
|
||||||
|
@ -32,6 +32,9 @@ public:
|
|||||||
void UpdatePackageDependencies(Package* package,
|
void UpdatePackageDependencies(Package* package,
|
||||||
PackageLinksListener* listener);
|
PackageLinksListener* listener);
|
||||||
|
|
||||||
|
void NotifyDirectoryAdded(
|
||||||
|
PackageLinksListener* listener);
|
||||||
|
|
||||||
bool IsEmpty() const
|
bool IsEmpty() const
|
||||||
{ return fPackages.IsEmpty(); }
|
{ return fPackages.IsEmpty(); }
|
||||||
|
|
||||||
|
@ -70,10 +70,8 @@ PackageLinksDirectory::AddPackage(Package* package)
|
|||||||
// No entry is in the way, so just add the link directory.
|
// No entry is in the way, so just add the link directory.
|
||||||
AddChild(linkDirectory);
|
AddChild(linkDirectory);
|
||||||
|
|
||||||
if (fListener != NULL) {
|
if (fListener != NULL)
|
||||||
NodeWriteLocker linkDirectoryWriteLocker(linkDirectory);
|
linkDirectory->NotifyDirectoryAdded(fListener);
|
||||||
fListener->PackageLinkNodeAdded(linkDirectory);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return B_OK;
|
return B_OK;
|
||||||
|
Loading…
Reference in New Issue
Block a user