get rid of piForeach
apply some code analyzer recommendations ICU flag now check if libicu exists prepare for more accurate growth of containers (limited PoT, then constantly increase size)
This commit is contained in:
@@ -197,7 +197,7 @@ public:
|
||||
// "]"
|
||||
,
|
||||
CellFormat());
|
||||
piForeachC(PIPeer::PeerInfo & p, daemon_.allPeers())
|
||||
for (const auto & p: daemon_.allPeers())
|
||||
peers_tl->content << TileList::Row(p.name + " | d = " + PIString::fromNumber(p.dist) + " | p = " +
|
||||
PIString::fromNumber(p.ping()) + " | n = " + PIString::fromBool(p.isNeighbour()),
|
||||
CellFormat());
|
||||
@@ -206,7 +206,7 @@ public:
|
||||
peerinfo_tl->content << TileSimple::Row("Name: " + pi.name, CellFormat());
|
||||
peerinfo_tl->content << TileSimple::Row("Addreses: " + PIString::fromNumber(pi.addresses.size()), CellFormat());
|
||||
peerinfo_tl->content << TileSimple::Row("Neighbours: " + pi.neighbours.join(", "), CellFormat());
|
||||
piForeachC(PIPeer::PeerInfo::PeerAddress & a, pi.addresses)
|
||||
for (const auto & a: pi.addresses)
|
||||
addrs_tl->content << TileList::Row(a.address.toString() + " | p = " + PIString::fromNumber(a.ping) +
|
||||
" | a = " + PIString::fromBool(a.isAvailable()),
|
||||
CellFormat());
|
||||
@@ -217,7 +217,7 @@ public:
|
||||
s += " -> " + pp->name;
|
||||
peermap << s;
|
||||
}
|
||||
piForeachC(PIString & s, peermap)
|
||||
for (const auto & s: peermap)
|
||||
peermap_tl->content << TileList::Row(s, CellFormat());
|
||||
updatePeerDiag(peerdiagdata_tl, daemon_.diagnosticData());
|
||||
updatePeerDiag(peerdiagservice_tl, daemon_.diagnosticService());
|
||||
@@ -238,9 +238,9 @@ public:
|
||||
tile->content << TileList::Row("PID: " + PIString::fromNumber(sys_mon.statistic().ID), CellFormat());
|
||||
tile->content << TileList::Row(line, CellFormat());
|
||||
tile->content << TileList::Row("Threads:", CellFormat());
|
||||
piForeachC(PISystemMonitor::ThreadStats & t, ts)
|
||||
for (const auto & t: ts)
|
||||
maxlen = piMaxi(maxlen, t.name.length());
|
||||
piForeachC(PISystemMonitor::ThreadStats & t, ts) {
|
||||
for (const auto & t: ts) {
|
||||
line = PIString::fromNumber(++num).expandLeftTo(2, ' ') + ": ";
|
||||
line += PIString(t.name).expandRightTo(maxlen, ' ') + ": k ";
|
||||
PIString ns = PIString::fromNumber(t.cpu_load_kernel, 'f', 2);
|
||||
@@ -256,7 +256,7 @@ public:
|
||||
if (tinfo->visible) updateSysMon();
|
||||
}
|
||||
EVENT_HANDLER(void, menuRequest) {
|
||||
piForeach(PIScreenTile * t, mtiles)
|
||||
for (auto * t: mtiles)
|
||||
t->hide();
|
||||
daemon_.disconnect();
|
||||
tmenu->show();
|
||||
@@ -265,7 +265,7 @@ public:
|
||||
EVENT_HANDLER2(void, tileEvent, PIScreenTile *, t, PIScreenTypes::TileEvent, e) {
|
||||
if (t == tmenu) {
|
||||
if (e.type == TileList::RowPressed) {
|
||||
piForeach(PIScreenTile * t, mtiles)
|
||||
for (auto * t: mtiles)
|
||||
t->hide();
|
||||
switch (e.data.toInt()) {
|
||||
case 0: tinfo->show(); break;
|
||||
|
||||
Reference in New Issue
Block a user