fix (Qt) issues found by clang's clazy tool:

+ -Wclazy-incorrect-emit
+ -Wclazy-strict-iterators
+ -Wclazy-overloaded-signal
+ -Wclazy-qstring-arg
+ -Wclazy-unused-non-trivial-variable
+ -Wclazy-container-anti-pattern
+ -Wclazy-range-loop-reference
+ -Wclazy-const-signal-or-slot
+ -Wclazy-detaching-temporary
+ -Wclazy-qfileinfo-exists
This commit is contained in:
wmayer
2022-06-29 21:00:54 +02:00
parent fc8ccd59ed
commit 82a6241fc5
49 changed files with 185 additions and 180 deletions

View File

@@ -132,54 +132,54 @@ bool DlgParameterFind::matches(QTreeWidgetItem* item, const Options& opt) const
// check the name of an entry in the group
if (opt.name) {
if (opt.match) {
for (auto it : boolMap) {
for (const auto& it : boolMap) {
QString text = QString::fromUtf8(it.first.c_str());
if (text.compare(opt.text, Qt::CaseInsensitive) == 0)
return true;
}
for (auto it : intMap) {
for (const auto& it : intMap) {
QString text = QString::fromUtf8(it.first.c_str());
if (text.compare(opt.text, Qt::CaseInsensitive) == 0)
return true;
}
for (auto it : uintMap) {
for (const auto& it : uintMap) {
QString text = QString::fromUtf8(it.first.c_str());
if (text.compare(opt.text, Qt::CaseInsensitive) == 0)
return true;
}
for (auto it : floatMap) {
for (const auto& it : floatMap) {
QString text = QString::fromUtf8(it.first.c_str());
if (text.compare(opt.text, Qt::CaseInsensitive) == 0)
return true;
}
for (auto it : asciiMap) {
for (const auto& it : asciiMap) {
QString text = QString::fromUtf8(it.first.c_str());
if (text.compare(opt.text, Qt::CaseInsensitive) == 0)
return true;
}
}
else {
for (auto it : boolMap) {
for (const auto& it : boolMap) {
QString text = QString::fromUtf8(it.first.c_str());
if (text.indexOf(opt.text, 0, Qt::CaseInsensitive) >= 0)
return true;
}
for (auto it : intMap) {
for (const auto& it : intMap) {
QString text = QString::fromUtf8(it.first.c_str());
if (text.indexOf(opt.text, 0, Qt::CaseInsensitive) >= 0)
return true;
}
for (auto it : uintMap) {
for (const auto& it : uintMap) {
QString text = QString::fromUtf8(it.first.c_str());
if (text.indexOf(opt.text, 0, Qt::CaseInsensitive) >= 0)
return true;
}
for (auto it : floatMap) {
for (const auto& it : floatMap) {
QString text = QString::fromUtf8(it.first.c_str());
if (text.indexOf(opt.text, 0, Qt::CaseInsensitive) >= 0)
return true;
}
for (auto it : asciiMap) {
for (const auto& it : asciiMap) {
QString text = QString::fromUtf8(it.first.c_str());
if (text.indexOf(opt.text, 0, Qt::CaseInsensitive) >= 0)
return true;
@@ -190,14 +190,14 @@ bool DlgParameterFind::matches(QTreeWidgetItem* item, const Options& opt) const
// check the value of an entry in the group
if (opt.value) {
if (opt.match) {
for (auto it : asciiMap) {
for (const auto& it : asciiMap) {
QString text = QString::fromUtf8(it.second.c_str());
if (text.compare(opt.text, Qt::CaseInsensitive) == 0)
return true;
}
}
else {
for (auto it : asciiMap) {
for (const auto& it : asciiMap) {
QString text = QString::fromUtf8(it.second.c_str());
if (text.indexOf(opt.text, 0, Qt::CaseInsensitive) >= 0)
return true;