Skip to content

Commit

Permalink
ControlModel: avoid duplicates in developer tools window
Browse files Browse the repository at this point in the history
  • Loading branch information
ronso0 committed Feb 1, 2024
1 parent 0977733 commit 3958df3
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/control/controlmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,21 @@ ControlModel::ControlModel(QObject* pParent)
const QList<QSharedPointer<ControlDoublePrivate>> controlsList =
ControlDoublePrivate::getAllInstances();

QSet<ConfigKey> controlKeys;

for (const QSharedPointer<ControlDoublePrivate>& pControl : controlsList) {
if (!pControl) {
continue;
}

// Skip duplicates
// This skips either the alias or original key, whatever comes first
// in controlsList, but that doesn't make a difference here.
if (controlKeys.contains(pControl->getKey())) {
continue;
}
controlKeys.insert(pControl->getKey());

addControl(pControl->getKey(),
pControl->name(),
pControl->description());
Expand Down

0 comments on commit 3958df3

Please sign in to comment.