BSolverRepository: Add a change count
... so we can easily check whether the repository has changed since the last time we used it.
This commit is contained in:
@@ -63,6 +63,8 @@ public:
|
|||||||
status_t AddPackages(
|
status_t AddPackages(
|
||||||
BPackageInstallationLocation location);
|
BPackageInstallationLocation location);
|
||||||
|
|
||||||
|
uint64 ChangeCount() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
typedef BObjectList<BSolverPackage> PackageList;
|
typedef BObjectList<BSolverPackage> PackageList;
|
||||||
|
|
||||||
@@ -71,6 +73,7 @@ private:
|
|||||||
uint8 fPriority;
|
uint8 fPriority;
|
||||||
bool fIsInstalled;
|
bool fIsInstalled;
|
||||||
PackageList fPackages;
|
PackageList fPackages;
|
||||||
|
uint64 fChangeCount;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -27,7 +27,8 @@ BSolverRepository::BSolverRepository()
|
|||||||
fName(),
|
fName(),
|
||||||
fPriority(0),
|
fPriority(0),
|
||||||
fIsInstalled(false),
|
fIsInstalled(false),
|
||||||
fPackages(kInitialPackageListSize, true)
|
fPackages(kInitialPackageListSize, true),
|
||||||
|
fChangeCount(0)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -37,7 +38,8 @@ BSolverRepository::BSolverRepository(const BString& name)
|
|||||||
fName(),
|
fName(),
|
||||||
fPriority(0),
|
fPriority(0),
|
||||||
fIsInstalled(false),
|
fIsInstalled(false),
|
||||||
fPackages(kInitialPackageListSize, true)
|
fPackages(kInitialPackageListSize, true),
|
||||||
|
fChangeCount(0)
|
||||||
{
|
{
|
||||||
SetTo(name);
|
SetTo(name);
|
||||||
}
|
}
|
||||||
@@ -48,7 +50,8 @@ BSolverRepository::BSolverRepository(BPackageInstallationLocation location)
|
|||||||
fName(),
|
fName(),
|
||||||
fPriority(0),
|
fPriority(0),
|
||||||
fIsInstalled(false),
|
fIsInstalled(false),
|
||||||
fPackages(kInitialPackageListSize, true)
|
fPackages(kInitialPackageListSize, true),
|
||||||
|
fChangeCount(0)
|
||||||
{
|
{
|
||||||
SetTo(location);
|
SetTo(location);
|
||||||
}
|
}
|
||||||
@@ -59,7 +62,8 @@ BSolverRepository::BSolverRepository(BAllInstallationLocations)
|
|||||||
fName(),
|
fName(),
|
||||||
fPriority(0),
|
fPriority(0),
|
||||||
fIsInstalled(false),
|
fIsInstalled(false),
|
||||||
fPackages(kInitialPackageListSize, true)
|
fPackages(kInitialPackageListSize, true),
|
||||||
|
fChangeCount(0)
|
||||||
{
|
{
|
||||||
SetTo(B_ALL_INSTALLATION_LOCATIONS);
|
SetTo(B_ALL_INSTALLATION_LOCATIONS);
|
||||||
}
|
}
|
||||||
@@ -70,7 +74,8 @@ BSolverRepository::BSolverRepository(const BRepositoryConfig& config)
|
|||||||
fName(),
|
fName(),
|
||||||
fPriority(0),
|
fPriority(0),
|
||||||
fIsInstalled(false),
|
fIsInstalled(false),
|
||||||
fPackages(kInitialPackageListSize, true)
|
fPackages(kInitialPackageListSize, true),
|
||||||
|
fChangeCount(0)
|
||||||
{
|
{
|
||||||
SetTo(config);
|
SetTo(config);
|
||||||
}
|
}
|
||||||
@@ -171,6 +176,7 @@ BSolverRepository::Unset()
|
|||||||
fPriority = 0;
|
fPriority = 0;
|
||||||
fIsInstalled = false;
|
fIsInstalled = false;
|
||||||
fPackages.MakeEmpty();
|
fPackages.MakeEmpty();
|
||||||
|
fChangeCount++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -192,6 +198,7 @@ void
|
|||||||
BSolverRepository::SetInstalled(bool isInstalled)
|
BSolverRepository::SetInstalled(bool isInstalled)
|
||||||
{
|
{
|
||||||
fIsInstalled = isInstalled;
|
fIsInstalled = isInstalled;
|
||||||
|
fChangeCount++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -213,6 +220,7 @@ void
|
|||||||
BSolverRepository::SetPriority(uint8 priority)
|
BSolverRepository::SetPriority(uint8 priority)
|
||||||
{
|
{
|
||||||
fPriority = priority;
|
fPriority = priority;
|
||||||
|
fChangeCount++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -247,6 +255,8 @@ BSolverRepository::AddPackage(const BPackageInfo& info,
|
|||||||
return B_NO_MEMORY;
|
return B_NO_MEMORY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fChangeCount++;
|
||||||
|
|
||||||
if (_package != NULL)
|
if (_package != NULL)
|
||||||
*_package = package;
|
*_package = package;
|
||||||
|
|
||||||
@@ -274,4 +284,11 @@ BSolverRepository::AddPackages(BPackageInstallationLocation location)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
uint64
|
||||||
|
BSolverRepository::ChangeCount() const
|
||||||
|
{
|
||||||
|
return fChangeCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
} // namespace BPackageKit
|
} // namespace BPackageKit
|
||||||
|
|||||||
Reference in New Issue
Block a user