Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 25, 2015, 10:56:26 PM (9 years ago)
Author:
landauf
Message:

made ConsoleCommandManager a singleton.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/core7/src/libraries/core/command/ArgumentCompletionFunctions.cc

    r10347 r10484  
    9999
    100100                // get all the groups that are visible (except the shortcut group "")
    101                 const std::map<std::string, std::map<std::string, ConsoleCommand*> >& commands = ConsoleCommandManager::getCommands();
     101                const std::map<std::string, std::map<std::string, ConsoleCommand*> >& commands = ConsoleCommandManager::getInstance().getCommands();
    102102                for (std::map<std::string, std::map<std::string, ConsoleCommand*> >::const_iterator it_group = commands.begin(); it_group != commands.end(); ++it_group)
    103103                    if (groupIsVisible(it_group->second, bOnlyShowHidden) && it_group->first != "" && (fragmentLC == "" || getLowercase(it_group->first).find(fragmentLC) == 0))
     
    138138
    139139                // find the iterator of the given group
    140                 std::map<std::string, std::map<std::string, ConsoleCommand*> >::const_iterator it_group = ConsoleCommandManager::getCommands().begin();
    141                 for ( ; it_group != ConsoleCommandManager::getCommands().end(); ++it_group)
     140                std::map<std::string, std::map<std::string, ConsoleCommand*> >::const_iterator it_group = ConsoleCommandManager::getInstance().getCommands().begin();
     141                for ( ; it_group != ConsoleCommandManager::getInstance().getCommands().end(); ++it_group)
    142142                    if (getLowercase(it_group->first) == groupLC)
    143143                        break;
    144144
    145145                // add all commands in the group to the list
    146                 if (it_group != ConsoleCommandManager::getCommands().end())
     146                if (it_group != ConsoleCommandManager::getInstance().getCommands().end())
    147147                {
    148148                    for (std::map<std::string, ConsoleCommand*>::const_iterator it_command = it_group->second.begin(); it_command != it_group->second.end(); ++it_command)
     
    207207                return detail::_groupsandcommands(fragment, true);
    208208
    209             if (ConsoleCommandManager::getCommandLC(getLowercase(tokens[0])))
     209            if (ConsoleCommandManager::getInstance().getCommandLC(getLowercase(tokens[0])))
    210210                return ARGUMENT_COMPLETION_FUNCTION_CALL(command)(fragment);
    211211
    212212            if (tokens.size() == 1)
    213213            {
    214                 std::map<std::string, std::map<std::string, ConsoleCommand*> >::const_iterator it_group = ConsoleCommandManager::getCommands().find(tokens[0]);
    215                 if (it_group != ConsoleCommandManager::getCommands().end())
     214                std::map<std::string, std::map<std::string, ConsoleCommand*> >::const_iterator it_group = ConsoleCommandManager::getInstance().getCommands().find(tokens[0]);
     215                if (it_group != ConsoleCommandManager::getInstance().getCommands().end())
    216216                    return detail::_subcommands(fragment, tokens[0], true);
    217217                else
     
    219219            }
    220220
    221             if (ConsoleCommandManager::getCommandLC(getLowercase(tokens[0]), getLowercase(tokens[1])))
     221            if (ConsoleCommandManager::getInstance().getCommandLC(getLowercase(tokens[0]), getLowercase(tokens[1])))
    222222                return ARGUMENT_COMPLETION_FUNCTION_CALL(command)(fragment);
    223223
Note: See TracChangeset for help on using the changeset viewer.