refactor: 删除interfaceStats死代码
删除未使用的 Q_PROPERTY interfaceStats、interfaceStats() 实现、 statsChanged 信号、QML 属性绑定。#14 随之解决(interfaceStats 整体删除,不再有不完整输出)。
This commit is contained in:
@@ -103,23 +103,6 @@ QStringList NetworkMonitorApplet::networkInterfaces() const
|
||||
return m_interfaceList;
|
||||
}
|
||||
|
||||
QStringList NetworkMonitorApplet::interfaceStats() const
|
||||
{
|
||||
QStringList stats;
|
||||
for (const QString &name : m_interfaceList) {
|
||||
if (m_interfaces.contains(name)) {
|
||||
const NetworkInterface &iface = m_interfaces[name];
|
||||
stats << QString("%1|%2|%3|%4|%5")
|
||||
.arg(iface.name)
|
||||
.arg(iface.rxBytes)
|
||||
.arg(iface.txBytes)
|
||||
.arg(iface.rxPackets)
|
||||
.arg(iface.txPackets);
|
||||
}
|
||||
}
|
||||
return stats;
|
||||
}
|
||||
|
||||
bool NetworkMonitorApplet::ready() const
|
||||
{
|
||||
return m_ready;
|
||||
@@ -360,7 +343,6 @@ void NetworkMonitorApplet::readNetworkStats()
|
||||
}
|
||||
|
||||
calculateSpeed();
|
||||
emit statsChanged();
|
||||
// 每次刷新都检测 IP,以应对 DHCP 续约等 IP 变更场景
|
||||
detectIpAddress();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user