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 // verify that the file exists
if (wxFile::Exists(fullPathStr)) if (wxFile::Exists(fullPathStr))
{ {
if (!gPrefs->Write(wxT("/DefaultOpenPath"), wxPathOnly(fullPathStr)) || FileNames::UpdateDefaultPath(FileNames::Operation::Open, fullPathStr);
!gPrefs->Flush())
return false;
// Make sure it isn't already open. // Make sure it isn't already open.
// Test here even though AudacityProject::OpenFile() also now checks, because // 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++) { for (size_t ff = 0; ff < selectedFiles.GetCount(); ff++) {
wxString fileName = selectedFiles[ff]; wxString fileName = selectedFiles[ff];
wxString path = ::wxPathOnly(fileName); FileNames::UpdateDefaultPath(FileNames::Operation::Open, fileName);
gPrefs->Write(wxT("/DefaultOpenPath"), path);
Import(fileName); Import(fileName);
} }

View File

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