1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-07-31 07:59:27 +02:00

Improvements for non-win platforms, thanks to Leland.

EQDefaultCurves.xml should be in
    * Unix: prefix/share/appinfo
    * Windows: the directory where the executable file is located
    * Mac: appinfo.app/Contents/Resources bundle subdirectory
according to http://docs.wxwidgets.org/trunk/classwx_standard_paths.html#5514bf6288ee9f5a0acaf065762ad95d
I'm guessing that people making those releases should know what that means.  The Win one is already sorted.
This commit is contained in:
martynshaw99 2010-12-29 23:35:39 +00:00
parent 6b752e96dc
commit 7d7c00aa6a

View File

@ -983,9 +983,12 @@ void EqualizationDialog::LoadCurves(wxString fileName, bool append)
// look in data dir first, in case the user has their own defaults (maybe downloaded ones)
fn = wxFileName( FileNames::DataDir(), wxT("EQDefaultCurves.xml") );
if( !fn.FileExists() )
{ // Default file not found in the data dir. Fall back to exe dir.
wxFileName exePath(PlatformCompatibility::GetExecutablePath());
fn = wxFileName( exePath.GetPath(), wxT("EQDefaultCurves.xml") );
{ // Default file not found in the data dir. Fall back to Resources dir.
// See http://docs.wxwidgets.org/trunk/classwx_standard_paths.html#5514bf6288ee9f5a0acaf065762ad95d
static wxString resourcesDir;
wxStandardPaths std;
resourcesDir = std.GetResourcesDir();
fn = wxFileName( resourcesDir, wxT("EQDefaultCurves.xml") );
}
if( !fn.FileExists() )
{
@ -3238,7 +3241,6 @@ void EditCurvesDialog::OnDefaults( wxCommandEvent &event )
{
EQCurveArray temp;
temp = mParent->mCurves;
wxFileName exePath(PlatformCompatibility::GetExecutablePath());
// we expect this to fail in LoadCurves (due to a lack of path) and handle that there
mParent->LoadCurves( wxT("EQDefaultCurves.xml") );
mEditCurves = mParent->mCurves;