mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2024-12-02 10:24:11 +01:00
check if opening a device worked / prevents segfaults ( e.g. failing BT connection ) & checking if my svn account works ;-)
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2000 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
parent
9ad1618739
commit
cc497c43dc
@ -141,6 +141,16 @@ void ConnectionManager::onConnectPressed()
|
|||||||
if(m_ioDev)
|
if(m_ioDev)
|
||||||
{
|
{
|
||||||
m_ioDev->open(QIODevice::ReadWrite);
|
m_ioDev->open(QIODevice::ReadWrite);
|
||||||
|
|
||||||
|
// check if opening the device worked
|
||||||
|
if (!m_ioDev->isOpen())
|
||||||
|
{
|
||||||
|
qDebug() << "could not connect to " << m_connectionDevice.devName;
|
||||||
|
// TODO: inform the user that something went wrong
|
||||||
|
m_ioDev = NULL;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
//signal interested plugins that the user wants to connect to the device
|
//signal interested plugins that the user wants to connect to the device
|
||||||
emit deviceConnected(m_ioDev);
|
emit deviceConnected(m_ioDev);
|
||||||
m_connectBtn->setText("Disconnect");
|
m_connectBtn->setText("Disconnect");
|
||||||
|
Loading…
Reference in New Issue
Block a user