Fixed the warning logic when hostname is empty

This commit is contained in:
Xinyu Hou 2014-11-18 16:39:20 +00:00
parent 1a69f458b7
commit 22475067de

View File

@ -505,14 +505,6 @@ bool MainWindow::clientArgs(QStringList& args, QString& app)
app = QString("\"%1\"").arg(app); app = QString("\"%1\"").arg(app);
#endif #endif
if (m_pLineEditHostname->text().isEmpty())
{
show();
QMessageBox::warning(this, tr("Hostname is empty"),
tr("Please fill in a hostname for the synergy client to connect to."));
return false;
}
if (appConfig().logToFile()) if (appConfig().logToFile())
{ {
appConfig().persistLogDir(); appConfig().persistLogDir();
@ -531,6 +523,13 @@ bool MainWindow::clientArgs(QStringList& args, QString& app)
} }
} }
else { else {
if (m_pLineEditHostname->text().isEmpty()) {
show();
QMessageBox::warning(this, tr("Hostname is empty"),
tr("Please fill in a hostname for the synergy client to connect to."));
return false;
}
args << m_pLineEditHostname->text() + ":" + QString::number(appConfig().port()); args << m_pLineEditHostname->text() + ":" + QString::number(appConfig().port());
} }