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:
@@ -11,6 +11,7 @@
|
|||||||
#include <package/PackageFlags.h>
|
#include <package/PackageFlags.h>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// #pragma mark - UserInfo
|
// #pragma mark - UserInfo
|
||||||
|
|
||||||
|
|
||||||
@@ -466,7 +467,7 @@ PackageInfo::PackageInfo()
|
|||||||
|
|
||||||
|
|
||||||
PackageInfo::PackageInfo(const BString& title,
|
PackageInfo::PackageInfo(const BString& title,
|
||||||
const BString& version, const PublisherInfo& publisher,
|
const BPackageVersion& version, const PublisherInfo& publisher,
|
||||||
const BString& shortDescription, const BString& fullDescription,
|
const BString& shortDescription, const BString& fullDescription,
|
||||||
int32 flags, const char* architecture)
|
int32 flags, const char* architecture)
|
||||||
:
|
:
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
#include <set>
|
#include <set>
|
||||||
|
|
||||||
#include <Referenceable.h>
|
#include <Referenceable.h>
|
||||||
#include <String.h>
|
#include <package/PackageVersion.h>
|
||||||
|
|
||||||
#include "List.h"
|
#include "List.h"
|
||||||
#include "PackageInfoListener.h"
|
#include "PackageInfoListener.h"
|
||||||
@@ -229,12 +229,15 @@ enum PackageState {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
using BPackageKit::BPackageVersion;
|
||||||
|
|
||||||
|
|
||||||
class PackageInfo : public BReferenceable {
|
class PackageInfo : public BReferenceable {
|
||||||
public:
|
public:
|
||||||
PackageInfo();
|
PackageInfo();
|
||||||
PackageInfo(
|
PackageInfo(
|
||||||
const BString& title,
|
const BString& title,
|
||||||
const BString& version,
|
const BPackageVersion& version,
|
||||||
const PublisherInfo& publisher,
|
const PublisherInfo& publisher,
|
||||||
const BString& shortDescription,
|
const BString& shortDescription,
|
||||||
const BString& fullDescription,
|
const BString& fullDescription,
|
||||||
@@ -248,7 +251,7 @@ public:
|
|||||||
|
|
||||||
const BString& Title() const
|
const BString& Title() const
|
||||||
{ return fTitle; }
|
{ return fTitle; }
|
||||||
const BString& Version() const
|
const BPackageVersion& Version() const
|
||||||
{ return fVersion; }
|
{ return fVersion; }
|
||||||
void SetShortDescription(const BString& description);
|
void SetShortDescription(const BString& description);
|
||||||
const BString& ShortDescription() const
|
const BString& ShortDescription() const
|
||||||
@@ -323,7 +326,7 @@ private:
|
|||||||
private:
|
private:
|
||||||
BitmapRef fIcon;
|
BitmapRef fIcon;
|
||||||
BString fTitle;
|
BString fTitle;
|
||||||
BString fVersion;
|
BPackageVersion fVersion;
|
||||||
PublisherInfo fPublisher;
|
PublisherInfo fPublisher;
|
||||||
BString fShortDescription;
|
BString fShortDescription;
|
||||||
BString fFullDescription;
|
BString fFullDescription;
|
||||||
|
|||||||
@@ -641,7 +641,7 @@ MainWindow::_RefreshPackageList()
|
|||||||
|
|
||||||
modelInfo.SetTo(new(std::nothrow) PackageInfo(
|
modelInfo.SetTo(new(std::nothrow) PackageInfo(
|
||||||
repoPackageInfo.Name(),
|
repoPackageInfo.Name(),
|
||||||
repoPackageInfo.Version().ToString(),
|
repoPackageInfo.Version(),
|
||||||
PublisherInfo(BitmapRef(), publisherName,
|
PublisherInfo(BitmapRef(), publisherName,
|
||||||
"", publisherURL), repoPackageInfo.Summary(),
|
"", publisherURL), repoPackageInfo.Summary(),
|
||||||
repoPackageInfo.Description(),
|
repoPackageInfo.Description(),
|
||||||
|
|||||||
@@ -514,7 +514,7 @@ public:
|
|||||||
fPublisherView->SetText(publisher);
|
fPublisherView->SetText(publisher);
|
||||||
|
|
||||||
BString version = B_TRANSLATE("%Version%");
|
BString version = B_TRANSLATE("%Version%");
|
||||||
version.ReplaceAll("%Version%", package.Version());
|
version.ReplaceAll("%Version%", package.Version().ToString());
|
||||||
fVersionInfo->SetText(version);
|
fVersionInfo->SetText(version);
|
||||||
|
|
||||||
RatingSummary ratingSummary = package.CalculateRatingSummary();
|
RatingSummary ratingSummary = package.CalculateRatingSummary();
|
||||||
|
|||||||
Reference in New Issue
Block a user