CDVD: Add fallback path for blockdump source name unavailability

2 pass fallback cases for the untitled scenario was mentioned in the TODO comment to be completed, added  one of them. (Still doesn't seem reliable enough, but honestly when do we  Also modified blank space indentation at a part to tab space to satisfy lightning boi.
This commit is contained in:
Akash 2019-07-01 11:29:35 +05:30
parent 7290576a2a
commit a36d5a0221
1 changed files with 8 additions and 6 deletions

View File

@ -370,15 +370,17 @@ bool DoCDVDopen()
return true;
}
// TODO: "Untitled" should use pnach/slus name resolution, slus if no patch,
// and finally an "Untitled-[ElfCRC]" if no slus.
wxString somepick( Path::GetFilenameWithoutExt( m_SourceFilename[CurrentSourceType] ) );
if( somepick.IsEmpty() )
wxString somepick( Path::GetFilenameWithoutExt( m_SourceFilename[CurrentSourceType] ) );
//FWIW Disc serial availability doesn't seem reliable enough, sometimes it's there and sometime it's just null
//Shouldn't the serial be available all time? Potentially need to look into Elfreloadinfo() reliability
//TODO: Add extra fallback case for CRC.
if (somepick.IsEmpty() && !DiscSerial.IsEmpty())
somepick = L"Untitled-" + DiscSerial;
else if (somepick.IsEmpty())
somepick = L"Untitled";
if (g_Conf->CurrentBlockdump.IsEmpty())
g_Conf->CurrentBlockdump = wxGetCwd();
g_Conf->CurrentBlockdump = wxGetCwd();
wxString temp(Path::Combine(g_Conf->CurrentBlockdump, somepick));