BSolverRepository: Add {Remove,Delete}Package()
This commit is contained in:
@@ -65,6 +65,8 @@ public:
|
|||||||
BSolverPackage** _package = NULL);
|
BSolverPackage** _package = NULL);
|
||||||
status_t AddPackages(
|
status_t AddPackages(
|
||||||
BPackageInstallationLocation location);
|
BPackageInstallationLocation location);
|
||||||
|
bool RemovePackage(BSolverPackage* package);
|
||||||
|
bool DeletePackage(BSolverPackage* package);
|
||||||
|
|
||||||
uint64 ChangeCount() const;
|
uint64 ChangeCount() const;
|
||||||
|
|
||||||
|
|||||||
@@ -309,6 +309,28 @@ BSolverRepository::AddPackages(BPackageInstallationLocation location)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool
|
||||||
|
BSolverRepository::RemovePackage(BSolverPackage* package)
|
||||||
|
{
|
||||||
|
if (!fPackages.RemoveItem(package, false))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
fChangeCount++;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool
|
||||||
|
BSolverRepository::DeletePackage(BSolverPackage* package)
|
||||||
|
{
|
||||||
|
if (!RemovePackage(package))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
delete package;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
uint64
|
uint64
|
||||||
BSolverRepository::ChangeCount() const
|
BSolverRepository::ChangeCount() const
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user