summaryrefslogtreecommitdiff
path: root/resourceqt-client/client.cpp
diff options
context:
space:
mode:
authorMartin Wolf <ext-martin.2.wolf@nokia.com>2010-04-07 13:33:26 +0300
committerMartin Wolf <ext-martin.2.wolf@nokia.com>2010-04-07 13:33:26 +0300
commit7bfa856f0673b81d4d0dafd6e02e07f10f07a023 (patch)
tree309ac66b5cbfe77df701fc9c7a0c7e5a68d147e7 /resourceqt-client/client.cpp
parenta19a377ae930d54beb98dbe1f6171c6d39ddea80 (diff)
dbus-qeventloop update
Diffstat (limited to 'resourceqt-client/client.cpp')
-rw-r--r--resourceqt-client/client.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/resourceqt-client/client.cpp b/resourceqt-client/client.cpp
index 078e6e4..e0adbd0 100644
--- a/resourceqt-client/client.cpp
+++ b/resourceqt-client/client.cpp
@@ -297,6 +297,10 @@ void Client::showResources(const QList<Resource*> resList)
void Client::resourceAcquiredHandler(const QList<ResourceType>& /*grantedResList*/)
{
+ if( timeStat.markEnd() ) {
+ timeStat.report("\nOperation took %.2f ms\n");
+ }
+
QList<Resource*> list = resourceSet->resources();
if (!list.count()) {
printf("\nGranted resource set is empty. Possible bug?\n");
@@ -311,18 +315,30 @@ void Client::resourceAcquiredHandler(const QList<ResourceType>& /*grantedResList
void Client::resourceDeniedHandler()
{
+ if( timeStat.markEnd() ) {
+ timeStat.report("\nOperation took %.2f ms\n");
+ }
+
printf("\nManager denies access to resources!\n");
showPrompt();
}
void Client::resourceLostHandler()
{
+ if( timeStat.markEnd() ) {
+ timeStat.report("\nOperation took %.2f ms\n");
+ }
+
printf("\nLost resources from manager!\n");
showPrompt();
}
void Client::resourceReleasedHandler()
{
+ if( timeStat.markEnd() ) {
+ timeStat.report("\nOperation took %.2f ms\n");
+ }
+
printf("\nAll resources released\n");
showPrompt();
}
@@ -376,12 +392,22 @@ void Client::timerEvent(QTimerEvent*)
}
}
else if (params[0] == "acquire") {
+ timeStat.markStart();
if (!resourceSet || !resourceSet->acquire()) {
+ if( timeStat.markEnd() ) {
+ timeStat.report("Operation took %.2f ms\n");
+ }
+
printf("Acquire failed!\n");
}
}
else if (params[0] == "release") {
+ timeStat.markStart();
if (!resourceSet || !resourceSet->release()) {
+ if( timeStat.markEnd() ) {
+ timeStat.report("Operation took %.2f ms\n");
+ }
+
printf("Release failed!\n");
}
}