summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWolf Bergenheim <ext-wolf.2.bergenheim@nokia.com>2010-08-23 10:55:58 +0300
committerWolf Bergenheim <ext-wolf.2.bergenheim@nokia.com>2010-09-06 14:36:05 +0300
commita83adabf1dd858d3dab0cc141fc51fdcb9388d44 (patch)
tree53583a645a36e66d448cf641f536a3d435bbb14d
parente259ac49bc79329e2b6736eab08f666e3ab87615 (diff)
Added debug
-rw-r--r--libresourceqt/src/resource-engine.cpp10
-rw-r--r--libresourceqt/src/resource-set.cpp1
2 files changed, 8 insertions, 3 deletions
diff --git a/libresourceqt/src/resource-engine.cpp b/libresourceqt/src/resource-engine.cpp
index dae826b..6d50b87 100644
--- a/libresourceqt/src/resource-engine.cpp
+++ b/libresourceqt/src/resource-engine.cpp
@@ -207,8 +207,8 @@ static void handleAdviceMessage(resmsg_t *message, resset_t *libresourceSet, voi
void ResourceEngine::receivedAdvice(resmsg_notify_t *message)
{
- qDebug("ResourceEngine(%d) - %s: %04x", identifier, __FUNCTION__, message->resrc);
uint32_t allResources = allResourcesToBitmask(resourceSet);
+ qDebug("ResourceEngine(%d) - %s: have: %02x got %02x", identifier, __FUNCTION__, allResources, message->resrc);
if(message->resrc < allResources) {
emit resourcesLost(allResources-message->resrc);
}
@@ -296,8 +296,11 @@ static inline quint32 allResourcesToBitmask(const ResourceSet *resourceSet)
QList<Resource *> resourceList = resourceSet->resources();
quint32 bitmask = 0;
for (int i = 0; i < resourceList.size(); i++) {
- bitmask += resourceTypeToLibresourceType(resourceList[i]->type());
+ quint32 bits = resourceTypeToLibresourceType(resourceList[i]->type());
+ qDebug("Converted Resource 0x%02x to 0x%02x", resourceList[i]->type(), bits);
+ bitmask += bits;
}
+ qDebug("All resources as bitmask is 0x%04x", bitmask);
return bitmask;
}
@@ -331,7 +334,8 @@ quint32 ResourcePolicy::resourceTypeToLibresourceType(ResourceType type)
case HeadsetButtonsType:
return RESMSG_HEADSET_BUTTONS;
default:
- return 0;
+ qDebug("Unknown resource Type %d", quint32(type));
+ return 0xffff;
}
}
diff --git a/libresourceqt/src/resource-set.cpp b/libresourceqt/src/resource-set.cpp
index babddfe..bc6fd8c 100644
--- a/libresourceqt/src/resource-set.cpp
+++ b/libresourceqt/src/resource-set.cpp
@@ -375,6 +375,7 @@ void ResourceSet::handleReleased()
resourceSet[i]->unsetGranted();
}
}
+ qDebug("ResourceSet(%d) - resourcesReleased!", identifier);
emit resourcesReleased();
}