forked from qt-creator/qt-creator
Valgrind: Save a few cycles in updateFromSettings()
Makes it easier to debug, too. Change-Id: Id55591195bc645cfff002d04e4fdae6e4b3a4b85 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
This commit is contained in:
@@ -909,14 +909,17 @@ void MemcheckToolPrivate::settingsDestroyed(QObject *settings)
|
|||||||
|
|
||||||
void MemcheckToolPrivate::updateFromSettings()
|
void MemcheckToolPrivate::updateFromSettings()
|
||||||
{
|
{
|
||||||
|
const QList<int> stored = m_settings->visibleErrorKinds();
|
||||||
for (QAction *action : std::as_const(m_errorFilterActions)) {
|
for (QAction *action : std::as_const(m_errorFilterActions)) {
|
||||||
bool contained = true;
|
bool contained = true;
|
||||||
const QList<QVariant> actions = action->data().toList();
|
const QList<QVariant> actions = action->data().toList();
|
||||||
for (const QVariant &v : actions) {
|
for (const QVariant &v : actions) {
|
||||||
bool ok;
|
bool ok;
|
||||||
int kind = v.toInt(&ok);
|
int kind = v.toInt(&ok);
|
||||||
if (ok && !m_settings->visibleErrorKinds().contains(kind))
|
if (ok && !stored.contains(kind)) {
|
||||||
contained = false;
|
contained = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
action->setChecked(contained);
|
action->setChecked(contained);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user