Controller::Controller(QWidget *parent) : QWidget(parent) { ui.setupUi(this); registerCommTypes(); car = new CarInterface("com.trolltech.CarExample", "/Car", QDBusConnection::sessionBus(), this); startTimer(1000); }
CallManagerInterface & DBus::CallManager::instance(){ #ifdef ENABLE_LIBWRAP if (!interface) interface = new CallManagerInterface(); #else if (!dbus_metaTypeInit) registerCommTypes(); if (!interface) interface = new CallManagerInterface( "cx.ring.Ring", "/cx/ring/Ring/CallManager", QDBusConnection::sessionBus()); if(!interface->connection().isConnected()) throw "Error : dring not connected. Service " + interface->service() + " not connected. From call manager interface."; if (!interface->isValid()) throw "Dring daemon not available, be sure it running"; #endif return *interface; }
PresenceManagerInterface& DBus::PresenceManager::instance() { #ifdef ENABLE_LIBWRAP if (!interface) interface = new PresenceManagerInterface(); #else if (!dbus_metaTypeInit) registerCommTypes(); if (!interface) interface = new PresenceManagerInterface("cx.ring.Ring", "/cx/ring/Ring/PresenceManager", QDBusConnection::sessionBus()); if(!interface->connection().isConnected()) { throw "Error : dring not connected. Service " + interface->service() + " not connected. From instance interface."; } #endif return *interface; }
InstanceInterface& DBus::InstanceManager::instance() { #ifdef ENABLE_LIBWRAP if (!interface) interface = new InstanceInterface(); #else if (!dbus_metaTypeInit) registerCommTypes(); if (!interface) interface = new InstanceInterface("cx.ring.Ring", "/cx/ring/Ring/Instance", QDBusConnection::sessionBus()); if(!interface->connection().isConnected()) { throw "Error : dring not connected. Service " + interface->service() + " not connected. From instance interface."; } static bool registered = false; if (!registered) { QDBusPendingReply<QString> reply = interface->Register(getpid(), ""); registered = true; reply.waitForFinished(); } #endif return *interface; }