mirror of https://github.com/nymea/nymea.git
Add network device discovery result sorting by ip address
parent
cbb7a2a7f1
commit
19e21b9dd4
|
|
@ -96,50 +96,6 @@ bool NetworkDeviceInfo::isValid() const
|
|||
return (!m_address.isNull() || !m_macAddress.isEmpty()) && m_networkInterface.isValid();
|
||||
}
|
||||
|
||||
//bool NetworkDeviceInfo::operator!=(const NetworkDeviceInfo &other) const
|
||||
//{
|
||||
// return !(*this == other);
|
||||
//}
|
||||
|
||||
//bool NetworkDeviceInfo::operator==(const NetworkDeviceInfo &other) const
|
||||
//{
|
||||
// return m_address == other.address() &&
|
||||
// m_macAddress == other.macAddress() &&
|
||||
// m_macAddressManufacturer == other.macAddressManufacturer() &&
|
||||
// m_hostName == other.hostName();
|
||||
//}
|
||||
|
||||
//bool NetworkDeviceInfo::operator<(const NetworkDeviceInfo &other) const
|
||||
//{
|
||||
|
||||
// return m_address.toIPv4Address() < other.address().toIPv4Address();
|
||||
//}
|
||||
|
||||
//bool NetworkDeviceInfo::operator<=(const NetworkDeviceInfo &other) const
|
||||
//{
|
||||
// return m_address.toIPv4Address() <= other.address().toIPv4Address();
|
||||
//}
|
||||
|
||||
//bool NetworkDeviceInfo::operator>(const NetworkDeviceInfo &other) const
|
||||
//{
|
||||
// return m_address.toIPv4Address() > other.address().toIPv4Address();
|
||||
//}
|
||||
|
||||
//bool NetworkDeviceInfo::operator>=(const NetworkDeviceInfo &other) const
|
||||
//{
|
||||
// return m_address.toIPv4Address() != other.address().toIPv4Address();
|
||||
//}
|
||||
|
||||
//bool NetworkDeviceInfo::operator-(const NetworkDeviceInfo &other) const
|
||||
//{
|
||||
// return m_address.toIPv4Address() - other.address().toIPv4Address();
|
||||
//}
|
||||
|
||||
//bool NetworkDeviceInfo::operator+(const NetworkDeviceInfo &other) const
|
||||
//{
|
||||
// return m_address.toIPv4Address() + other.address().toIPv4Address();
|
||||
//}
|
||||
|
||||
QDebug operator<<(QDebug dbg, const NetworkDeviceInfo &networkDeviceInfo)
|
||||
{
|
||||
dbg.nospace() << "NetworkDeviceInfo(" << networkDeviceInfo.address().toString();
|
||||
|
|
|
|||
|
|
@ -62,13 +62,6 @@ public:
|
|||
|
||||
bool isValid() const;
|
||||
|
||||
// bool operator!=(const NetworkDeviceInfo& other) const;
|
||||
// bool operator==(const NetworkDeviceInfo& other) const;
|
||||
// bool operator<(const NetworkDeviceInfo& other) const;
|
||||
// bool operator<=(const NetworkDeviceInfo& other) const;
|
||||
// bool operator>(const NetworkDeviceInfo& other) const;
|
||||
// bool operator>=(const NetworkDeviceInfo& other) const;
|
||||
|
||||
private:
|
||||
QHostAddress m_address;
|
||||
QString m_macAddress;
|
||||
|
|
|
|||
|
|
@ -101,9 +101,9 @@ NetworkDeviceInfo NetworkDeviceInfos::get(const QString &macAddress)
|
|||
|
||||
void NetworkDeviceInfos::sortNetworkDevices()
|
||||
{
|
||||
// std::sort(*this->begin(), *this->end(), [](const NetworkDeviceInfo& a, const NetworkDeviceInfo& b) {
|
||||
// return a.address().toIPv4Address() < b.address().toIPv4Address();
|
||||
// });
|
||||
std::sort(this->begin(), this->end(), [](const NetworkDeviceInfo& a, const NetworkDeviceInfo& b) {
|
||||
return a.address().toIPv4Address() < b.address().toIPv4Address();
|
||||
});
|
||||
}
|
||||
|
||||
NetworkDeviceInfos &NetworkDeviceInfos::operator <<(const NetworkDeviceInfo &networkDeviceInfo)
|
||||
|
|
|
|||
Loading…
Reference in New Issue