summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJussi Kinnula <ext-jussi.1.kinnula@nokia.com>2010-12-09 14:57:48 +0200
committerJussi Kinnula <ext-jussi.1.kinnula@nokia.com>2010-12-09 14:57:48 +0200
commited4e93c8f37f715924e97926fb6baf2df6695e27 (patch)
treef6c651d2bf5b8cce83d054b6fecc43aab6a5d14d
parent78db2c0b916d68a0c4056d4be7228a606b2f9dac (diff)
downloadlibresourceqt-ed4e93c8f37f715924e97926fb6baf2df6695e27.tar.gz
Now we are releasing the resources when requested by manager.
-rw-r--r--libresourceqt/include/qt4/policy/resource-set.h1
-rw-r--r--libresourceqt/src/resource-set.cpp8
2 files changed, 7 insertions, 2 deletions
diff --git a/libresourceqt/include/qt4/policy/resource-set.h b/libresourceqt/include/qt4/policy/resource-set.h
index a36254d..cbc29f0 100644
--- a/libresourceqt/include/qt4/policy/resource-set.h
+++ b/libresourceqt/include/qt4/policy/resource-set.h
@@ -339,6 +339,7 @@ private slots:
void handleGranted(quint32);
void handleDeny();
void handleReleased();
+ void handleReleasedByManager();
void handleResourcesLost(quint32);
void handleResourcesBecameAvailable(quint32);
diff --git a/libresourceqt/src/resource-set.cpp b/libresourceqt/src/resource-set.cpp
index 190df5e..d5eac09 100644
--- a/libresourceqt/src/resource-set.cpp
+++ b/libresourceqt/src/resource-set.cpp
@@ -81,7 +81,7 @@ bool ResourceSet::initialize()
QObject::connect(resourceEngine, SIGNAL(errorCallback(quint32, const char*)),
this, SIGNAL(errorCallback(quint32, const char*)));
QObject::connect(resourceEngine, SIGNAL(resourcesReleasedByManager()),
- this, SIGNAL(resourcesReleasedByManager()));
+ this, SLOT(handleReleasedByManager()));
qDebug("initializing resource engine...");
if (!resourceEngine->initialize()) {
@@ -236,7 +236,6 @@ bool ResourceSet::initAndConnect()
qDebug("ResourceSet::%s().... initializing...", __FUNCTION__);
return initialize();
}
-
if ( !resourceEngine->isConnectedToManager() ) {
qDebug("ResourceSet::%s().... connecting...", __FUNCTION__);
return resourceEngine->connectToManager();
@@ -469,3 +468,8 @@ void ResourceSet::handleAudioPropertiesChanged(const QString &, quint32,
registerAudioProperties();
}
+void ResourceSet::handleReleasedByManager()
+{
+ resourceEngine->releaseResources();
+ emit resourcesReleasedByManager();
+}