}
+ConnectionManager::~ConnectionManager()
+{
+ QDBusConnection systemBus = QDBusConnection::systemBus();
+
+ systemBus.disconnect(ICD_DBUS_API_INTERFACE, ICD_DBUS_API_PATH,
+ ICD_DBUS_API_INTERFACE, ICD_DBUS_API_STATE_SIG,
+ this, SLOT(stateChange(const QDBusMessage&)));
+
+ systemBus.disconnect(ICD_DBUS_API_INTERFACE, ICD_DBUS_API_PATH,
+ ICD_DBUS_API_INTERFACE, ICD_DBUS_API_CONNECT_SIG,
+ this, SLOT(connectionChange(const QDBusMessage&)));
+}
+
bool ConnectionManager::connect()
{
ready_ = false;
switch(status)
{
case ICD_STATE_CONNECTING:
- qDebug() << "Connecting";
break;
case ICD_STATE_CONNECTED:
connected_ = true;
ready_ = true;
- qDebug() << "Connected";
break;
case ICD_STATE_DISCONNECTING:
- qDebug() << "Disconnecting";
break;
case ICD_STATE_DISCONNECTED:
connected_ = false;
ready_ = true;
- qDebug() << "Disconnected";
break;
case ICD_STATE_LIMITED_CONN_ENABLED:
connected_ = true;
ready_ = true;
- qDebug() << "Limited connection enabled";
break;
case ICD_STATE_LIMITED_CONN_DISABLED:
connected_ = false;
ready_ = true;
- qDebug() << "Limited connection disabled";
break;
case ICD_STATE_SEARCH_START:
- qDebug() << "Search start";
break;
case ICD_STATE_SEARCH_STOP:
- qDebug() << "Search stop";
break;
case ICD_STATE_INTERNAL_ADDRESS_ACQUIRED:
- qDebug() << "Internal address acquired";
break;
default:
qDebug() << "Unknown connection status";
case ICD_CONNECTION_SUCCESSFUL:
connected_ = true;
ready_ = true;
- qDebug() << "Connection successful";
break;
case ICD_CONNECTION_NOT_CONNECTED:
connected_ = false;
ready_ = true;
- qDebug() << "Connection not connected";
break;
case ICD_CONNECTION_DISCONNECTED:
connected_ = false;
ready_ = true;
- qDebug() << "Connection disconnected";
break;
default:
qDebug() << "Unknown connection status";