apply some code analyzer recommendations

This commit is contained in:
2024-11-20 20:02:09 +03:00
parent 1becca7519
commit 04b40d367c
9 changed files with 25 additions and 33 deletions

View File

@@ -29,7 +29,7 @@ QPIIntrospector::QPIIntrospector(QWidget * parent): EMainWindow(parent), peer("_
session.addEntry(tabWidgetMain);
PICodeInfo::EnumInfo * ei = PICODEINFO::enums().value("PIIntrospection::InfoTypes");
if (ei) {
piForeachC(PICodeInfo::EnumeratorInfo & e, ei->members) {
for (const auto & e: ei->members) {
#if PIP_VERSION >= PIP_MAKE_VERSION(2, 39, 0)
QCheckBox * cb = new QCheckBox(PI2QString(e.name.mid(2).toString()));
#else
@@ -83,7 +83,7 @@ void QPIIntrospector::buildTree(QByteArray d) {
PIByteArray pd = Q2PIByteArray(d);
pd >> threads;
treeContainers->clear();
piForeachC (PIIntrospectionThreads::ThreadInfo & t, threads) {
for (const auto & t: threads) {
QTreeWidgetItem * ti = new QTreeWidgetItem();
ti->setText(0, QString(PI2QString(t.name) + " (%1)").arg(t.id));
treeContainers->addTopLevelItem(ti);
@@ -241,7 +241,7 @@ void QPIIntrospector::peersChanged(const PIString & name) {
QString cs = listApp->currentItem() ? listApp->currentItem()->text() : "";
listApp->clear();
peer.lock();
piForeachC(PIPeer::PeerInfo & p, peer.allPeers()) {
for (const auto & p: peer.allPeers()) {
QString pn = PI2QString(p.name);
if (!pn.contains(tag)) continue;
QListWidgetItem * li = new QListWidgetItem(pn.left(pn.indexOf(tag)));