1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-09-18 17:10:55 +02:00

"/DefaultOpenPath" is now in only one place

This commit is contained in:
Paul Licameli 2017-08-03 07:55:51 -04:00
parent e3efc98a55
commit a5594537bb
3 changed files with 3 additions and 7 deletions

View File

@ -774,9 +774,7 @@ bool AudacityApp::MRUOpen(const wxString &fullPathStr) {
// verify that the file exists
if (wxFile::Exists(fullPathStr))
{
if (!gPrefs->Write(wxT("/DefaultOpenPath"), wxPathOnly(fullPathStr)) ||
!gPrefs->Flush())
return false;
FileNames::UpdateDefaultPath(FileNames::Operation::Open, fullPathStr);
// Make sure it isn't already open.
// Test here even though AudacityProject::OpenFile() also now checks, because

View File

@ -6731,8 +6731,7 @@ void AudacityProject::OnImport()
for (size_t ff = 0; ff < selectedFiles.GetCount(); ff++) {
wxString fileName = selectedFiles[ff];
wxString path = ::wxPathOnly(fileName);
gPrefs->Write(wxT("/DefaultOpenPath"), path);
FileNames::UpdateDefaultPath(FileNames::Operation::Open, fileName);
Import(fileName);
}

View File

@ -2927,8 +2927,7 @@ void AudacityProject::OpenFiles(AudacityProject *proj)
if (AudacityProject::IsAlreadyOpen(fileName))
continue; // Skip ones that are already open.
gPrefs->Write(wxT("/DefaultOpenPath"), wxPathOnly(fileName));
gPrefs->Flush();
FileNames::UpdateDefaultPath(FileNames::Operation::Open, fileName);
// DMM: If the project is dirty, that means it's been touched at
// all, and it's not safe to open a NEW project directly in its