1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-10-27 15:53:49 +01:00

FileExtension passed to BuildCleanFileName: no leading dot...

... consistently with the comment describing the type alias FileExtension
This commit is contained in:
Paul Licameli
2019-12-27 16:16:50 -05:00
parent d6d4ee3c29
commit 6f80a5c08b
2 changed files with 8 additions and 8 deletions

View File

@@ -537,7 +537,7 @@ wxString MacroCommands::BuildCleanFileName(const FilePath &fileName,
//OnSelectAll(); //OnSelectAll();
pathName = FileNames::FindDefaultPath(FileNames::Operation::Export); pathName = FileNames::FindDefaultPath(FileNames::Operation::Export);
::AudacityMessageBox( ::AudacityMessageBox(
XO("Export recording to %s\n/%s/%s%s") XO("Export recording to %s\n/%s/%s.%s")
.Format(pathName, cleanedString, justName, extension), .Format(pathName, cleanedString, justName, extension),
XO("Export recording"), XO("Export recording"),
wxOK | wxCENTRE); wxOK | wxCENTRE);
@@ -557,6 +557,7 @@ wxString MacroCommands::BuildCleanFileName(const FilePath &fileName,
cleanedName += wxFileName::GetPathSeparator(); cleanedName += wxFileName::GetPathSeparator();
cleanedName += justName; cleanedName += justName;
cleanedName += '.';
cleanedName += extension; cleanedName += extension;
return cleanedName; return cleanedName;
@@ -633,12 +634,12 @@ bool MacroCommands::ApplySpecialCommand(
wxString filename; wxString filename;
FileExtension extension; // required for correct message FileExtension extension; // required for correct message
if (command == wxT("ExportWAV")) if (command == wxT("ExportWAV"))
extension = wxT(".wav"); extension = wxT("wav");
else if (command == wxT("ExportOgg")) else if (command == wxT("ExportOgg"))
extension = wxT(".ogg"); extension = wxT("ogg");
else if (command == wxT("ExportFLAC")) else if (command == wxT("ExportFLAC"))
extension = wxT(".flac"); extension = wxT("flac");
else extension = wxT(".mp3"); else extension = wxT("mp3");
if (mFileName.empty()) { if (mFileName.empty()) {
filename = BuildCleanFileName(project->GetFileName(), extension); filename = BuildCleanFileName(project->GetFileName(), extension);

View File

@@ -54,8 +54,7 @@ void DoExport( AudacityProject &project, const FileExtension & Format )
if (!bPromptingRequired) { if (!bPromptingRequired) {
// We're in batch mode, and we have an mFileName and Format. // We're in batch mode, and we have an mFileName and Format.
wxString extension = "."; wxString extension = Format;
extension += Format;
extension.MakeLower(); extension.MakeLower();
filename = filename =
@@ -73,7 +72,7 @@ void DoExport( AudacityProject &project, const FileExtension & Format )
number.Printf("%03i", counter); number.Printf("%03i", counter);
// So now the name has a number in it too. // So now the name has a number in it too.
filename = MacroCommands::BuildCleanFileName( filename = MacroCommands::BuildCleanFileName(
project.GetFileName(), number + extension); project.GetFileName() + number, extension);
bPromptingRequired = wxFileExists(filename); bPromptingRequired = wxFileExists(filename);
} }
// If we've run out of alternative names, we will fall back to prompting // If we've run out of alternative names, we will fall back to prompting