refs #382, reviewed audio context handling

* only init QDbusServer for P2P
* changed init order of contexts in runtime
* use "fake" signal to call setComVoiceRooms (remote in GUI)
* added slot to change voice room callsign
* used "org.swift" instead of "net.vatim" (just style)
* used const QString for serviceName
* added correct copyright header (just style)
This commit is contained in:
Klaus Basan
2015-02-13 02:29:50 +01:00
parent 067aecdeca
commit c47871b813
42 changed files with 391 additions and 234 deletions

View File

@@ -25,7 +25,9 @@ namespace BlackCore
*/
CContextApplicationProxy::CContextApplicationProxy(const QString &serviceName, QDBusConnection &connection, CRuntimeConfig::ContextMode mode, CRuntime *runtime) : IContextApplication(mode, runtime), m_dBusInterface(nullptr)
{
this->m_dBusInterface = new BlackMisc::CGenericDBusInterface(serviceName , IContextApplication::ObjectPath(), IContextApplication::InterfaceName(), connection, this);
this->m_dBusInterface = new CGenericDBusInterface(serviceName, IContextApplication::ObjectPath(), IContextApplication::InterfaceName(), connection, this);
// this->m_dBusInterface = new CGenericDBusInterface(serviceName, IContextApplication::ObjectPath(), IContextApplication::InterfaceName(), connection, this);
this->relaySignals(serviceName, connection);
// Enable event forwarding from GUI process to core
@@ -33,7 +35,7 @@ namespace BlackCore
connect(inputManager, &CInputManager::hotkeyFuncEvent, this, &CContextApplicationProxy::processHotkeyFuncEvent);
inputManager->setEventForwarding(true);
connect(this, &IContextApplication::messageLogged, this, [](const CStatusMessage &message, const Event::COriginator &origin)
connect(this, &IContextApplication::messageLogged, this, [](const CStatusMessage & message, const Event::COriginator & origin)
{
if (!origin.isFromSameProcess())
{
@@ -43,17 +45,20 @@ namespace BlackCore
}
/*
* Workaround for signals
* Connect for signals
*/
void CContextApplicationProxy::relaySignals(const QString &serviceName, QDBusConnection &connection)
{
// signals originating from impl side
bool s = connection.connect(serviceName, IContextApplication::ObjectPath(), IContextApplication::InterfaceName(),
"messageLogged", this, SIGNAL(messageLogged(BlackMisc::CStatusMessage,BlackMisc::Event::COriginator)));
"messageLogged", this, SIGNAL(messageLogged(BlackMisc::CStatusMessage, BlackMisc::Event::COriginator)));
Q_ASSERT(s);
s = connection.connect(serviceName, IContextApplication::ObjectPath(), IContextApplication::InterfaceName(),
"componentChanged", this, SIGNAL(componentChanged(uint, uint)));
Q_ASSERT(s);
s = connection.connect(serviceName, IContextApplication::ObjectPath(), IContextApplication::InterfaceName(),
"fakedSetComVoiceRoom", this, SIGNAL(fakedSetComVoiceRoom(BlackMisc::Audio::CVoiceRoomList)));
Q_ASSERT(s);
Q_UNUSED(s);
}