Changed the "extension as filetype" behavior for software list images to be opt in behavior

It sounds like whether it is up in the air whether softlist file types should be derived from file extensions.  Fair enough.  This patch alters the earlier proposal so this at the very least becomes opt in behavior so that an ugly hack does not have to be replicated in client code in a potentially inconsistent and buggy fashion.
This commit is contained in:
Nathan Woods 2016-08-25 08:27:03 -04:00
parent cd745e6095
commit 58090e0d5f
3 changed files with 3 additions and 1 deletions

View File

@ -96,6 +96,7 @@ protected:
// device-level overrides
virtual void device_config_complete() override;
virtual void device_start() override;
virtual const bool use_software_list_file_extension_for_filetype() const override { return true; }
private:
cassette_image *m_cassette;

View File

@ -1052,7 +1052,7 @@ image_init_result device_image_interface::load_software(const std::string &softl
m_image_name = m_full_software_name;
m_basename = m_full_software_name;
m_basename_noext = m_full_software_name;
m_filetype = m_mame_file != nullptr
m_filetype = use_software_list_file_extension_for_filetype() && m_mame_file != nullptr
? core_filename_extract_extension(m_mame_file->filename(), true)
: "";

View File

@ -250,6 +250,7 @@ public:
protected:
virtual const software_list_loader &get_software_list_loader() const;
virtual const bool use_software_list_file_extension_for_filetype() const { return false; }
image_init_result load_internal(const std::string &path, bool is_create, int create_format, util::option_resolution *create_args, bool just_load);
image_error_t load_image_by_path(UINT32 open_flags, const std::string &path);