InstallationLocation: Rename [in]activePackages properties

Add prefix "Latest".
This commit is contained in:
Ingo Weinhold
2014-05-04 20:59:01 +02:00
parent 870e93acf8
commit 5a1c6a7089
4 changed files with 29 additions and 26 deletions
@@ -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. * Distributed under the terms of the MIT License.
*/ */
#ifndef _PACKAGE__INSTALLATION_LOCATION_INFO_H_ #ifndef _PACKAGE__INSTALLATION_LOCATION_INFO_H_
@@ -32,12 +32,13 @@ public:
const node_ref& PackagesDirectoryRef() const; const node_ref& PackagesDirectoryRef() const;
status_t SetPackagesDirectoryRef(const node_ref& ref); status_t SetPackagesDirectoryRef(const node_ref& ref);
const BPackageInfoSet& ActivePackageInfos() const; const BPackageInfoSet& LatestActivePackageInfos() const;
void SetActivePackageInfos( void SetLatestActivePackageInfos(
const BPackageInfoSet& infos); const BPackageInfoSet& infos);
const BPackageInfoSet& InactivePackageInfos() const; const BPackageInfoSet& LatestInactivePackageInfos() const;
void SetInactivePackageInfos( void SetLatestInactivePackageInfos(
const BPackageInfoSet& infos);
const BPackageInfoSet& infos); const BPackageInfoSet& infos);
int64 ChangeCount() const; int64 ChangeCount() const;
@@ -47,8 +48,8 @@ private:
BPackageInstallationLocation fLocation; BPackageInstallationLocation fLocation;
node_ref fBaseDirectoryRef; node_ref fBaseDirectoryRef;
node_ref fPackageDirectoryRef; node_ref fPackageDirectoryRef;
BPackageInfoSet fActivePackageInfos; BPackageInfoSet fLatestActivePackageInfos;
BPackageInfoSet fInactivePackageInfos; BPackageInfoSet fLatestInactivePackageInfos;
int64 fChangeCount; int64 fChangeCount;
}; };
+4 -4
View File
@@ -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. * Distributed under the terms of the MIT License.
* *
* Authors: * Authors:
@@ -87,8 +87,8 @@ BDaemonClient::GetInstallationLocationInfo(
_info.SetBaseDirectoryRef(node_ref(baseDirectoryDevice, baseDirectoryNode)); _info.SetBaseDirectoryRef(node_ref(baseDirectoryDevice, baseDirectoryNode));
_info.SetPackagesDirectoryRef( _info.SetPackagesDirectoryRef(
node_ref(packagesDirectoryDevice, packagesDirectoryNode)); node_ref(packagesDirectoryDevice, packagesDirectoryNode));
_info.SetActivePackageInfos(activePackages); _info.SetLatestActivePackageInfos(activePackages);
_info.SetInactivePackageInfos(inactivePackages); _info.SetLatestInactivePackageInfos(inactivePackages);
_info.SetChangeCount(changeCount); _info.SetChangeCount(changeCount);
return B_OK; return B_OK;
@@ -158,7 +158,7 @@ BDaemonClient::CreateTransaction(BPackageInstallationLocation location,
error = entryRef.set_name(PACKAGES_DIRECTORY_ADMIN_DIRECTORY); error = entryRef.set_name(PACKAGES_DIRECTORY_ADMIN_DIRECTORY);
if (error != B_OK) if (error != B_OK)
return error; return error;
BDirectory adminDirectory; BDirectory adminDirectory;
error = adminDirectory.SetTo(&entryRef); error = adminDirectory.SetTo(&entryRef);
if (error != B_OK) if (error != B_OK)
+15 -13
View File
@@ -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. * Distributed under the terms of the MIT License.
* *
* Authors: * Authors:
@@ -18,8 +18,8 @@ BInstallationLocationInfo::BInstallationLocationInfo()
fLocation(B_PACKAGE_INSTALLATION_LOCATION_ENUM_COUNT), fLocation(B_PACKAGE_INSTALLATION_LOCATION_ENUM_COUNT),
fBaseDirectoryRef(), fBaseDirectoryRef(),
fPackageDirectoryRef(), fPackageDirectoryRef(),
fActivePackageInfos(), fLatestActivePackageInfos(),
fInactivePackageInfos(), fLatestInactivePackageInfos(),
fChangeCount(0) fChangeCount(0)
{ {
} }
@@ -36,8 +36,8 @@ BInstallationLocationInfo::Unset()
fLocation = B_PACKAGE_INSTALLATION_LOCATION_ENUM_COUNT; fLocation = B_PACKAGE_INSTALLATION_LOCATION_ENUM_COUNT;
fBaseDirectoryRef = node_ref(); fBaseDirectoryRef = node_ref();
fPackageDirectoryRef = node_ref(); fPackageDirectoryRef = node_ref();
fActivePackageInfos.MakeEmpty(); fLatestActivePackageInfos.MakeEmpty();
fInactivePackageInfos.MakeEmpty(); fLatestInactivePackageInfos.MakeEmpty();
fChangeCount = 0; fChangeCount = 0;
} }
@@ -87,30 +87,32 @@ BInstallationLocationInfo::SetPackagesDirectoryRef(const node_ref& ref)
const BPackageInfoSet& const BPackageInfoSet&
BInstallationLocationInfo::ActivePackageInfos() const BInstallationLocationInfo::LatestActivePackageInfos() const
{ {
return fActivePackageInfos; return fLatestActivePackageInfos;
} }
void void
BInstallationLocationInfo::SetActivePackageInfos(const BPackageInfoSet& infos) BInstallationLocationInfo::SetLatestActivePackageInfos(
const BPackageInfoSet& infos)
{ {
fActivePackageInfos = infos; fLatestActivePackageInfos = infos;
} }
const BPackageInfoSet& const BPackageInfoSet&
BInstallationLocationInfo::InactivePackageInfos() const BInstallationLocationInfo::LatestInactivePackageInfos() const
{ {
return fInactivePackageInfos; return fLatestInactivePackageInfos;
} }
void void
BInstallationLocationInfo::SetInactivePackageInfos(const BPackageInfoSet& infos) BInstallationLocationInfo::SetLatestInactivePackageInfos(
const BPackageInfoSet& infos)
{ {
fInactivePackageInfos = infos; fLatestInactivePackageInfos = infos;
} }
+2 -2
View File
@@ -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. * Distributed under the terms of the MIT License.
* *
* Authors: * Authors:
@@ -217,7 +217,7 @@ BPackageRoster::GetActivePackages(BPackageInstallationLocation location,
if (error != B_OK) if (error != B_OK)
return error; return error;
packageInfos = info.ActivePackageInfos(); packageInfos = info.LatestActivePackageInfos();
return B_OK; return B_OK;
#else #else
return B_NOT_SUPPORTED; return B_NOT_SUPPORTED;