Implement getting a BInstallationLocationInfo
* Rename PackageDaemonDefs.h to DaemonDefs.h.
* Replace the MESSAGE_GET_PACKAGES by the new
B_MESSAGE_GET_INSTALLATION_LOCATION_INFO, which not only returns the
packages, but also other information about the installation location.
* daemon: Volume: Implement a change count which is bumped whenever
packages are activated/deactivated/added/removed. Cache the reply
for a location info request, using the change count to check whether
it is still up-to-date.
* Add private BDaemonClient for communication with the daemon.
* BRoster:
- Add GetInstallationLocationInfo() using BDaemonClient.
- Reimplement GetActivePackages(), using
GetInstallationLocationInfo().
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
* Copyright 2013, Haiku, Inc. All Rights Reserved.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*
|
||||
* Authors:
|
||||
* Ingo Weinhold <[email protected]>
|
||||
*/
|
||||
#ifndef _PACKAGE__PRIVATE__DAEMON_CLIENT_H_
|
||||
#define _PACKAGE__PRIVATE__DAEMON_CLIENT_H_
|
||||
|
||||
|
||||
#include <Messenger.h>
|
||||
#include <package/PackageDefs.h>
|
||||
|
||||
|
||||
namespace BPackageKit {
|
||||
|
||||
|
||||
class BInstallationLocationInfo;
|
||||
class BPackageInfoSet;
|
||||
|
||||
|
||||
namespace BPrivate {
|
||||
|
||||
|
||||
class BDaemonClient {
|
||||
public:
|
||||
BDaemonClient();
|
||||
~BDaemonClient();
|
||||
|
||||
status_t GetInstallationLocationInfo(
|
||||
BPackageInstallationLocation location,
|
||||
BInstallationLocationInfo& _info);
|
||||
|
||||
private:
|
||||
status_t _InitMessenger();
|
||||
status_t _ExtractPackageInfoSet(const BMessage& message,
|
||||
const char* field, BPackageInfoSet& _infos);
|
||||
|
||||
private:
|
||||
BMessenger fDaemonMessenger;
|
||||
};
|
||||
|
||||
|
||||
} // namespace BPrivate
|
||||
} // namespace BPackageKit
|
||||
|
||||
|
||||
#endif // _PACKAGE__PRIVATE__DAEMON_CLIENT_H_
|
||||
Reference in New Issue
Block a user