Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

[Linux] Fix bug where /dev/ttyACMx wouldn't show in serial ports

dropdown
  • Loading branch information...
commit bcc9b7d19e8422f7b8a99caef83ec9ac06ee46c4 1 parent 5a7861b
Angus Gratton authored

Showing 1 changed file with 2 additions and 7 deletions. Show diff stats Hide diff stats

  1. +2 7 mainwindow.cpp
9 mainwindow.cpp
@@ -165,19 +165,14 @@ void MainWindow::refreshSerial()
165 165 ui->cmbSerial->addItem(TEXT_NOT_CONNECTED);
166 166 QList<QextPortInfo> ports = QextSerialEnumerator::getPorts();
167 167 for(QList<QextPortInfo>::iterator it = ports.begin(); it != ports.end(); it++) {
168   -#ifdef Q_OS_MAC
169   - QString label = it->portName; // OS X has no friendly name set
170   -#else
171   - QString label = it->friendName;
172   -#endif
  168 + QString label = it->friendName.isEmpty() ? it->portName : it->friendName;
173 169 #ifdef Q_OS_LINUX
174 170 QString portName = it->physName; // Bug workaround, Linux needs the /dev/ in front of port name
175 171 #else
176 172 QString portName = it->portName;
177 173 #endif
178   -
179 174 ui->cmbSerial->addItem(label, QVariant(portName));
180   - if(current == it->friendName) {
  175 + if(current == label) {
181 176 ui->cmbSerial->setCurrentIndex(ui->cmbSerial->count() - 1);
182 177 }
183 178 }

0 comments on commit bcc9b7d

Please sign in to comment.
Something went wrong with that request. Please try again.