Commit 5dde30b7 authored by Bryant Mairs's avatar Bryant Mairs

Removed constant debugging output from scanning for serial ports.

Replaced with only 1 output message with the result of the first serial port scan.
parent f79ecee9
......@@ -99,19 +99,11 @@ QList<QString> SerialLink::getCurrentPorts()
m_ports.clear();
QList<QSerialPortInfo> portList = QSerialPortInfo::availablePorts();
if( portList.count() == 0){
qDebug() << "No Ports Found" << m_ports;
}
foreach (const QSerialPortInfo &info, portList)
{
// qDebug() << "PortName : " << info.portName()
// << "Description : " << info.description();
// qDebug() << "Manufacturer: " << info.manufacturer();
m_ports.append(info.portName());
}
return m_ports;
}
......
......@@ -55,7 +55,10 @@ SerialConfigurationWindow::SerialConfigurationWindow(LinkInterface* link, QWidge
action = new QAction(QIcon(":/files/images/devices/network-wireless.svg"), "", this);
setLinkName(link->getName());
setupPortList();
// Scan for serial ports. Let the user know if none were found for debugging purposes
if (!setupPortList()) {
qDebug() << "No serial ports found.";
}
// Set up baud rates
ui.baudRate->clear();
......@@ -213,9 +216,9 @@ void SerialConfigurationWindow::configureCommunication()
this->show();
}
void SerialConfigurationWindow::setupPortList()
bool SerialConfigurationWindow::setupPortList()
{
if (!link) return;
if (!link) return false;
// Get the ports available on this system
QList<QString> ports = link->getCurrentPorts();
......@@ -240,6 +243,8 @@ void SerialConfigurationWindow::setupPortList()
if (storedFound)
ui.portName->setEditText(storedName);
return (ports.count() > 0);
}
void SerialConfigurationWindow::enableFlowControl(bool flow)
......
......@@ -60,7 +60,7 @@ public slots:
void setParityEven(bool accept);
void setPortName(QString port);
void setLinkName(QString name);
void setupPortList();
bool setupPortList();
protected:
void showEvent(QShowEvent* event);
......
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