diff options
author | Arttu Tarkiainen <arttu.tarkiainen@qt.io> | 2023-11-01 13:57:36 +0200 |
---|---|---|
committer | Arttu Tarkiainen <arttu.tarkiainen@qt.io> | 2023-11-01 15:29:46 +0200 |
commit | 4e86087ba55d93e26acd5a2a08a29a725e8495df (patch) | |
tree | 77b881d3c25b2cf6dd4fb21afb28cc3f6b1d60ef /src/libs/installer | |
parent | 21404eb777c5aa48580476bb569a7370e67c40f7 (diff) |
ComponentAlias: fix missing data when multiple keys have same value
When populating ComponentAlias data from an alias source file, there
was an oversight with the logic of getting the key by a value when
iterating the AliasData map. For example with the text values, like
DisplayName and Description, there may be same values and the logic
breaks.
Instead use an iterator with the map.
Change-Id: I59c2f45849533d1e664c3e9e2ccd9bba142a7b57
Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
Diffstat (limited to 'src/libs/installer')
-rw-r--r-- | src/libs/installer/componentalias.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/libs/installer/componentalias.cpp b/src/libs/installer/componentalias.cpp index 1cd2eb0ed..955d715fd 100644 --- a/src/libs/installer/componentalias.cpp +++ b/src/libs/installer/componentalias.cpp @@ -177,9 +177,10 @@ bool AliasFinder::run() delete m_aliases.take(name); ComponentAlias *alias = new ComponentAlias(m_core); - for (auto &value : data) { - if (value.canConvert<QString>()) - alias->setValue(data.key(value), value.toString()); + AliasData::const_iterator it; + for (it = data.cbegin(); it != data.cend(); ++it) { + if (it.value().canConvert<QString>()) + alias->setValue(it.key(), it.value().toString()); } m_aliases.insert(name, alias); } |