summaryrefslogtreecommitdiff
path: root/libresourceqt
diff options
context:
space:
mode:
authorWolf Bergenheim <ext-wolf.2.bergenheim@nokia.com>2010-09-10 13:34:20 +0300
committerWolf Bergenheim <ext-wolf.2.bergenheim@nokia.com>2010-09-10 13:34:20 +0300
commitb8247d868582de3a5655bf83f54a25ab5b5112e9 (patch)
tree282d5ae54d6b54faee9ba1a0f7cbd5e98ba42ceb /libresourceqt
parentf6bc677d84a93a3d1ccd9179ea0f75d8599ed600 (diff)
parenta7761546eddf14689984ad95f5f6c3aeb4024362 (diff)
Merge remote branch 'origin/master'
Diffstat (limited to 'libresourceqt')
-rw-r--r--libresourceqt/include/qt4/policy/resource-set.h20
-rw-r--r--libresourceqt/src/resource-engine.cpp3
-rw-r--r--libresourceqt/src/resource-engine.h1
-rw-r--r--libresourceqt/src/resource-set.cpp3
4 files changed, 20 insertions, 7 deletions
diff --git a/libresourceqt/include/qt4/policy/resource-set.h b/libresourceqt/include/qt4/policy/resource-set.h
index 2fecd80..710dc7d 100644
--- a/libresourceqt/include/qt4/policy/resource-set.h
+++ b/libresourceqt/include/qt4/policy/resource-set.h
@@ -206,28 +206,34 @@ signals:
*/
void resourcesBecameAvailable(const QList<ResourcePolicy::ResourceType> &availableResources);
/**
- * This signal is emited as a response to the acquire() request.
+ * This signal is emitted as a response to the acquire() request.
* \param grantedOptionalResources The list of granted optional resources.
- * All the mandatory resources have also been aquired.
+ * All the mandatory resources have also been acquired.
*/
void resourcesGranted(const QList<ResourcePolicy::ResourceType> &grantedOptionalResources);
/**
- * This signal is emited as a response to the acquire() request, in the
- * case where one or more of the mandatroy resources were not availalble.
+ * This signal is emitted as a response to the acquire() request, in the
+ * case where one or more of the mandatory resources were not available.
*/
void resourcesDenied();
/**
- * This signal is emited as a response to the release() request.
+ * This signal is emitted as a response to the release() request.
*/
void resourcesReleased();
/**
- * This signal is emited when some other program with a higher priority
- * superseeds us, and as a result we loose (some of) our resources.
+ * This signal is emitted when some other program with a higher priority
+ * supersedes us, and as a result we loose (some of) our resources.
* It is very important to connect to this signal as it is signaling when
* the acquired resources shouldn't be used anymore.
*/
void lostResources();
+ /**
+ * Subscribe to this signal to receive error notifications,
+ * particularly security errors.
+ */
+ void errorCallback(quint32, const char*);
+
private:
bool initialize();
diff --git a/libresourceqt/src/resource-engine.cpp b/libresourceqt/src/resource-engine.cpp
index 6d50b87..e040562 100644
--- a/libresourceqt/src/resource-engine.cpp
+++ b/libresourceqt/src/resource-engine.cpp
@@ -429,6 +429,9 @@ void ResourceEngine::handleError(quint32 requestNo, qint32 code, const char *mes
qDebug("ResourceEngine(%d) - Error on request %u(0x%02x): %d - %s",
identifier, requestNo, originalMessageType, code, message);
messageMap.remove(requestNo);
+
+ qDebug("emitting errorCallback");
+ emit errorCallback(code, message);
}
bool ResourceEngine::isConnectedToManager()
diff --git a/libresourceqt/src/resource-engine.h b/libresourceqt/src/resource-engine.h
index 38849aa..58e071b 100644
--- a/libresourceqt/src/resource-engine.h
+++ b/libresourceqt/src/resource-engine.h
@@ -59,6 +59,7 @@ signals:
void resourcesLost(quint32 bitmaskOfGrantedResources);
void connectedToManager();
void disconnectedFromManager();
+ void errorCallback(quint32 code, const char* );
private:
bool connected;
diff --git a/libresourceqt/src/resource-set.cpp b/libresourceqt/src/resource-set.cpp
index 27e809b..f5faade 100644
--- a/libresourceqt/src/resource-set.cpp
+++ b/libresourceqt/src/resource-set.cpp
@@ -47,6 +47,9 @@ bool ResourceSet::initialize()
this, SLOT(handleResourcesLost(quint32)));
QObject::connect(resourceEngine, SIGNAL(resourcesBecameAvailable(quint32)),
this, SLOT(handleResourcesBecameAvailable(quint32)));
+ QObject::connect(resourceEngine, SIGNAL(errorCallback(quint32, const char*)),
+ this, SIGNAL(errorCallback(quint32, const char*)));
+
qDebug("initializing resource engine...");
if (!resourceEngine->initialize()) {
return false;