diff options
author | hjk <[email protected]> | 2016-01-04 13:57:57 +0100 |
---|---|---|
committer | hjk <[email protected]> | 2016-01-05 13:31:39 +0000 |
commit | e36662e97d17484e6367377a4f034465956f920f (patch) | |
tree | 70efb5429ec88168a15f46ffce8c2da1b72aa5d4 /src/libs/utils/macroexpander.cpp | |
parent | 8b847bcf196f12c6a5c6d7101a94fca9dc30c95f (diff) |
MacroExpander: Remove tracking of 'invisible' variables
The 'invisible' flag is only ever used in the VariableChooser,
which iterates over visible descriptions. Not registering the
descriptions of the unwanted variables serves the same purpose
and simplify the code.
Change-Id: If5c38bc9b61ca66dae5068983181ec1a85a2c8e6
Reviewed-by: Tobias Hunger <[email protected]>
Diffstat (limited to 'src/libs/utils/macroexpander.cpp')
-rw-r--r-- | src/libs/utils/macroexpander.cpp | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/src/libs/utils/macroexpander.cpp b/src/libs/utils/macroexpander.cpp index c4edccbdd60..bee4a473c2b 100644 --- a/src/libs/utils/macroexpander.cpp +++ b/src/libs/utils/macroexpander.cpp @@ -108,7 +108,6 @@ public: QHash<QByteArray, MacroExpander::StringFunction> m_map; QHash<QByteArray, MacroExpander::PrefixFunction> m_prefixMap; - QSet<QByteArray> m_invisbleInChooser; QVector<MacroExpander::ResolverFunction> m_extraResolvers; QMap<QByteArray, QString> m_descriptions; QString m_displayName; @@ -336,9 +335,8 @@ void MacroExpander::registerPrefix(const QByteArray &prefix, const QString &desc void MacroExpander::registerVariable(const QByteArray &variable, const QString &description, const StringFunction &value, bool visibleInChooser) { - if (!visibleInChooser) - d->m_invisbleInChooser.insert(variable); - d->m_descriptions.insert(variable, description); + if (visibleInChooser) + d->m_descriptions.insert(variable, description); d->m_map.insert(variable, value); } @@ -419,13 +417,7 @@ void MacroExpander::registerExtraResolver(const MacroExpander::ResolverFunction */ QList<QByteArray> MacroExpander::visibleVariables() const { - QList<QByteArray> res; - for (auto it = d->m_descriptions.begin(), end = d->m_descriptions.end(); it != end; ++it) { - if (!d->m_invisbleInChooser.contains(it.key())) - res.append(it.key()); - } - - return res; + return d->m_descriptions.keys(); } /*! |