summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Löfman <ext-robert.lofman@nokia.com>2010-11-26 15:26:32 +0200
committerRobert Löfman <ext-robert.lofman@nokia.com>2010-11-26 15:26:32 +0200
commitb723c98d18c4fdec1654ea283e5bfd9ea44dc701 (patch)
tree8ca38ecf25311872ef1435a3ef7b325b188c468e
parent05f8fa1ebccab6eb55ccbd8a3921bc7016512749 (diff)
Added connectedToManager() signal
-rw-r--r--libresourceqt/include/qt4/policy/resource-set.h5
-rw-r--r--libresourceqt/src/resource-set.cpp1
-rw-r--r--resourceqt-client/client.cpp14
-rw-r--r--resourceqt-client/client.h1
4 files changed, 21 insertions, 0 deletions
diff --git a/libresourceqt/include/qt4/policy/resource-set.h b/libresourceqt/include/qt4/policy/resource-set.h
index 03c9d95..538f9ae 100644
--- a/libresourceqt/include/qt4/policy/resource-set.h
+++ b/libresourceqt/include/qt4/policy/resource-set.h
@@ -298,6 +298,11 @@ signals:
*/
void errorCallback(quint32, const char*);
+ /**
+ * This signals that we have connected to the Resource Manager.
+ */
+ void connectedToManager();
+
private:
bool initialize();
diff --git a/libresourceqt/src/resource-set.cpp b/libresourceqt/src/resource-set.cpp
index b6885a5..8f26a13 100644
--- a/libresourceqt/src/resource-set.cpp
+++ b/libresourceqt/src/resource-set.cpp
@@ -322,6 +322,7 @@ void ResourceSet::connectedHandler()
qDebug("**************** ResourceSet::%s().... %d", __FUNCTION__, __LINE__);
if (resourceEngine->isConnectedToManager()) {
qDebug("ResourceSet::%s() Connected to manager!", __FUNCTION__);
+ emit connectedToManager();
if (pendingAudioProperties) {
registerAudioProperties();
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<Resource*> &resList)
}
}
+void Client::stopConnectTimerHandler()
+{
+ long int ms = stop_timer();
+ if (ms > 0) {
+ outputln << "Register took " << ms << "ms" << endl;
+ }
+
+}
+
void Client::resourceAcquiredHandler(const QList<ResourceType>&)
{
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<ResourcePolicy::ResourceType> &availableResources);
void readLine(int);
void doExit();
+ void stopConnectTimerHandler();
private:
QTextStream standardInput;