mirror of
https://github.com/x-tools-author/x-tools.git
synced 2025-09-15 15:28:40 +08:00
chore: remove useless code
This commit is contained in:
parent
c1f523e192
commit
2b1ffba835
@ -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)
|
||||
|
||||
@ -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,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user