summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/datasource/networkspeed.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/datasource/networkspeed.cpp b/src/datasource/networkspeed.cpp
index 451c97e..2a67598 100644
--- a/src/datasource/networkspeed.cpp
+++ b/src/datasource/networkspeed.cpp
@@ -5,10 +5,11 @@ NetworkSpeed::NetworkSpeed() :
_lastMs(0),
_file(nullptr)
{
- for (QString s : QStringList()
- << "/sys/class/net/boot0/statistics/rx_bytes"
- << "/sys/class/net/eth0/statistics/rx_bytes"
- << "/sys/class/net/br0/statistics/rx_bytes") {
+ QStringList list = QStringList()
+ << "/sys/class/net/boot0/statistics/rx_bytes"
+ << "/sys/class/net/eth0/statistics/rx_bytes"
+ << "/sys/class/net/br0/statistics/rx_bytes";
+ for (QString s : list) {
if (!QFile::exists(s))
continue;
_file = new QFile(s);