From 22475067de9e37766a23ffe6bdf66bfa518af163 Mon Sep 17 00:00:00 2001 From: Xinyu Hou Date: Tue, 18 Nov 2014 16:39:20 +0000 Subject: [PATCH] Fixed the warning logic when hostname is empty --- src/gui/src/MainWindow.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/gui/src/MainWindow.cpp b/src/gui/src/MainWindow.cpp index 6a50a1e8..3bcfca86 100644 --- a/src/gui/src/MainWindow.cpp +++ b/src/gui/src/MainWindow.cpp @@ -505,14 +505,6 @@ bool MainWindow::clientArgs(QStringList& args, QString& app) app = QString("\"%1\"").arg(app); #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()) { appConfig().persistLogDir(); @@ -531,6 +523,13 @@ bool MainWindow::clientArgs(QStringList& args, QString& app) } } 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()); }