HaikuDepot: Store BPackageVersion in PackageInfo...
...instead of the string representation. This makes it easier to get the major, minor, micro, prerelease and revision parts later on.
This commit is contained in:
parent
d7f449e9bc
commit
46bcb34d05
@ -11,6 +11,7 @@
|
||||
#include <package/PackageFlags.h>
|
||||
|
||||
|
||||
|
||||
// #pragma mark - UserInfo
|
||||
|
||||
|
||||
@ -466,7 +467,7 @@ PackageInfo::PackageInfo()
|
||||
|
||||
|
||||
PackageInfo::PackageInfo(const BString& title,
|
||||
const BString& version, const PublisherInfo& publisher,
|
||||
const BPackageVersion& version, const PublisherInfo& publisher,
|
||||
const BString& shortDescription, const BString& fullDescription,
|
||||
int32 flags, const char* architecture)
|
||||
:
|
||||
|
@ -9,7 +9,7 @@
|
||||
#include <set>
|
||||
|
||||
#include <Referenceable.h>
|
||||
#include <String.h>
|
||||
#include <package/PackageVersion.h>
|
||||
|
||||
#include "List.h"
|
||||
#include "PackageInfoListener.h"
|
||||
@ -229,12 +229,15 @@ enum PackageState {
|
||||
};
|
||||
|
||||
|
||||
using BPackageKit::BPackageVersion;
|
||||
|
||||
|
||||
class PackageInfo : public BReferenceable {
|
||||
public:
|
||||
PackageInfo();
|
||||
PackageInfo(
|
||||
const BString& title,
|
||||
const BString& version,
|
||||
const BPackageVersion& version,
|
||||
const PublisherInfo& publisher,
|
||||
const BString& shortDescription,
|
||||
const BString& fullDescription,
|
||||
@ -248,7 +251,7 @@ public:
|
||||
|
||||
const BString& Title() const
|
||||
{ return fTitle; }
|
||||
const BString& Version() const
|
||||
const BPackageVersion& Version() const
|
||||
{ return fVersion; }
|
||||
void SetShortDescription(const BString& description);
|
||||
const BString& ShortDescription() const
|
||||
@ -323,7 +326,7 @@ private:
|
||||
private:
|
||||
BitmapRef fIcon;
|
||||
BString fTitle;
|
||||
BString fVersion;
|
||||
BPackageVersion fVersion;
|
||||
PublisherInfo fPublisher;
|
||||
BString fShortDescription;
|
||||
BString fFullDescription;
|
||||
|
@ -641,7 +641,7 @@ MainWindow::_RefreshPackageList()
|
||||
|
||||
modelInfo.SetTo(new(std::nothrow) PackageInfo(
|
||||
repoPackageInfo.Name(),
|
||||
repoPackageInfo.Version().ToString(),
|
||||
repoPackageInfo.Version(),
|
||||
PublisherInfo(BitmapRef(), publisherName,
|
||||
"", publisherURL), repoPackageInfo.Summary(),
|
||||
repoPackageInfo.Description(),
|
||||
|
@ -514,7 +514,7 @@ public:
|
||||
fPublisherView->SetText(publisher);
|
||||
|
||||
BString version = B_TRANSLATE("%Version%");
|
||||
version.ReplaceAll("%Version%", package.Version());
|
||||
version.ReplaceAll("%Version%", package.Version().ToString());
|
||||
fVersionInfo->SetText(version);
|
||||
|
||||
RatingSummary ratingSummary = package.CalculateRatingSummary();
|
||||
|
Loading…
x
Reference in New Issue
Block a user