Use MIME type as backup to extension, just in case extension fails.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1470 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Sonicadvance1 2008-12-09 23:27:08 +00:00
parent 05d2e470bf
commit c889d03829
1 changed files with 7 additions and 3 deletions

View File

@ -585,10 +585,14 @@ void CISOProperties::OnEditConfig(wxCommandEvent& WXUNUSED (event))
SaveGameConfig();
wxFileType* filetype = wxTheMimeTypesManager->GetFileTypeFromExtension(_("ini"));
if(filetype == NULL)
if(filetype == NULL) // From extension failed, trying with MIME type now
{
PanicAlert("Filetype 'ini' is unknown! Will not open!");
return;
filetype = wxTheMimeTypesManager->GetFileTypeFromMimeType(_("text/plain"));
if(filetype == NULL) // MIME type failed, aborting mission
{
PanicAlert("Filetype 'ini' is unknown! Will not open!");
return;
}
}
wxString OpenCommand;
OpenCommand = filetype->GetOpenCommand(wxString::FromAscii(GameIniFile.c_str()));