summaryrefslogtreecommitdiff
path: root/libresourceqt/src/resource-engine.cpp
diff options
context:
space:
mode:
authorWolf Bergenheim <ext-wolf.2.bergenheim@nokia.com>2010-02-17 15:23:29 +0200
committerWolf Bergenheim <ext-wolf.2.bergenheim@nokia.com>2010-02-17 15:23:29 +0200
commitfdb67c341fcb9ea0ae29a7889227ded6ac66a362 (patch)
treefc4f83d73390131a92063309a6878c74a5e2fe52 /libresourceqt/src/resource-engine.cpp
parent28aaf4eb7d89bba113d27a9a39fc787a03a05e31 (diff)
downloadlibresourceqt-fdb67c341fcb9ea0ae29a7889227ded6ac66a362.tar.gz
Implemented modes => we now get deny messages
Diffstat (limited to 'libresourceqt/src/resource-engine.cpp')
-rw-r--r--libresourceqt/src/resource-engine.cpp25
1 files changed, 15 insertions, 10 deletions
diff --git a/libresourceqt/src/resource-engine.cpp b/libresourceqt/src/resource-engine.cpp
index 2704235..5c02b44 100644
--- a/libresourceqt/src/resource-engine.cpp
+++ b/libresourceqt/src/resource-engine.cpp
@@ -15,8 +15,15 @@ static void handleAdviceMessage(resmsg_t *msg, resset_t *rs, void *data);
ResourceEngine::ResourceEngine(ResourceSet *resourceSet)
: QObject(resourceSet), connected(false), resourceSet(resourceSet),
dbusEngine(NULL), libresourceConnection(NULL), libresourceSet(NULL),
- requestId(0), messageMap(), mode(0)
+ requestId(0), messageMap(), connectionMode(0)
{
+ if (resourceSet->alwaysGetReply()) {
+ connectionMode += RESMSG_MODE_ALWAYS_REPLY;
+ }
+ if (resourceSet->willAutoRelease()) {
+ connectionMode += RESOURCE_AUTO_RELEASE;
+ }
+ qDebug("connectionMode = %04x", connectionMode);
}
ResourceEngine::~ResourceEngine()
@@ -160,12 +167,12 @@ bool ResourceEngine::connectToManager()
resourceMessage.record.rset.all = allResources;
resourceMessage.record.rset.opt = optionalResources;
resourceMessage.record.rset.share = 0;
- resourceMessage.record.rset.mask = 0;
+ resourceMessage.record.rset.mask = connectionMode;
QByteArray ba = resourceSet->applicationClass().toLatin1();
resourceMessage.record.klass = ba.data();
- resourceMessage.record.mode = mode;
+ resourceMessage.record.mode = connectionMode;
qDebug("ResourceEngine is now connecting...");
libresourceSet = resconn_connect(libresourceConnection, &resourceMessage,
@@ -365,7 +372,7 @@ bool ResourceEngine::updateResources()
message.record.rset.all = allResources;
message.record.rset.opt = optionalResources;
message.record.rset.share = 0;
- message.record.rset.mask = 0;
+ message.record.rset.mask = connectionMode;
QByteArray ba = resourceSet->applicationClass().toLatin1();
message.record.klass = ba.data();
@@ -393,10 +400,13 @@ bool ResourceEngine::registerAudioStreamTag(const QString &)
bool ResourceEngine::registerAudioGroup(const QString &audioGroup)
{
+ if((audioGroup == "") || (audioGroup == QString()))
+ return false;
+
resmsg_t message;
memset(&message, 0, sizeof(resmsg_t));
- QByteArray ba = resourceSet->applicationClass().toLatin1();
+ QByteArray ba = audioGroup.toLatin1();
message.audio.group = ba.data();
message.audio.type = RESMSG_AUDIO;
@@ -441,8 +451,3 @@ void ResourceEngine::handleConnectionIsUp()
emit connectedToManager();
}
-void ResourceEngine::setMode(quint32 newMode)
-{
- mode = newMode;
-}
-