mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-14 00:28:42 +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:
@@ -46,11 +46,11 @@
|
||||
bool SerialRegistered = CommPort::addListFunction(&Serial::myListCommPorts);
|
||||
|
||||
#ifdef Q_OS_WIN32
|
||||
Serial::Serial(const QString &path) : path(path), isOpen(false)
|
||||
Serial::Serial(const QString &path) : CommPort("Serial"), path(path), isOpen(false)
|
||||
{
|
||||
}
|
||||
#else
|
||||
Serial::Serial(const QString &path) : path(path), fd(-1)
|
||||
Serial::Serial(const QString &path) : CommPort("Serial"), path(path), fd(-1)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
@@ -309,7 +309,7 @@ Serial::write(void *buf, size_t nbyte, QString &err)
|
||||
QString
|
||||
Serial::name() const
|
||||
{
|
||||
return QString("Serial: ") + path;
|
||||
return path;
|
||||
}
|
||||
|
||||
#ifndef Q_OS_WIN32
|
||||
|
||||
Reference in New Issue
Block a user