fixed connect overloading
This commit is contained in:
parent
8d60bbb719
commit
ab62972540
@ -43,7 +43,7 @@ AvrConnection::~AvrConnection()
|
||||
m_socket->close();
|
||||
}
|
||||
|
||||
void AvrConnection::connect()
|
||||
void AvrConnection::connectDevice()
|
||||
{
|
||||
if (m_socket->state() == QAbstractSocket::ConnectingState) {
|
||||
return;
|
||||
@ -51,7 +51,7 @@ void AvrConnection::connect()
|
||||
m_socket->connectToHost(m_hostAddress, m_port);
|
||||
}
|
||||
|
||||
void AvrConnection::disconnect()
|
||||
void AvrConnection::disconnectDevice()
|
||||
{
|
||||
m_socket->close();
|
||||
}
|
||||
|
||||
@ -35,8 +35,8 @@ public:
|
||||
explicit AvrConnection(const QHostAddress &hostAddress, const int &port = 23, QObject *parent = nullptr);
|
||||
~AvrConnection();
|
||||
|
||||
void connect();
|
||||
void disconnect();
|
||||
void connectDevice();
|
||||
void disconnectDevice();
|
||||
|
||||
QHostAddress hostAddress() const;
|
||||
int port() const;
|
||||
|
||||
@ -111,7 +111,7 @@ Device::DeviceSetupStatus DevicePluginDenon::setupDevice(Device *device)
|
||||
connect(denonConnection, &AvrConnection::muteChanged, this, &DevicePluginDenon::onAvrMuteChanged);
|
||||
|
||||
m_asyncSetups.append(denonConnection);
|
||||
denonConnection->connect();
|
||||
denonConnection->connectDevice();
|
||||
m_avrConnections.insert(device, denonConnection);
|
||||
return Device::DeviceSetupStatusAsync;
|
||||
}
|
||||
@ -148,7 +148,7 @@ void DevicePluginDenon::deviceRemoved(Device *device)
|
||||
if (device->deviceClassId() == AVRX1000DeviceClassId) {
|
||||
AvrConnection *denonConnection = m_avrConnections.value(device);
|
||||
m_avrConnections.remove(device);
|
||||
denonConnection->disconnect();
|
||||
denonConnection->disconnectDevice();
|
||||
denonConnection->deleteLater();
|
||||
}
|
||||
|
||||
@ -156,7 +156,7 @@ void DevicePluginDenon::deviceRemoved(Device *device)
|
||||
if (m_avrConnections.contains(device)) {
|
||||
AvrConnection *denonConnection = m_avrConnections.value(device);
|
||||
m_avrConnections.remove(device);
|
||||
denonConnection->disconnect();
|
||||
denonConnection->disconnectDevice();
|
||||
denonConnection->deleteLater();
|
||||
}
|
||||
}
|
||||
@ -317,7 +317,7 @@ void DevicePluginDenon::onPluginTimer()
|
||||
{
|
||||
foreach(AvrConnection *denonConnection, m_avrConnections.values()) {
|
||||
if (!denonConnection->connected()) {
|
||||
denonConnection->connect();
|
||||
denonConnection->connectDevice();
|
||||
}
|
||||
Device *device = m_avrConnections.key(denonConnection);
|
||||
if (device->deviceClassId() == AVRX1000DeviceClassId) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user