mirror of
https://github.com/nymea/nymea-plugins.git
synced 2026-10-23 14:43:44 +02:00
fixed event connection
This commit is contained in:
parent
499dd538ba
commit
ce9f0c77b8
@ -197,7 +197,6 @@ void DevicePluginSerialPortCommander::deviceRemoved(Device *device)
|
|||||||
serialPortCommander->removeInputDevice(device);
|
serialPortCommander->removeInputDevice(device);
|
||||||
if (serialPortCommander->isEmpty()) {
|
if (serialPortCommander->isEmpty()) {
|
||||||
m_serialPortCommanders.remove(interface);
|
m_serialPortCommanders.remove(interface);
|
||||||
serialPortCommander->serialPort()->close();
|
|
||||||
serialPortCommander->deleteLater();
|
serialPortCommander->deleteLater();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -208,7 +207,6 @@ void DevicePluginSerialPortCommander::deviceRemoved(Device *device)
|
|||||||
serialPortCommander->removeOutputDevice();
|
serialPortCommander->removeOutputDevice();
|
||||||
if (serialPortCommander->isEmpty()) {
|
if (serialPortCommander->isEmpty()) {
|
||||||
m_serialPortCommanders.remove(interface);
|
m_serialPortCommanders.remove(interface);
|
||||||
serialPortCommander->serialPort()->close();
|
|
||||||
serialPortCommander->deleteLater();
|
serialPortCommander->deleteLater();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -45,7 +45,7 @@ void SerialPortCommander::addOutputDevice(Device* device)
|
|||||||
|
|
||||||
void SerialPortCommander::removeOutputDevice()
|
void SerialPortCommander::removeOutputDevice()
|
||||||
{
|
{
|
||||||
m_outputDevice = NULL;
|
m_outputDevice = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -63,7 +63,7 @@ void SerialPortCommander::removeInputDevice(Device* device)
|
|||||||
|
|
||||||
bool SerialPortCommander::isEmpty()
|
bool SerialPortCommander::isEmpty()
|
||||||
{
|
{
|
||||||
return(!hasOutputDevice() || m_inputDevices.empty());
|
return(!hasOutputDevice() && m_inputDevices.empty());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user