From a83adabf1dd858d3dab0cc141fc51fdcb9388d44 Mon Sep 17 00:00:00 2001 From: Wolf Bergenheim Date: Mon, 23 Aug 2010 10:55:58 +0300 Subject: Added debug --- libresourceqt/src/resource-engine.cpp | 10 +++++++--- libresourceqt/src/resource-set.cpp | 1 + 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 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(); } -- cgit v1.2.3