HaikuDepot: Added "prominence" member to PackageInfo

This commit is contained in:
Stephan Aßmus 2014-11-01 22:44:27 +01:00
parent eac94f5db9
commit 6072a7e417
3 changed files with 25 additions and 1 deletions

View File

@ -463,6 +463,7 @@ PackageInfo::PackageInfo()
fChangelog(),
fUserRatings(),
fCachedRatingSummary(),
fProminence(0.0f),
fScreenshotInfos(),
fScreenshots(),
fState(NONE),
@ -487,6 +488,7 @@ PackageInfo::PackageInfo(const BPackageInfo& info)
fChangelog(),
fUserRatings(),
fCachedRatingSummary(),
fProminence(0.0f),
fScreenshotInfos(),
fScreenshots(),
fState(NONE),
@ -525,6 +527,7 @@ PackageInfo::PackageInfo(const BString& title,
fCategories(),
fUserRatings(),
fCachedRatingSummary(),
fProminence(0.0f),
fScreenshotInfos(),
fScreenshots(),
fState(NONE),
@ -550,6 +553,7 @@ PackageInfo::PackageInfo(const PackageInfo& other)
fCategories(other.fCategories),
fUserRatings(other.fUserRatings),
fCachedRatingSummary(other.fCachedRatingSummary),
fProminence(other.fProminence),
fScreenshotInfos(other.fScreenshotInfos),
fScreenshots(other.fScreenshots),
fState(other.fState),
@ -577,6 +581,7 @@ PackageInfo::operator=(const PackageInfo& other)
fCategories = other.fCategories;
fUserRatings = other.fUserRatings;
fCachedRatingSummary = other.fCachedRatingSummary;
fProminence = other.fProminence;
fScreenshotInfos = other.fScreenshotInfos;
fScreenshots = other.fScreenshots;
fState = other.fState;
@ -605,6 +610,7 @@ PackageInfo::operator==(const PackageInfo& other) const
&& fCategories == other.fCategories
&& fUserRatings == other.fUserRatings
&& fCachedRatingSummary == other.fCachedRatingSummary
&& fProminence == other.fProminence
&& fScreenshotInfos == other.fScreenshotInfos
&& fScreenshots == other.fScreenshots
&& fState == other.fState
@ -831,6 +837,16 @@ PackageInfo::CalculateRatingSummary() const
}
void
PackageInfo::SetProminence(float prominence)
{
if (fProminence != prominence) {
fProminence = prominence;
_NotifyListeners(PKG_CHANGED_PROMINENCE);
}
}
void
PackageInfo::ClearScreenshotInfos()
{

View File

@ -317,6 +317,12 @@ public:
void SetRatingSummary(const RatingSummary& summary);
RatingSummary CalculateRatingSummary() const;
void SetProminence(float prominence);
float Prominence() const
{ return fProminence; }
bool HasProminence() const
{ return fProminence != 0.0f; }
void ClearScreenshotInfos();
bool AddScreenshotInfo(const ScreenshotInfo& info);
const ScreenshotInfoList& ScreenshotInfos() const
@ -348,6 +354,7 @@ private:
CategoryList fCategories;
UserRatingList fUserRatings;
RatingSummary fCachedRatingSummary;
float fProminence;
ScreenshotInfoList fScreenshotInfos;
BitmapList fScreenshots;
PackageState fState;

View File

@ -17,7 +17,8 @@ enum {
PKG_CHANGED_STATE = 1 << 4,
PKG_CHANGED_ICON = 1 << 5,
PKG_CHANGED_CHANGELOG = 1 << 6,
PKG_CHANGED_CATEGORIES = 1 << 7
PKG_CHANGED_CATEGORIES = 1 << 7,
PKG_CHANGED_PROMINENCE = 1 << 8
// ...
};