Allows loading of multiple types of .gz extensioned files by extracting
the second extension

Fixes https://gitlab.com/kicad/code/kicad/issues/9047
This commit is contained in:
Seth Hillbrand 2021-08-30 14:42:08 -07:00
parent 897269f33f
commit f95732a4bb
1 changed files with 6 additions and 4 deletions

View File

@ -414,10 +414,12 @@ SCENEGRAPH* S3D_PLUGIN_MANAGER::Load3DModel( const wxString& aFileName, std::str
ext_to_find.MakeLower();
#endif
// When the extension is .gz, the actual extension should be .stp.gz;
// So ensure is ext is the expected extension
if( ext_to_find == "gz" && aFileName.Lower().EndsWith( ".stp.gz" ) )
ext_to_find = "stp.gz";
// .gz files are compressed versions that may have additional information in the previous extension
if( ext_to_find == "gz" )
{
wxFileName second( raw.GetName() );
ext_to_find = second.GetExt() + ".gz";
}
std::pair < std::multimap< const wxString, KICAD_PLUGIN_LDR_3D* >::iterator,
std::multimap< const wxString, KICAD_PLUGIN_LDR_3D* >::iterator > items;