chore: remove useless code

This commit is contained in:
Qsaker 2024-01-09 12:03:31 +08:00
parent c1f523e192
commit 2b1ffba835
2 changed files with 0 additions and 29 deletions

View File

@ -22,10 +22,8 @@
#endif
#endif
#include <QAbstractTableModel>
#include <QHostAddress>
#include <QLineEdit>
#include <QList>
#include <QNetworkInterface>
#include <QRegularExpressionValidator>
#include <QSettings>
#include <QStandardItemModel>
@ -350,32 +348,6 @@ void SAKInterface::addSerialPortFlowControlItemsToComboBox(QComboBox *comboBox)
}
#endif
void SAKInterface::addIpItemsToComboBox(QComboBox *comboBox, bool appendHostAny)
{
QString localHost("127.0.0.1");
if (comboBox) {
comboBox->clear();
comboBox->addItem(QString("::"));
comboBox->addItem(QString("::1"));
comboBox->addItem(QString("0.0.0.0"));
comboBox->addItem(localHost);
QList<QHostAddress> addresses = QNetworkInterface::allAddresses();
for (auto &var : addresses) {
if (var.protocol() == QAbstractSocket::IPv4Protocol) {
if (var.toString().compare(localHost) == 0) {
continue;
}
comboBox->addItem(var.toString());
}
}
if (appendHostAny) {
comboBox->addItem(QString(SAK_HOST_ADDRESS_ANY));
}
comboBox->setCurrentText(localHost);
}
}
void SAKInterface::setComboBoxIndexFromSettings(QSettings *settings,
QString key,
QComboBox *comboBox)

View File

@ -102,7 +102,6 @@ public:
static void addSerialPortParityItemsToComboBox(QComboBox *comboBox);
static void addSerialPortFlowControlItemsToComboBox(QComboBox *comboBox);
#endif
static void addIpItemsToComboBox(QComboBox *comboBox, bool appendHostAny = false);
static void setComboBoxIndexFromSettings(QSettings *settings, QString key, QComboBox *comboBox);
static void setSettingsValueFromComboBoxIndex(QSettings *settings,
QString key,