Changeset 10821 for code/branches/cpp11_v2/src/libraries/core/command/ArgumentCompletionFunctions.cc
- Timestamp:
- Nov 21, 2015, 7:05:53 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/cpp11_v2/src/libraries/core/command/ArgumentCompletionFunctions.cc
r10769 r10821 77 77 bool groupIsVisible(const std::map<std::string, ConsoleCommand*>& group, bool bOnlyShowHidden) 78 78 { 79 for ( std::map<std::string, ConsoleCommand*>::const_iterator it_command = group.begin(); it_command != group.end(); ++it_command)80 if ( it_command->second->isActive() && it_command->second->hasAccess() && (!it_command->second->isHidden())^bOnlyShowHidden)79 for (const auto & elem : group) 80 if (elem.second->isActive() && elem.second->hasAccess() && (!elem.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 ( std::map<std::string, std::map<std::string, ConsoleCommand*>>::const_iterator it_group = commands.begin(); it_group != commands.end(); ++it_group)103 if (groupIsVisible( it_group->second, bOnlyShowHidden) && it_group->first != "" && (fragmentLC == "" || getLowercase(it_group->first).find(fragmentLC) == 0))104 groupList.push_back(ArgumentCompletionListElement( it_group->first, getLowercase(it_group->first)));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))); 105 105 106 106 // now add all shortcuts (in group "") … … 113 113 114 114 // add the shortcuts 115 for ( std::map<std::string, ConsoleCommand*>::const_iterator it_command = it_group->second.begin(); it_command != it_group->second.end(); ++it_command)116 if ( it_command->second->isActive() && it_command->second->hasAccess() && (!it_command->second->isHidden())^bOnlyShowHidden && (fragmentLC == "" || getLowercase(it_command->first).find(fragmentLC) == 0))117 groupList.push_back(ArgumentCompletionListElement( it_command->first, getLowercase(it_command->first)));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))); 118 118 } 119 119 … … 146 146 if (it_group != ConsoleCommandManager::getInstance().getCommands().end()) 147 147 { 148 for ( std::map<std::string, ConsoleCommand*>::const_iterator it_command = it_group->second.begin(); it_command != it_group->second.end(); ++it_command)149 if ( it_command->second->isActive() && it_command->second->hasAccess() && (!it_command->second->isHidden())^bOnlyShowHidden)150 commandList.push_back(ArgumentCompletionListElement( it_command->first, getLowercase(it_command->first)));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))); 151 151 } 152 152 … … 281 281 282 282 const std::set<std::string>& names = SettingsConfigFile::getInstance().getSectionNames(); 283 for ( std::set<std::string>::const_iterator it = names.begin(); it != names.end(); ++it)284 sectionList.push_back(ArgumentCompletionListElement( *it, getLowercase(*it)));283 for (const auto & name : names) 284 sectionList.push_back(ArgumentCompletionListElement(name, getLowercase(name))); 285 285 286 286 return sectionList;
Note: See TracChangeset
for help on using the changeset viewer.