fixed event connection
This commit is contained in:
parent
dbe1d2e10c
commit
66494c74f7
@ -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