Commit 8190209d authored by Michael Carpenter's avatar Michael Carpenter

Fix for apm_planner issue #3, Serial port handling of '-' characters, since...

Fix for apm_planner issue #3, Serial port handling of '-' characters, since OSX can have a '-' in the port name
parent c23dc4d6
...@@ -608,9 +608,11 @@ void QGCToolBar::connectLink(bool connect) ...@@ -608,9 +608,11 @@ void QGCToolBar::connectLink(bool connect)
if (link) if (link)
{ {
QString portname = portComboBox->currentText().split(":")[2]; 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()); link->setPortName(portname.trimmed());
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment