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
|
||||
}
|
||||
|
||||
static const auto XMLtypes = FileNames::FileTypes{
|
||||
FileNames::XMLFiles
|
||||
};
|
||||
static const FileNames::FileTypes &XMLtypes()
|
||||
{
|
||||
static const FileNames::FileTypes results{
|
||||
FileNames::XMLFiles
|
||||
};
|
||||
return results;
|
||||
}
|
||||
|
||||
void EditCurvesDialog::OnImport( wxCommandEvent & WXUNUSED(event))
|
||||
{
|
||||
FileDialogWrapper filePicker(
|
||||
this,
|
||||
XO("Choose an EQ curve file"), FileNames::DataDir(), wxT(""),
|
||||
XMLtypes );
|
||||
XMLtypes() );
|
||||
wxString fileName;
|
||||
if( filePicker.ShowModal() == wxID_CANCEL)
|
||||
return;
|
||||
|
@ -3752,7 +3756,7 @@ void EditCurvesDialog::OnExport( wxCommandEvent & WXUNUSED(event))
|
|||
{
|
||||
FileDialogWrapper filePicker(this, XO("Export EQ curves as..."),
|
||||
FileNames::DataDir(), wxT(""),
|
||||
XMLtypes,
|
||||
XMLtypes(),
|
||||
wxFD_SAVE | wxFD_OVERWRITE_PROMPT | wxRESIZE_BORDER); // wxFD_CHANGE_DIR?
|
||||
wxString fileName;
|
||||
if( filePicker.ShowModal() == wxID_CANCEL)
|
||||
|
|
|
@ -2278,8 +2278,11 @@ void ExportFFmpegOptions::OnLoadPreset(wxCommandEvent& WXUNUSED(event))
|
|||
DoOnCodecList();
|
||||
}
|
||||
|
||||
static const FileNames::FileTypes FileTypes{
|
||||
FileNames::XMLFiles, FileNames::AllFiles
|
||||
static const FileNames::FileTypes &FileTypes()
|
||||
{
|
||||
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"),
|
||||
gPrefs->Read(wxT("/FileFormats/FFmpegPresetDir")),
|
||||
wxEmptyString,
|
||||
FileTypes,
|
||||
FileTypes(),
|
||||
wxFD_OPEN);
|
||||
if (dlg.ShowModal() == wxID_CANCEL) return;
|
||||
path = dlg.GetPath();
|
||||
|
@ -2324,7 +2327,7 @@ void ExportFFmpegOptions::OnExportPresets(wxCommandEvent& WXUNUSED(event))
|
|||
XO("Select xml file to export presets into"),
|
||||
gPrefs->Read(wxT("/FileFormats/FFmpegPresetDir")),
|
||||
wxEmptyString,
|
||||
FileTypes,
|
||||
FileTypes(),
|
||||
wxFD_SAVE|wxFD_OVERWRITE_PROMPT);
|
||||
if (dlg.ShowModal() == wxID_CANCEL) return;
|
||||
path = dlg.GetPath();
|
||||
|
|
Loading…
Reference in New Issue