diff --git a/src/apps/haikudepot/model/PackageInfo.cpp b/src/apps/haikudepot/model/PackageInfo.cpp index d3bbdd9417..2825a57058 100644 --- a/src/apps/haikudepot/model/PackageInfo.cpp +++ b/src/apps/haikudepot/model/PackageInfo.cpp @@ -466,7 +466,8 @@ PackageInfo::PackageInfo() fDownloadProgress(0.0), fFlags(0), fSystemDependency(false), - fArchitecture() + fArchitecture(), + fLocalFilePath() { } @@ -488,7 +489,8 @@ PackageInfo::PackageInfo(const BPackageInfo& info) fDownloadProgress(0.0), fFlags(info.Flags()), fSystemDependency(false), - fArchitecture(info.ArchitectureName()) + fArchitecture(info.ArchitectureName()), + fLocalFilePath() { BString publisherURL; if (info.URLList().CountStrings() > 0) @@ -524,7 +526,8 @@ PackageInfo::PackageInfo(const BString& title, fDownloadProgress(0.0), fFlags(flags), fSystemDependency(false), - fArchitecture(architecture) + fArchitecture(architecture), + fLocalFilePath() { } @@ -548,7 +551,8 @@ PackageInfo::PackageInfo(const PackageInfo& other) fDownloadProgress(other.fDownloadProgress), fFlags(other.fFlags), fSystemDependency(other.fSystemDependency), - fArchitecture(other.fArchitecture) + fArchitecture(other.fArchitecture), + fLocalFilePath(other.fLocalFilePath) { } @@ -574,6 +578,8 @@ PackageInfo::operator=(const PackageInfo& other) fFlags = other.fFlags; fSystemDependency = other.fSystemDependency; fArchitecture = other.fArchitecture; + fLocalFilePath = other.fLocalFilePath; + return *this; } @@ -597,7 +603,8 @@ PackageInfo::operator==(const PackageInfo& other) const && fFlags == other.fFlags && fDownloadProgress == other.fDownloadProgress && fSystemDependency == other.fSystemDependency - && fArchitecture == other.fArchitecture; + && fArchitecture == other.fArchitecture + && fLocalFilePath == other.fLocalFilePath; } @@ -713,6 +720,13 @@ PackageInfo::SetDownloadProgress(float progress) } +void +PackageInfo::SetLocalFilePath(const char* path) +{ + fLocalFilePath = path; +} + + void PackageInfo::ClearUserRatings() { diff --git a/src/apps/haikudepot/model/PackageInfo.h b/src/apps/haikudepot/model/PackageInfo.h index 741b2c274d..3bc50cfaea 100644 --- a/src/apps/haikudepot/model/PackageInfo.h +++ b/src/apps/haikudepot/model/PackageInfo.h @@ -295,6 +295,12 @@ public: { return fDownloadProgress; } void SetDownloadProgress(float progress); + void SetLocalFilePath(const char* path); + const BString& LocalFilePath() const + { return fLocalFilePath; } + bool IsLocalFile() const + { return !fLocalFilePath.IsEmpty(); } + void ClearCategories(); bool AddCategory(const CategoryRef& category); const CategoryList& Categories() const @@ -348,6 +354,7 @@ private: int32 fFlags; bool fSystemDependency; BString fArchitecture; + BString fLocalFilePath; static BitmapRef sDefaultIcon; }; diff --git a/src/apps/haikudepot/ui/App.cpp b/src/apps/haikudepot/ui/App.cpp index 7b320fe2fb..f30858bc17 100644 --- a/src/apps/haikudepot/ui/App.cpp +++ b/src/apps/haikudepot/ui/App.cpp @@ -144,6 +144,8 @@ App::_Open(const BEntry& entry) fprintf(stderr, "Could not allocate PackageInfo\n"); return; } + + package->SetLocalFilePath(path.Path()); BMessage settings; _LoadSettings(settings);