mirror of https://github.com/PCSX2/pcsx2.git
cdvd: Simplify and fix disc variable handling
This fixes an issue on Windows where the previously selected disc drive choice is cleared if there is no disc in the drive when PCSX2 is opened.
This commit is contained in:
parent
7f8ca17752
commit
982ef41814
|
@ -184,9 +184,9 @@ void StopKeepAliveThread()
|
||||||
s32 CALLBACK DISCopen(const char* pTitle)
|
s32 CALLBACK DISCopen(const char* pTitle)
|
||||||
{
|
{
|
||||||
#if defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
std::wstring drive = g_Conf->Folders.RunDisc.GetPath().ToStdWstring();
|
std::wstring drive = g_Conf->Folders.RunDisc.ToStdWstring();
|
||||||
#else
|
#else
|
||||||
std::string drive = g_Conf->Folders.RunDisc.GetPath().ToStdString();
|
std::string drive = g_Conf->Folders.RunDisc.ToStdString();
|
||||||
#endif
|
#endif
|
||||||
GetValidDrive(drive);
|
GetValidDrive(drive);
|
||||||
if (drive.empty())
|
if (drive.empty())
|
||||||
|
|
|
@ -737,7 +737,7 @@ AppConfig::FolderOptions::FolderOptions()
|
||||||
|
|
||||||
, RunIso ( PathDefs::GetDocuments() ) // raw default is always the Documents folder.
|
, RunIso ( PathDefs::GetDocuments() ) // raw default is always the Documents folder.
|
||||||
, RunELF ( PathDefs::GetDocuments() ) // raw default is always the Documents folder.
|
, RunELF ( PathDefs::GetDocuments() ) // raw default is always the Documents folder.
|
||||||
, RunDisc ( PathDefs::GetDocuments().GetFilename() )
|
, RunDisc()
|
||||||
{
|
{
|
||||||
bitset = 0xffffffff;
|
bitset = 0xffffffff;
|
||||||
}
|
}
|
||||||
|
@ -777,7 +777,7 @@ void AppConfig::FolderOptions::LoadSave( IniInterface& ini )
|
||||||
|
|
||||||
IniEntryDirFile( RunIso, rel );
|
IniEntryDirFile( RunIso, rel );
|
||||||
IniEntryDirFile( RunELF, rel );
|
IniEntryDirFile( RunELF, rel );
|
||||||
IniEntryDirFile( RunDisc, rel );
|
IniEntry(RunDisc);
|
||||||
|
|
||||||
if( ini.IsLoading() )
|
if( ini.IsLoading() )
|
||||||
{
|
{
|
||||||
|
@ -1303,18 +1303,6 @@ static void LoadUiSettings()
|
||||||
g_Conf->CurrentIso.clear();
|
g_Conf->CurrentIso.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(_WIN32)
|
|
||||||
if( !g_Conf->Folders.RunDisc.DirExists() )
|
|
||||||
{
|
|
||||||
g_Conf->Folders.RunDisc.Clear();
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
if (!g_Conf->Folders.RunDisc.Exists())
|
|
||||||
{
|
|
||||||
g_Conf->Folders.RunDisc.Clear();
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
sApp.DispatchUiSettingsEvent( loader );
|
sApp.DispatchUiSettingsEvent( loader );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1350,18 +1338,6 @@ static void SaveUiSettings()
|
||||||
g_Conf->CurrentIso.clear();
|
g_Conf->CurrentIso.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(_WIN32)
|
|
||||||
if (!g_Conf->Folders.RunDisc.DirExists())
|
|
||||||
{
|
|
||||||
g_Conf->Folders.RunDisc.Clear();
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
if (!g_Conf->Folders.RunDisc.Exists())
|
|
||||||
{
|
|
||||||
g_Conf->Folders.RunDisc.Clear();
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
sApp.GetRecentIsoManager().Add( g_Conf->CurrentIso );
|
sApp.GetRecentIsoManager().Add( g_Conf->CurrentIso );
|
||||||
|
|
||||||
AppIniSaver saver;
|
AppIniSaver saver;
|
||||||
|
|
|
@ -172,7 +172,7 @@ public:
|
||||||
|
|
||||||
wxDirName RunIso; // last used location for Iso loading.
|
wxDirName RunIso; // last used location for Iso loading.
|
||||||
wxDirName RunELF; // last used location for ELF loading.
|
wxDirName RunELF; // last used location for ELF loading.
|
||||||
wxFileName RunDisc; // last used location for Disc loading.
|
wxString RunDisc; // last used location for Disc loading.
|
||||||
|
|
||||||
FolderOptions();
|
FolderOptions();
|
||||||
void LoadSave( IniInterface& conf );
|
void LoadSave( IniInterface& conf );
|
||||||
|
|
|
@ -1218,11 +1218,7 @@ void SysUpdateIsoSrcFile( const wxString& newIsoFile )
|
||||||
|
|
||||||
void SysUpdateDiscSrcDrive( const wxString& newDiscDrive )
|
void SysUpdateDiscSrcDrive( const wxString& newDiscDrive )
|
||||||
{
|
{
|
||||||
#if defined(_WIN32)
|
g_Conf->Folders.RunDisc = newDiscDrive;
|
||||||
g_Conf->Folders.RunDisc = wxFileName::DirName(newDiscDrive);
|
|
||||||
#else
|
|
||||||
g_Conf->Folders.RunDisc = wxFileName(newDiscDrive);
|
|
||||||
#endif
|
|
||||||
AppSaveSettings();
|
AppSaveSettings();
|
||||||
sMainFrame.UpdateCdvdSrcSelection();
|
sMainFrame.UpdateCdvdSrcSelection();
|
||||||
}
|
}
|
||||||
|
|
|
@ -237,7 +237,7 @@ wxWindowID SwapOrReset_Disc(wxWindow* owner, IScopedCoreThread& core, const wxSt
|
||||||
}
|
}
|
||||||
wxWindowID result = wxID_CANCEL;
|
wxWindowID result = wxID_CANCEL;
|
||||||
|
|
||||||
if ((g_Conf->CdvdSource == CDVD_SourceType::Disc) && (driveLetter == g_Conf->Folders.RunDisc.GetPath()))
|
if ((g_Conf->CdvdSource == CDVD_SourceType::Disc) && (driveLetter == g_Conf->Folders.RunDisc))
|
||||||
{
|
{
|
||||||
core.AllowResume();
|
core.AllowResume();
|
||||||
return result;
|
return result;
|
||||||
|
|
Loading…
Reference in New Issue