diff options
author | 2016-06-29 20:50:36 -0400 | |
---|---|---|
committer | 2016-06-29 20:50:36 -0400 | |
commit | a2b07a8969c6b47bf71f0ff13db058327634919e (patch) | |
tree | ffe4e86a38dec8d4c3ddfda23e12aa9aea73691c /src/frontend/mame/ui/menu.cpp | |
parent | 78576d09c66b7bfb6d3e6d41c38fc9c059e6cb6b (diff) |
Added a move constructor and got rid of the 'const char *' overload. I had to update a ton of call sites that relied on being able to
pass nullptr. It is inevitable that there are more
Diffstat (limited to 'src/frontend/mame/ui/menu.cpp')
-rw-r--r-- | src/frontend/mame/ui/menu.cpp | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/src/frontend/mame/ui/menu.cpp b/src/frontend/mame/ui/menu.cpp index 76c92f5e725..56daa054b04 100644 --- a/src/frontend/mame/ui/menu.cpp +++ b/src/frontend/mame/ui/menu.cpp @@ -261,21 +261,21 @@ void menu::reset(reset_options options) // add an item to return if (!m_parent) { - item_append(_("Return to Machine"), nullptr, 0, nullptr); + item_append(_("Return to Machine"), "", 0, nullptr); } else if (m_parent->is_special_main_menu()) { if (machine().options().ui() == emu_options::UI_SIMPLE) - item_append(_("Exit"), nullptr, 0, nullptr); + item_append(_("Exit"), "", 0, nullptr); else - item_append(_("Exit"), nullptr, FLAG_UI | FLAG_LEFT_ARROW | FLAG_RIGHT_ARROW, nullptr); + item_append(_("Exit"), "", FLAG_UI | FLAG_LEFT_ARROW | FLAG_RIGHT_ARROW, nullptr); } else { if (machine().options().ui() != emu_options::UI_SIMPLE && menu::stack_has_special_main_menu()) - item_append(_("Return to Previous Menu"), nullptr, FLAG_UI | FLAG_LEFT_ARROW | FLAG_RIGHT_ARROW, nullptr); + item_append(_("Return to Previous Menu"), "", FLAG_UI | FLAG_LEFT_ARROW | FLAG_RIGHT_ARROW, nullptr); else - item_append(_("Return to Previous Menu"), nullptr, 0, nullptr); + item_append(_("Return to Previous Menu"), "", 0, nullptr); } } @@ -321,7 +321,7 @@ void menu::item_append(menu_item item) void menu::item_append(menu_item_type type) { if (type == menu_item_type::SEPARATOR) - item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr, menu_item_type::SEPARATOR); + item_append(MENU_SEPARATOR_ITEM, "", 0, nullptr, menu_item_type::SEPARATOR); } //------------------------------------------------- @@ -329,15 +329,9 @@ void menu::item_append(menu_item_type type) // end of the menu //------------------------------------------------- -void menu::item_append(const char *text, const char *subtext, UINT32 flags, void *ref, menu_item_type type) +void menu::item_append(const std::string &text, const std::string &subtext, UINT32 flags, void *ref, menu_item_type type) { - // need distinct overload because we might get nullptr - item_append( - std::string(text ? text : ""), - std::string(subtext ? subtext : ""), - flags, - ref, - type); + item_append((std::string&&)text, (std::string&&)subtext, flags, ref, type); } //------------------------------------------------- @@ -345,7 +339,7 @@ void menu::item_append(const char *text, const char *subtext, UINT32 flags, void // end of the menu //------------------------------------------------- -void menu::item_append(const std::string &text, const std::string &subtext, UINT32 flags, void *ref, menu_item_type type) +void menu::item_append(std::string &&text, std::string &&subtext, UINT32 flags, void *ref, menu_item_type type) { // only allow multiline as the first item if ((flags & FLAG_MULTILINE) != 0) |