BSolverRepository::AddPackage(): Add optional return parameter
... returning the added BSolverPackage object.
This commit is contained in:
parent
749884283a
commit
a8b832bf46
@ -58,7 +58,8 @@ public:
|
||||
int32 CountPackages() const;
|
||||
BSolverPackage* PackageAt(int32 index) const;
|
||||
|
||||
status_t AddPackage(const BPackageInfo& info);
|
||||
status_t AddPackage(const BPackageInfo& info,
|
||||
BSolverPackage** _package = NULL);
|
||||
status_t AddPackages(
|
||||
BPackageInstallationLocation location);
|
||||
|
||||
|
@ -238,7 +238,8 @@ BSolverRepository::PackageAt(int32 index) const
|
||||
|
||||
|
||||
status_t
|
||||
BSolverRepository::AddPackage(const BPackageInfo& info)
|
||||
BSolverRepository::AddPackage(const BPackageInfo& info,
|
||||
BSolverPackage** _package = NULL)
|
||||
{
|
||||
BSolverPackage* package = new(std::nothrow) BSolverPackage(this, info);
|
||||
if (package == NULL || !fPackages.AddItem(package)) {
|
||||
@ -246,6 +247,9 @@ BSolverRepository::AddPackage(const BPackageInfo& info)
|
||||
return B_NO_MEMORY;
|
||||
}
|
||||
|
||||
if (_package != NULL)
|
||||
*_package = package;
|
||||
|
||||
return B_OK;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user