Skip to content

Commit

Permalink
#5231: Fix MRU menu
Browse files Browse the repository at this point in the history
  • Loading branch information
codereader committed Jun 19, 2020
1 parent c6f52c3 commit 4f328a9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
3 changes: 2 additions & 1 deletion radiant/ui/mru/MRUMenu.h
Expand Up @@ -57,7 +57,8 @@ class MRUMenu
{
clearMenu();

std::vector<std::string> filenames(GlobalMRU().getMaxNumberOfItems());
std::vector<std::string> filenames;
filenames.reserve(GlobalMRU().getMaxNumberOfItems());

GlobalMRU().foreachItem([&](std::size_t index, const std::string& filename)
{
Expand Down
6 changes: 5 additions & 1 deletion radiantcore/map/Map.cpp
Expand Up @@ -672,7 +672,11 @@ void Map::openMap(const cmd::ArgumentList& args)

std::string fullPath;

if (args.empty())
if (!args.empty())
{
fullPath = args[0].getString();
}
else
{
// No arguments passed, get the map file name to load
MapFileSelection fileInfo = MapFileManager::getMapFileSelection(true, _("Open map"), filetype::TYPE_MAP);
Expand Down
2 changes: 1 addition & 1 deletion radiantcore/map/mru/MRU.cpp
Expand Up @@ -157,7 +157,7 @@ void MRU::initialiseModule(const ApplicationContext& ctx)
_list.reset(new MRUList(_numMaxFiles));

GlobalCommandSystem().addCommand(LOAD_MRU_MAP_CMD,
std::bind(&MRU::loadMRUMap, this, std::placeholders::_1));
std::bind(&MRU::loadMRUMap, this, std::placeholders::_1), { cmd::ARGTYPE_INT });

// Create shortcuts for the items we hold
for (std::size_t i = 1; i <= _numMaxFiles; i++)
Expand Down

0 comments on commit 4f328a9

Please sign in to comment.