Browse Source

Fix for apm_planner issue #3, Serial port handling of '-' characters, since OSX can have a '-' in the port name

QGC4.4
Michael Carpenter 12 years ago
parent
commit
8190209dc8
  1. 6
      src/ui/QGCToolBar.cc

6
src/ui/QGCToolBar.cc

@ -608,9 +608,11 @@ void QGCToolBar::connectLink(bool connect) @@ -608,9 +608,11 @@ void QGCToolBar::connectLink(bool connect)
if (link)
{
QString portname = portComboBox->currentText().split(":")[2];
if (portname.indexOf('-') != -1)
if (portname.indexOf('-') >= 0)
{
portname = portname.split("-")[0];
//Take everything before the last -, this ensures if the com port has a - in it, it will be included,
//since the last - is inserted by me.
portname = portname.mid(0,portname.lastIndexOf("-")-1);
}
link->setPortName(portname.trimmed());
}

Loading…
Cancel
Save