SYNERGY-799 Fix code smell. Removed unused autoconfig function.

This commit is contained in:
Serhii Hadzhilov 2021-04-15 18:54:01 +03:00
parent 65889f809b
commit 8c9a261ed5
3 changed files with 1 additions and 43 deletions

View file

@ -16,6 +16,7 @@ Enhancements:
- #6969 Update synergy UI. Validation for aliases.
- #6973 Update synergy UI. Main window
- #6977 Update synergy UI. Configure server
- #6978 Update synergy UI. Settings window
- #6962 | #6965 Add macOS 10.13 builder
===========

View file

@ -130,7 +130,6 @@ MainWindow::MainWindow (AppConfig& appConfig,
m_pLabelScreenName->setText(appConfig.screenName());
connect(m_AppConfig, SIGNAL(screenNameChanged()), this, SLOT(updateScreenName()));
m_pLabelIpAddresses->setText(getIPAddresses());
#if defined(Q_OS_WIN)
// ipc must always be enabled, so that we can disable command when switching to desktop mode.
@ -1039,42 +1038,6 @@ void MainWindow::setVisible(bool visible)
#endif
}
QString MainWindow::getIPAddresses()
{
QList<QHostAddress> addresses = QNetworkInterface::allAddresses();
bool hinted = false;
QString result;
for (int i = 0; i < addresses.size(); i++) {
if (addresses[i].protocol() == QAbstractSocket::IPv4Protocol &&
addresses[i] != QHostAddress(QHostAddress::LocalHost)) {
QString address = addresses[i].toString();
QString format = "%1, ";
// usually 192.168.x.x is a useful ip for the user, so indicate
// this by making it bold.
if (!hinted && address.startsWith("192.168")) {
hinted = true;
format = "<b>%1</b>, ";
}
//Prevent self assigned IPs being displayed
if (!address.startsWith("169.254")) {
result += format.arg(address);
}
}
}
if (result == "") {
return tr("Unknown");
}
// remove trailing comma.
result.chop(2);
return result;
}
void MainWindow::changeEvent(QEvent* event)
{
if (event != 0)
@ -1103,11 +1066,6 @@ void MainWindow::changeEvent(QEvent* event)
void MainWindow::addZeroconfServer(const QString name)
{
// don't add yourself to the server list.
if (getIPAddresses().contains(name)) {
return;
}
if (m_pComboServerList->findText(name) == -1) {
m_pComboServerList->addItem(name);
}

View file

@ -182,7 +182,6 @@ public slots:
void setStatus(const QString& status);
void sendIpcMessage(qIpcMessageType type, const char* buffer, bool showErrors);
void updateFromLogLine(const QString& line);
QString getIPAddresses();
void stopService();
void stopDesktop();
void changeEvent(QEvent* event);