From 05f8fa1ebccab6eb55ccbd8a3921bc7016512749 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20L=C3=B6fman?= Date: Thu, 18 Nov 2010 14:50:40 +0200 Subject: Added bool ResourceSet::initAndConnect() so that one can connect without acquiring. --- resourceqt-client/client.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'resourceqt-client') diff --git a/resourceqt-client/client.cpp b/resourceqt-client/client.cpp index 25ae5a1..804ac56 100644 --- a/resourceqt-client/client.cpp +++ b/resourceqt-client/client.cpp @@ -133,9 +133,10 @@ bool Client::initialize(const CommandLineParser &parser) this, SLOT(doExit()))) { return false; } - output << "accepting input" << endl; - showPrompt(); + resourceSet->initAndConnect(); + output << "connecting...accepting input" << endl; + showPrompt(); return true; } -- cgit v1.2.3 From b723c98d18c4fdec1654ea283e5bfd9ea44dc701 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20L=C3=B6fman?= Date: Fri, 26 Nov 2010 15:26:32 +0200 Subject: Added connectedToManager() signal --- resourceqt-client/client.cpp | 14 ++++++++++++++ resourceqt-client/client.h | 1 + 2 files changed, 15 insertions(+) (limited to 'resourceqt-client') diff --git a/resourceqt-client/client.cpp b/resourceqt-client/client.cpp index 804ac56..fe15586 100644 --- a/resourceqt-client/client.cpp +++ b/resourceqt-client/client.cpp @@ -129,11 +129,15 @@ bool Client::initialize(const CommandLineParser &parser) if (!connect(&stdInNotifier, SIGNAL(activated(int)), this, SLOT(readLine(int)))) { return false; } + if (!connect(resourceSet , SIGNAL(connectedToManager()), this, SLOT(stopConnectTimerHandler()))) { + return false; + } if (!connect(QCoreApplication::instance(), SIGNAL(aboutToQuit()), this, SLOT(doExit()))) { return false; } + start_timer(); resourceSet->initAndConnect(); output << "connecting...accepting input" << endl; showPrompt(); @@ -146,6 +150,7 @@ void Client::doExit() resourceSet->release(); } + const char * resourceTypeToString(ResourceType type) { switch (type) { @@ -201,6 +206,15 @@ void Client::showResources(const QList &resList) } } +void Client::stopConnectTimerHandler() +{ + long int ms = stop_timer(); + if (ms > 0) { + outputln << "Register took " << ms << "ms" << endl; + } + +} + void Client::resourceAcquiredHandler(const QList&) { long int ms = stop_timer(); diff --git a/resourceqt-client/client.h b/resourceqt-client/client.h index c22475d..342f5f9 100644 --- a/resourceqt-client/client.h +++ b/resourceqt-client/client.h @@ -62,6 +62,7 @@ private slots: void resourcesBecameAvailableHandler(const QList &availableResources); void readLine(int); void doExit(); + void stopConnectTimerHandler(); private: QTextStream standardInput; -- cgit v1.2.3 From bd39d64e2e0c08f323187fe9946c437b5ea8af35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20L=C3=B6fman?= Date: Fri, 26 Nov 2010 15:38:14 +0200 Subject: Changed the update command in resourceqt-client to match resource-client. --- resourceqt-client/client.cpp | 150 +++++++++++++++++++++++++++---------------- resourceqt-client/client.h | 1 + 2 files changed, 97 insertions(+), 54 deletions(-) (limited to 'resourceqt-client') diff --git a/resourceqt-client/client.cpp b/resourceqt-client/client.cpp index fe15586..23d5acb 100644 --- a/resourceqt-client/client.cpp +++ b/resourceqt-client/client.cpp @@ -59,9 +59,8 @@ Client::Client() commandList["free"] = CommandListArgs("", "destroy and free the resources"); commandList["acquire"] = CommandListArgs("", "acquire required resources"); commandList["release"] = CommandListArgs("", "release resources"); - commandList["update"] = CommandListArgs("", "update modified resource set after add or remove command"); - commandList["add"] = CommandListArgs("reslist [-o]", "add resource list, if -o provided, set as optional"); - commandList["remove"] = CommandListArgs("reslist [-o]", "remove resource list, if -o provided, removed only optional flag"); + commandList["update"] = CommandListArgs("update all[:opt] where 'all' and 'opt' are comma separated resources", + "update the resource set by specifying the new set"); commandList["audio"] = CommandListArgs("pid | group