1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-04-30 15:49:41 +02:00

Append selected extension to filenames for bug #387 on OSX.

This commit is contained in:
Leland Lucius 2015-05-04 01:07:37 -05:00
parent a107b04d5c
commit d4363ecb5b

View File

@ -741,7 +741,21 @@ int FileDialog::ShowModal()
return wxID_CANCEL;
}
m_path = ConvertSlashInFileName(thePath);
wxFileName fn = ConvertSlashInFileName(thePath);
if (!fn.HasExt())
{
wxStringTokenizer tokenizer( myData.extensions[m_filterIndex], wxT(";"));
if (tokenizer.HasMoreTokens())
{
wxString extension = tokenizer.GetNextToken();
if (extension.Right(2) != wxT(".*") && extension.GetChar(0) == '*')
{
extension = extension.Mid(1);
}
}
fn.SetExt(myData.extensions[m_filterIndex]);
}
m_path = fn.GetFullPath();
m_paths.Add(m_path);
m_fileName = wxFileNameFromPath(m_path);
m_fileNames.Add(m_fileName);