mirror of
https://github.com/cookiengineer/audacity
synced 2025-06-23 15:50:05 +02:00
Be careful of static initialization of arrays of FileType
This commit is contained in:
parent
6a50a6fad5
commit
c63cbf01eb
@ -3721,16 +3721,20 @@ void EditCurvesDialog::OnDelete(wxCommandEvent & WXUNUSED(event))
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static const auto XMLtypes = FileNames::FileTypes{
|
static const FileNames::FileTypes &XMLtypes()
|
||||||
FileNames::XMLFiles
|
{
|
||||||
};
|
static const FileNames::FileTypes results{
|
||||||
|
FileNames::XMLFiles
|
||||||
|
};
|
||||||
|
return results;
|
||||||
|
}
|
||||||
|
|
||||||
void EditCurvesDialog::OnImport( wxCommandEvent & WXUNUSED(event))
|
void EditCurvesDialog::OnImport( wxCommandEvent & WXUNUSED(event))
|
||||||
{
|
{
|
||||||
FileDialogWrapper filePicker(
|
FileDialogWrapper filePicker(
|
||||||
this,
|
this,
|
||||||
XO("Choose an EQ curve file"), FileNames::DataDir(), wxT(""),
|
XO("Choose an EQ curve file"), FileNames::DataDir(), wxT(""),
|
||||||
XMLtypes );
|
XMLtypes() );
|
||||||
wxString fileName;
|
wxString fileName;
|
||||||
if( filePicker.ShowModal() == wxID_CANCEL)
|
if( filePicker.ShowModal() == wxID_CANCEL)
|
||||||
return;
|
return;
|
||||||
@ -3752,7 +3756,7 @@ void EditCurvesDialog::OnExport( wxCommandEvent & WXUNUSED(event))
|
|||||||
{
|
{
|
||||||
FileDialogWrapper filePicker(this, XO("Export EQ curves as..."),
|
FileDialogWrapper filePicker(this, XO("Export EQ curves as..."),
|
||||||
FileNames::DataDir(), wxT(""),
|
FileNames::DataDir(), wxT(""),
|
||||||
XMLtypes,
|
XMLtypes(),
|
||||||
wxFD_SAVE | wxFD_OVERWRITE_PROMPT | wxRESIZE_BORDER); // wxFD_CHANGE_DIR?
|
wxFD_SAVE | wxFD_OVERWRITE_PROMPT | wxRESIZE_BORDER); // wxFD_CHANGE_DIR?
|
||||||
wxString fileName;
|
wxString fileName;
|
||||||
if( filePicker.ShowModal() == wxID_CANCEL)
|
if( filePicker.ShowModal() == wxID_CANCEL)
|
||||||
|
@ -2278,8 +2278,11 @@ void ExportFFmpegOptions::OnLoadPreset(wxCommandEvent& WXUNUSED(event))
|
|||||||
DoOnCodecList();
|
DoOnCodecList();
|
||||||
}
|
}
|
||||||
|
|
||||||
static const FileNames::FileTypes FileTypes{
|
static const FileNames::FileTypes &FileTypes()
|
||||||
FileNames::XMLFiles, FileNames::AllFiles
|
{
|
||||||
|
static const FileNames::FileTypes result{
|
||||||
|
FileNames::XMLFiles, FileNames::AllFiles };
|
||||||
|
return result;
|
||||||
};
|
};
|
||||||
|
|
||||||
///
|
///
|
||||||
@ -2291,7 +2294,7 @@ void ExportFFmpegOptions::OnImportPresets(wxCommandEvent& WXUNUSED(event))
|
|||||||
XO("Select xml file with presets to import"),
|
XO("Select xml file with presets to import"),
|
||||||
gPrefs->Read(wxT("/FileFormats/FFmpegPresetDir")),
|
gPrefs->Read(wxT("/FileFormats/FFmpegPresetDir")),
|
||||||
wxEmptyString,
|
wxEmptyString,
|
||||||
FileTypes,
|
FileTypes(),
|
||||||
wxFD_OPEN);
|
wxFD_OPEN);
|
||||||
if (dlg.ShowModal() == wxID_CANCEL) return;
|
if (dlg.ShowModal() == wxID_CANCEL) return;
|
||||||
path = dlg.GetPath();
|
path = dlg.GetPath();
|
||||||
@ -2324,7 +2327,7 @@ void ExportFFmpegOptions::OnExportPresets(wxCommandEvent& WXUNUSED(event))
|
|||||||
XO("Select xml file to export presets into"),
|
XO("Select xml file to export presets into"),
|
||||||
gPrefs->Read(wxT("/FileFormats/FFmpegPresetDir")),
|
gPrefs->Read(wxT("/FileFormats/FFmpegPresetDir")),
|
||||||
wxEmptyString,
|
wxEmptyString,
|
||||||
FileTypes,
|
FileTypes(),
|
||||||
wxFD_SAVE|wxFD_OVERWRITE_PROMPT);
|
wxFD_SAVE|wxFD_OVERWRITE_PROMPT);
|
||||||
if (dlg.ShowModal() == wxID_CANCEL) return;
|
if (dlg.ShowModal() == wxID_CANCEL) return;
|
||||||
path = dlg.GetPath();
|
path = dlg.GetPath();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user