Changeset 10916 for code/branches/cpp11_v2/src/libraries/core/command/ArgumentCompletionFunctions.cc
- Timestamp:
- Dec 2, 2015, 11:22:03 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/cpp11_v2/src/libraries/core/command/ArgumentCompletionFunctions.cc
r10821 r10916 77 77 bool groupIsVisible(const std::map<std::string, ConsoleCommand*>& group, bool bOnlyShowHidden) 78 78 { 79 for (const auto & elem: group)80 if ( elem.second->isActive() && elem.second->hasAccess() && (!elem.second->isHidden())^bOnlyShowHidden)79 for (const auto& mapEntry : group) 80 if (mapEntry.second->isActive() && mapEntry.second->hasAccess() && (!mapEntry.second->isHidden())^bOnlyShowHidden) 81 81 return true; 82 82 … … 100 100 // get all the groups that are visible (except the shortcut group "") 101 101 const std::map<std::string, std::map<std::string, ConsoleCommand*>>& commands = ConsoleCommandManager::getInstance().getCommands(); 102 for (const auto & command: commands)103 if (groupIsVisible( command.second, bOnlyShowHidden) && command.first != "" && (fragmentLC == "" || getLowercase(command.first).find(fragmentLC) == 0))104 groupList.push_back(ArgumentCompletionListElement( command.first, getLowercase(command.first)));102 for (const auto& mapEntry : commands) 103 if (groupIsVisible(mapEntry.second, bOnlyShowHidden) && mapEntry.first != "" && (fragmentLC == "" || getLowercase(mapEntry.first).find(fragmentLC) == 0)) 104 groupList.push_back(ArgumentCompletionListElement(mapEntry.first, getLowercase(mapEntry.first))); 105 105 106 106 // now add all shortcuts (in group "") … … 113 113 114 114 // add the shortcuts 115 for (const auto & elem: it_group->second)116 if ( elem.second->isActive() && elem.second->hasAccess() && (!elem.second->isHidden())^bOnlyShowHidden && (fragmentLC == "" || getLowercase(elem.first).find(fragmentLC) == 0))117 groupList.push_back(ArgumentCompletionListElement( elem.first, getLowercase(elem.first)));115 for (const auto& mapEntry : it_group->second) 116 if (mapEntry.second->isActive() && mapEntry.second->hasAccess() && (!mapEntry.second->isHidden())^bOnlyShowHidden && (fragmentLC == "" || getLowercase(mapEntry.first).find(fragmentLC) == 0)) 117 groupList.push_back(ArgumentCompletionListElement(mapEntry.first, getLowercase(mapEntry.first))); 118 118 } 119 119 … … 146 146 if (it_group != ConsoleCommandManager::getInstance().getCommands().end()) 147 147 { 148 for (const auto & elem: it_group->second)149 if ( elem.second->isActive() && elem.second->hasAccess() && (!elem.second->isHidden())^bOnlyShowHidden)150 commandList.push_back(ArgumentCompletionListElement( elem.first, getLowercase(elem.first)));148 for (const auto& mapEntry : it_group->second) 149 if (mapEntry.second->isActive() && mapEntry.second->hasAccess() && (!mapEntry.second->isHidden())^bOnlyShowHidden) 150 commandList.push_back(ArgumentCompletionListElement(mapEntry.first, getLowercase(mapEntry.first))); 151 151 } 152 152 … … 281 281 282 282 const std::set<std::string>& names = SettingsConfigFile::getInstance().getSectionNames(); 283 for (const auto& name : names)283 for (const std::string& name : names) 284 284 sectionList.push_back(ArgumentCompletionListElement(name, getLowercase(name))); 285 285
Note: See TracChangeset
for help on using the changeset viewer.