From 5a1c6a7089489ff556bb69b392c64dd370802ac1 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Thu, 1 May 2014 23:50:18 +0200 Subject: [PATCH] InstallationLocation: Rename [in]activePackages properties Add prefix "Latest". --- headers/os/package/InstallationLocationInfo.h | 15 +++++----- src/kits/package/DaemonClient.cpp | 8 +++--- src/kits/package/InstallationLocationInfo.cpp | 28 ++++++++++--------- src/kits/package/PackageRoster.cpp | 4 +-- 4 files changed, 29 insertions(+), 26 deletions(-) diff --git a/headers/os/package/InstallationLocationInfo.h b/headers/os/package/InstallationLocationInfo.h index 3bdec66666..d07cae95bb 100644 --- a/headers/os/package/InstallationLocationInfo.h +++ b/headers/os/package/InstallationLocationInfo.h @@ -1,5 +1,5 @@ /* - * Copyright 2013, Haiku, Inc. All Rights Reserved. + * Copyright 2013-2014, Haiku, Inc. All Rights Reserved. * Distributed under the terms of the MIT License. */ #ifndef _PACKAGE__INSTALLATION_LOCATION_INFO_H_ @@ -32,12 +32,13 @@ public: const node_ref& PackagesDirectoryRef() const; status_t SetPackagesDirectoryRef(const node_ref& ref); - const BPackageInfoSet& ActivePackageInfos() const; - void SetActivePackageInfos( + const BPackageInfoSet& LatestActivePackageInfos() const; + void SetLatestActivePackageInfos( const BPackageInfoSet& infos); - const BPackageInfoSet& InactivePackageInfos() const; - void SetInactivePackageInfos( + const BPackageInfoSet& LatestInactivePackageInfos() const; + void SetLatestInactivePackageInfos( + const BPackageInfoSet& infos); const BPackageInfoSet& infos); int64 ChangeCount() const; @@ -47,8 +48,8 @@ private: BPackageInstallationLocation fLocation; node_ref fBaseDirectoryRef; node_ref fPackageDirectoryRef; - BPackageInfoSet fActivePackageInfos; - BPackageInfoSet fInactivePackageInfos; + BPackageInfoSet fLatestActivePackageInfos; + BPackageInfoSet fLatestInactivePackageInfos; int64 fChangeCount; }; diff --git a/src/kits/package/DaemonClient.cpp b/src/kits/package/DaemonClient.cpp index bbca3c6aae..243d15e5cc 100644 --- a/src/kits/package/DaemonClient.cpp +++ b/src/kits/package/DaemonClient.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2013, Haiku, Inc. All Rights Reserved. + * Copyright 2013-2014, Haiku, Inc. All Rights Reserved. * Distributed under the terms of the MIT License. * * Authors: @@ -87,8 +87,8 @@ BDaemonClient::GetInstallationLocationInfo( _info.SetBaseDirectoryRef(node_ref(baseDirectoryDevice, baseDirectoryNode)); _info.SetPackagesDirectoryRef( node_ref(packagesDirectoryDevice, packagesDirectoryNode)); - _info.SetActivePackageInfos(activePackages); - _info.SetInactivePackageInfos(inactivePackages); + _info.SetLatestActivePackageInfos(activePackages); + _info.SetLatestInactivePackageInfos(inactivePackages); _info.SetChangeCount(changeCount); return B_OK; @@ -158,7 +158,7 @@ BDaemonClient::CreateTransaction(BPackageInstallationLocation location, error = entryRef.set_name(PACKAGES_DIRECTORY_ADMIN_DIRECTORY); if (error != B_OK) return error; - + BDirectory adminDirectory; error = adminDirectory.SetTo(&entryRef); if (error != B_OK) diff --git a/src/kits/package/InstallationLocationInfo.cpp b/src/kits/package/InstallationLocationInfo.cpp index 6d67d07078..06d55983f1 100644 --- a/src/kits/package/InstallationLocationInfo.cpp +++ b/src/kits/package/InstallationLocationInfo.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2013, Haiku, Inc. All Rights Reserved. + * Copyright 2013-2014, Haiku, Inc. All Rights Reserved. * Distributed under the terms of the MIT License. * * Authors: @@ -18,8 +18,8 @@ BInstallationLocationInfo::BInstallationLocationInfo() fLocation(B_PACKAGE_INSTALLATION_LOCATION_ENUM_COUNT), fBaseDirectoryRef(), fPackageDirectoryRef(), - fActivePackageInfos(), - fInactivePackageInfos(), + fLatestActivePackageInfos(), + fLatestInactivePackageInfos(), fChangeCount(0) { } @@ -36,8 +36,8 @@ BInstallationLocationInfo::Unset() fLocation = B_PACKAGE_INSTALLATION_LOCATION_ENUM_COUNT; fBaseDirectoryRef = node_ref(); fPackageDirectoryRef = node_ref(); - fActivePackageInfos.MakeEmpty(); - fInactivePackageInfos.MakeEmpty(); + fLatestActivePackageInfos.MakeEmpty(); + fLatestInactivePackageInfos.MakeEmpty(); fChangeCount = 0; } @@ -87,30 +87,32 @@ BInstallationLocationInfo::SetPackagesDirectoryRef(const node_ref& ref) const BPackageInfoSet& -BInstallationLocationInfo::ActivePackageInfos() const +BInstallationLocationInfo::LatestActivePackageInfos() const { - return fActivePackageInfos; + return fLatestActivePackageInfos; } void -BInstallationLocationInfo::SetActivePackageInfos(const BPackageInfoSet& infos) +BInstallationLocationInfo::SetLatestActivePackageInfos( + const BPackageInfoSet& infos) { - fActivePackageInfos = infos; + fLatestActivePackageInfos = infos; } const BPackageInfoSet& -BInstallationLocationInfo::InactivePackageInfos() const +BInstallationLocationInfo::LatestInactivePackageInfos() const { - return fInactivePackageInfos; + return fLatestInactivePackageInfos; } void -BInstallationLocationInfo::SetInactivePackageInfos(const BPackageInfoSet& infos) +BInstallationLocationInfo::SetLatestInactivePackageInfos( + const BPackageInfoSet& infos) { - fInactivePackageInfos = infos; + fLatestInactivePackageInfos = infos; } diff --git a/src/kits/package/PackageRoster.cpp b/src/kits/package/PackageRoster.cpp index 048b36da0e..3c0e5125c1 100644 --- a/src/kits/package/PackageRoster.cpp +++ b/src/kits/package/PackageRoster.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2011, Haiku, Inc. All Rights Reserved. + * Copyright 2011-2014, Haiku, Inc. All Rights Reserved. * Distributed under the terms of the MIT License. * * Authors: @@ -217,7 +217,7 @@ BPackageRoster::GetActivePackages(BPackageInstallationLocation location, if (error != B_OK) return error; - packageInfos = info.ActivePackageInfos(); + packageInfos = info.LatestActivePackageInfos(); return B_OK; #else return B_NOT_SUPPORTED;