#6338 Only add server IPs when in client mode, and clear the IP list each time zeroconf restarts

This commit is contained in:
Nick Bolton 2018-08-08 15:13:22 +01:00
parent 87d8fc1e14
commit aad0ac25d1
1 changed files with 10 additions and 0 deletions

View File

@ -1071,6 +1071,11 @@ void MainWindow::changeEvent(QEvent* event)
void MainWindow::zeroconfServerDetected(const QString name) void MainWindow::zeroconfServerDetected(const QString name)
{ {
// don't add to the server combo box if not in client mode.
if (synergyType() != synergyClient) {
return;
}
// don't add yourself to the server list. // don't add yourself to the server list.
if (getIPAddresses().contains(name)) { if (getIPAddresses().contains(name)) {
return; return;
@ -1221,6 +1226,11 @@ void MainWindow::on_m_pActionAbout_triggered()
void MainWindow::updateZeroconfService() void MainWindow::updateZeroconfService()
{ {
#ifndef SYNERGY_ENTERPRISE #ifndef SYNERGY_ENTERPRISE
// reset the server list in case one has gone away.
// it'll be re-added after the zeroconf service restarts.
m_pComboServerList->clear();
if (m_pZeroconf != nullptr) { if (m_pZeroconf != nullptr) {
if (appConfig().autoConfig()) { if (appConfig().autoConfig()) {
m_pZeroconf->startService(); m_pZeroconf->startService();