mirror of
https://github.com/holub/mame
synced 2025-04-23 08:49:55 +03:00
Changed menu_file_create::m_ok to be a reference instead of a pointer
This commit is contained in:
parent
aed7acbe66
commit
a95f190523
@ -162,15 +162,15 @@ static int is_valid_filename_char(unicode_char unichar)
|
||||
// ctor
|
||||
//-------------------------------------------------
|
||||
|
||||
menu_file_create::menu_file_create(mame_ui_manager &mui, render_container *container, device_image_interface *image, std::string ¤t_directory, std::string ¤t_file, bool *ok)
|
||||
menu_file_create::menu_file_create(mame_ui_manager &mui, render_container *container, device_image_interface *image, std::string ¤t_directory, std::string ¤t_file, bool &ok)
|
||||
: menu(mui, container)
|
||||
, m_current_directory(current_directory)
|
||||
, m_current_file(current_file)
|
||||
, m_current_format(nullptr)
|
||||
, m_ok(ok)
|
||||
{
|
||||
m_image = image;
|
||||
m_ok = ok;
|
||||
*m_ok = true;
|
||||
m_ok = true;
|
||||
auto const sep = current_file.rfind(PATH_SEPARATOR);
|
||||
|
||||
m_filename.reserve(1024);
|
||||
@ -276,7 +276,7 @@ void menu_file_create::handle()
|
||||
}
|
||||
break;
|
||||
case IPT_UI_CANCEL:
|
||||
*m_ok = false;
|
||||
m_ok = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -38,7 +38,7 @@ private:
|
||||
class menu_file_create : public menu
|
||||
{
|
||||
public:
|
||||
menu_file_create(mame_ui_manager &mui, render_container *container, device_image_interface *image, std::string ¤t_directory, std::string ¤t_file, bool *ok);
|
||||
menu_file_create(mame_ui_manager &mui, render_container *container, device_image_interface *image, std::string ¤t_directory, std::string ¤t_file, bool &ok);
|
||||
virtual ~menu_file_create() override;
|
||||
virtual void populate() override;
|
||||
virtual void handle() override;
|
||||
@ -52,7 +52,7 @@ private:
|
||||
std::string m_filename;
|
||||
|
||||
protected:
|
||||
bool * m_ok;
|
||||
bool & m_ok;
|
||||
};
|
||||
|
||||
// ======================> menu_select_format
|
||||
|
@ -157,7 +157,7 @@ void menu_control_floppy_image::handle()
|
||||
break;
|
||||
|
||||
case menu_select_rw::result::WRITE_OTHER:
|
||||
menu::stack_push<menu_file_create>(ui(), container, image, m_current_directory, m_current_file, &create_ok);
|
||||
menu::stack_push<menu_file_create>(ui(), container, image, m_current_directory, m_current_file, create_ok);
|
||||
state = CHECK_CREATE;
|
||||
break;
|
||||
|
||||
|
@ -278,7 +278,7 @@ void menu_control_device_image::handle()
|
||||
break;
|
||||
|
||||
case menu_file_selector::result::CREATE:
|
||||
menu::stack_push<menu_file_create>(ui(), container, image, m_current_directory, m_current_file, &create_ok);
|
||||
menu::stack_push<menu_file_create>(ui(), container, image, m_current_directory, m_current_file, create_ok);
|
||||
state = CHECK_CREATE;
|
||||
break;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user