mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-14 08:38:45 +00:00
CommPort: keep device names seperate
CommPort::name used to prefix the actual device name/path with the actual device type to make it unique. This is used in DownloadRideDialog to map the device dropdown list to the actual device. This patch seperates name + device type to make the hack in SrmDevice a bit less ugly: srmio doesn't use the built in CommPort abstraction and needs the unmodified device names. This is still ugly, but I can't come up with anything better (... for now).
This commit is contained in:
@@ -112,7 +112,7 @@ DownloadRideDialog::scanCommPorts()
|
||||
QMessageBox::Ok, QMessageBox::NoButton);
|
||||
}
|
||||
for (int i = 0; i < devList.size(); ++i) {
|
||||
portCombo->addItem(devList[i]->name());
|
||||
portCombo->addItem(devList[i]->id());
|
||||
// Hack: SRM PCV download cables use the PL2203 chipset. If the
|
||||
// first device name contains "PL2303", then, we're probably dealing
|
||||
// with an SRM, so go ahead and select the SRM device. Generalize?
|
||||
@@ -144,7 +144,7 @@ DownloadRideDialog::downloadClicked()
|
||||
downloadInProgress = true;
|
||||
CommPortPtr dev;
|
||||
for (int i = 0; i < devList.size(); ++i) {
|
||||
if (devList[i]->name() == portCombo->currentText()) {
|
||||
if (devList[i]->id() == portCombo->currentText()) {
|
||||
dev = devList[i];
|
||||
break;
|
||||
}
|
||||
@@ -227,7 +227,7 @@ DownloadRideDialog::eraseClicked()
|
||||
downloadInProgress = true;
|
||||
CommPortPtr dev;
|
||||
for (int i = 0; i < devList.size(); ++i) {
|
||||
if (devList[i]->name() == portCombo->currentText()) {
|
||||
if (devList[i]->id() == portCombo->currentText()) {
|
||||
dev = devList[i];
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user