From 7d7c00aa6a85c7dc38f0030480f3165a2895d7a3 Mon Sep 17 00:00:00 2001 From: martynshaw99 Date: Wed, 29 Dec 2010 23:35:39 +0000 Subject: [PATCH] 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. --- src/effects/Equalization.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/effects/Equalization.cpp b/src/effects/Equalization.cpp index ac1a70d4d..993c289aa 100644 --- a/src/effects/Equalization.cpp +++ b/src/effects/Equalization.cpp @@ -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;