HaikuDepot: Added ability to store screenshots in PackageInfo.

This commit is contained in:
Stephan Aßmus
2013-08-04 18:29:20 +02:00
parent 168c3c8b34
commit 9ecd9f0294
2 changed files with 23 additions and 4 deletions
+16 -4
View File
@@ -373,7 +373,8 @@ PackageInfo::PackageInfo()
fShortDescription(), fShortDescription(),
fFullDescription(), fFullDescription(),
fChangelog(), fChangelog(),
fUserRatings() fUserRatings(),
fScreenshots()
{ {
} }
@@ -390,7 +391,8 @@ PackageInfo::PackageInfo(const BitmapRef& icon, const BString& title,
fShortDescription(shortDescription), fShortDescription(shortDescription),
fFullDescription(fullDescription), fFullDescription(fullDescription),
fChangelog(changelog), fChangelog(changelog),
fUserRatings() fUserRatings(),
fScreenshots()
{ {
} }
@@ -404,7 +406,8 @@ PackageInfo::PackageInfo(const PackageInfo& other)
fShortDescription(other.fShortDescription), fShortDescription(other.fShortDescription),
fFullDescription(other.fFullDescription), fFullDescription(other.fFullDescription),
fChangelog(other.fChangelog), fChangelog(other.fChangelog),
fUserRatings(other.fUserRatings) fUserRatings(other.fUserRatings),
fScreenshots(other.fScreenshots)
{ {
} }
@@ -420,6 +423,7 @@ PackageInfo::operator=(const PackageInfo& other)
fFullDescription = other.fFullDescription; fFullDescription = other.fFullDescription;
fChangelog = other.fChangelog; fChangelog = other.fChangelog;
fUserRatings = other.fUserRatings; fUserRatings = other.fUserRatings;
fScreenshots = other.fScreenshots;
return *this; return *this;
} }
@@ -434,7 +438,8 @@ PackageInfo::operator==(const PackageInfo& other) const
&& fShortDescription == other.fShortDescription && fShortDescription == other.fShortDescription
&& fFullDescription == other.fFullDescription && fFullDescription == other.fFullDescription
&& fChangelog == other.fChangelog && fChangelog == other.fChangelog
&& fUserRatings == other.fUserRatings; && fUserRatings == other.fUserRatings
&& fScreenshots == other.fScreenshots;
} }
@@ -494,6 +499,13 @@ PackageInfo::CalculateRatingSummary() const
} }
bool
PackageInfo::AddScreenshot(const BitmapRef& screenshot)
{
return fScreenshots.Add(screenshot);
}
// #pragma mark - // #pragma mark -
+7
View File
@@ -42,6 +42,7 @@ private:
typedef BReference<SharedBitmap> BitmapRef; typedef BReference<SharedBitmap> BitmapRef;
typedef List<BitmapRef, false> BitmapList;
class UserInfo { class UserInfo {
@@ -181,6 +182,11 @@ public:
RatingSummary CalculateRatingSummary() const; RatingSummary CalculateRatingSummary() const;
bool AddScreenshot(const BitmapRef& screenshot);
const BitmapList& Screenshots() const
{ return fScreenshots; }
private: private:
BitmapRef fIcon; BitmapRef fIcon;
BString fTitle; BString fTitle;
@@ -190,6 +196,7 @@ private:
BString fFullDescription; BString fFullDescription;
BString fChangelog; BString fChangelog;
UserRatingList fUserRatings; UserRatingList fUserRatings;
BitmapList fScreenshots;
}; };