summaryrefslogtreecommitdiff
path: root/libresourceqt
diff options
context:
space:
mode:
authorWolf Bergenheim <ext-wolf.2.bergenheim@nokia.com>2010-02-10 14:05:08 +0200
committerWolf Bergenheim <ext-wolf.2.bergenheim@nokia.com>2010-02-10 14:05:08 +0200
commit47c2aa40fca1f951dcbf3f3bf36a8481875cdfab (patch)
treea46d8dc2046b3fc2c2362255c57b2ab77adbfc74 /libresourceqt
parent80042b6e527238d11dd2c955e47b652941c2ba6e (diff)
downloadlibresourceqt-47c2aa40fca1f951dcbf3f3bf36a8481875cdfab.tar.gz
Fixed Resource, and users of Resource
Diffstat (limited to 'libresourceqt')
-rw-r--r--libresourceqt/src/resource-engine.cpp22
-rw-r--r--libresourceqt/src/resource.cpp4
2 files changed, 6 insertions, 20 deletions
diff --git a/libresourceqt/src/resource-engine.cpp b/libresourceqt/src/resource-engine.cpp
index 1478e33..e2d6113 100644
--- a/libresourceqt/src/resource-engine.cpp
+++ b/libresourceqt/src/resource-engine.cpp
@@ -5,7 +5,6 @@ using namespace ResourcePolicy;
static inline quint32 allResourcesToBitmask(const ResourceSet *resourceSet);
static inline quint32 optionalResourcesToBitmask(const ResourceSet *resourceSet);
-static inline quint32 sharedResourcesToBitmask(const ResourceSet *resourceSet);
static inline quint32 resourceTypeToLibresourceType(ResourceType type);
static void connectionIsUp(resconn_t *connection);
@@ -102,7 +101,7 @@ bool ResourceEngine::connect()
messageMap.insert(requestId, RESMSG_REGISTER);
- uint32_t allResources, optionalResources, sharedResources;
+ uint32_t allResources, optionalResources;
allResources = allResourcesToBitmask(resourceSet);
optionalResources = optionalResourcesToBitmask(resourceSet);
@@ -132,15 +131,14 @@ bool ResourceEngine::disconnect()
messageMap.insert(requestId, RESMSG_UNREGISTER);
- uint32_t allResources, optionalResources, sharedResources;
+ uint32_t allResources, optionalResources;
allResources = allResourcesToBitmask(resourceSet);
optionalResources = optionalResourcesToBitmask(resourceSet);
- sharedResources = sharedResourcesToBitmask(resourceSet);
resourceMessage.record.rset.all = allResources;
resourceMessage.record.rset.opt = optionalResources;
- resourceMessage.record.rset.share = sharedResources;
- resourceMessage.record.rset.mask = 0; //find out what it is
+ resourceMessage.record.rset.share = 0;
+ resourceMessage.record.rset.mask = mode;
QByteArray ba = resourceSet->applicationClass().toLatin1();
resourceMessage.record.klass = ba.data();
@@ -224,18 +222,6 @@ static inline quint32 optionalResourcesToBitmask(const ResourceSet *resourceSet)
return bitmask;
}
-static inline quint32 sharedResourcesToBitmask(const ResourceSet *resourceSet)
-{
- QList<Resource *> resourceList = resourceSet->resources();
- quint32 bitmask=0;
- for(int i=0; i < resourceList.size(); i++) {
- if(resourceList[i]->isShared()) {
- bitmask += resourceTypeToLibresourceType(resourceList[i]->type());
- }
- }
- return bitmask;
-}
-
static void statusCallbackHandler(resset_t *libresourceSet, resmsg_t *message)
{
ResourceEngine *resourceEngine = reinterpret_cast<ResourceEngine *>(libresourceSet->userdata);
diff --git a/libresourceqt/src/resource.cpp b/libresourceqt/src/resource.cpp
index 796a345..c9bd79e 100644
--- a/libresourceqt/src/resource.cpp
+++ b/libresourceqt/src/resource.cpp
@@ -3,14 +3,14 @@
using namespace ResourcePolicy;
Resource::Resource()
- : optional(false), shared(false),
+ : optional(false),
identifier(0), granted(false)
{
identifier = (quint32)this;
}
Resource::Resource(const Resource &other)
- : optional(other.optional), shared(other.shared),
+ : optional(other.optional),
identifier(other.identifier), granted(other.granted)
{
}