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:
Rainer Clasen
2011-07-20 21:05:14 +02:00
parent da7ae868ed
commit e1f2128e27
6 changed files with 32 additions and 13 deletions

View File

@@ -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