#6338 Only use Zeroconf if non-enterprise build

This commit is contained in:
Nick Bolton 2018-08-03 23:41:50 +01:00
parent d2d2a5e1d9
commit c0452f0e61
3 changed files with 8 additions and 7 deletions

View File

@ -79,9 +79,9 @@ MainWindow::MainWindow (QSettings& settings, AppConfig& appConfig,
: :
#ifndef SYNERGY_ENTERPRISE #ifndef SYNERGY_ENTERPRISE
m_LicenseManager(&licenseManager), m_LicenseManager(&licenseManager),
m_pZeroconf(nullptr),
m_ActivationDialogRunning(false), m_ActivationDialogRunning(false),
#endif #endif
m_pZeroconf(nullptr),
m_Settings(settings), m_Settings(settings),
m_AppConfig(&appConfig), m_AppConfig(&appConfig),
m_pSynergy(NULL), m_pSynergy(NULL),
@ -178,9 +178,8 @@ MainWindow::MainWindow (QSettings& settings, AppConfig& appConfig,
m_pActivate->setVisible(false); m_pActivate->setVisible(false);
#endif #endif
m_pZeroconf = new Zeroconf(this);
#ifndef SYNERGY_ENTERPRISE #ifndef SYNERGY_ENTERPRISE
m_pZeroconf = new Zeroconf(this);
if (m_AppConfig->autoConfig()) { if (m_AppConfig->autoConfig()) {
m_pZeroconf->startService(); m_pZeroconf->startService();
} }
@ -195,9 +194,7 @@ MainWindow::~MainWindow()
} }
#ifndef SYNERGY_ENTERPRISE #ifndef SYNERGY_ENTERPRISE
if (m_AppConfig->autoConfig()) { delete m_pZeroconf;
m_pZeroconf->stopService();
}
#endif #endif
saveSettings(); saveSettings();
@ -1302,6 +1299,7 @@ void MainWindow::on_m_pComboServerList_currentIndexChanged(const QString &arg1)
} }
} }
#ifndef SYNERGY_ENTERPRISE
int MainWindow::raiseActivationDialog() int MainWindow::raiseActivationDialog()
{ {
if (m_ActivationDialogRunning) { if (m_ActivationDialogRunning) {
@ -1325,6 +1323,7 @@ int MainWindow::raiseActivationDialog()
} }
return result; return result;
} }
#endif
void MainWindow::on_windowShown() void MainWindow::on_windowShown()
{ {

View File

@ -203,10 +203,10 @@ public slots:
private: private:
#ifndef SYNERGY_ENTERPRISE #ifndef SYNERGY_ENTERPRISE
LicenseManager* m_LicenseManager; LicenseManager* m_LicenseManager;
Zeroconf* m_pZeroconf;
bool m_ActivationDialogRunning; bool m_ActivationDialogRunning;
QStringList m_PendingClientNames; QStringList m_PendingClientNames;
#endif #endif
Zeroconf* m_pZeroconf;
QSettings& m_Settings; QSettings& m_Settings;
AppConfig* m_AppConfig; AppConfig* m_AppConfig;
QProcess* m_pSynergy; QProcess* m_pSynergy;

View File

@ -189,10 +189,12 @@ void SettingsDialog::on_m_pLabelInstallBonjour_linkActivated(const QString&)
void SettingsDialog::on_m_pCheckBoxAutoConfig_toggled(bool checked) void SettingsDialog::on_m_pCheckBoxAutoConfig_toggled(bool checked)
{ {
#ifndef SYNERGY_ENTERPRISE
if (checked) { if (checked) {
m_pMainWindow->zeroconf().startService(); m_pMainWindow->zeroconf().startService();
} }
else { else {
m_pMainWindow->zeroconf().stopService(); m_pMainWindow->zeroconf().stopService();
} }
#endif
} }