From ed4e93c8f37f715924e97926fb6baf2df6695e27 Mon Sep 17 00:00:00 2001 From: Jussi Kinnula Date: Thu, 9 Dec 2010 14:57:48 +0200 Subject: Now we are releasing the resources when requested by manager. --- libresourceqt/include/qt4/policy/resource-set.h | 1 + libresourceqt/src/resource-set.cpp | 8 ++++++-- 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(); +} -- cgit v1.2.3 From e533ea1abcb5dd43d894c0f4fc2d2cf1f6239074 Mon Sep 17 00:00:00 2001 From: Jussi Kinnula Date: Thu, 9 Dec 2010 17:31:15 +0200 Subject: Fixes compilation problems with current resourceqt-client and old libresourceqt-dev on /usr/lib. --- resourceqt-client/resourceqt-client.pro | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/resourceqt-client/resourceqt-client.pro b/resourceqt-client/resourceqt-client.pro index 99a69b1..df9762b 100644 --- a/resourceqt-client/resourceqt-client.pro +++ b/resourceqt-client/resourceqt-client.pro @@ -33,13 +33,14 @@ CONFIG -= app_bundle INCLUDEPATH += $${LIBRESOURCEINC} QMAKE_CXXFLAGS += -Wall QMAKE_CFLAGS += -std=c99 -D_POSIX_C_SOURCE=199309L -LIBS += -L$${LIBRESOURCEQT}/build -lresourceqt -L$${LIBDBUSQEVENTLOOP}/build -ldbus-qeventloop -lrt +QMAKE_LFLAGS = -L$${LIBRESOURCEQT}/build -lresourceqt -L$${LIBDBUSQEVENTLOOP}/build -ldbus-qeventloop -lrt # Input HEADERS = client.h commandlineparser.h time-stat.h SOURCES += resourceqt-client.cpp commandlineparser.cpp client.cpp time-stat.c QMAKE_DISTCLEAN += -r .moc .obj +#QMAKE_LFLAGS += -rpath-link=$${LIBRESOURCEQT}/build # Install options target.path = /usr/bin/ -- cgit v1.2.3