Update of /cvsroot/audacity/audacity-src/src
In directory sc8-pr-cvs11.sourceforge.net:/tmp/cvs-serv29184
Modified Files:
AudacityApp.cpp FileNames.cpp
Log Message:
Make compatible with wx2.8's nasty wxFileName changes
Index: FileNames.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/FileNames.cpp,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- FileNames.cpp 7 Feb 2007 13:22:52 -0000 1.11
+++ FileNames.cpp 15 Apr 2007 12:29:11 -0000 1.12
@@ -34,16 +34,12 @@
wxString FileNames::MkDir(const wxString &Str)
{
- wxFileName fn = Str;
-
- // If the directory doesn't exist...
- if( !fn.DirExists() )
- {
- // Attempt to create it
- fn.Mkdir( fn.GetFullPath(), 511, wxPATH_MKDIR_FULL );
- }
+ // Behaviour of wxFileName::DirExists() and wxFileName::MkDir() has
+ // changed between wx2.6 and wx2.8, so we use static functions instead.
+ if (!wxFileName::DirExists(Str))
+ wxFileName::Mkdir(Str, 511, wxPATH_MKDIR_FULL);
- return fn.GetFullPath();
+ return Str;
}
/// Returns the directory used for temp files.
@@ -82,11 +78,14 @@
} else
{
// Use OS-provided user data dir folder
+ wxString dataDir;
#if defined( __WXGTK__ )
- gDataDir = FileNames::MkDir( wxStandardPaths::Get().GetUserDataDir()
+ wxT("-data") );
+ dataDir = wxStandardPaths::Get().GetUserDataDir() + wxT("-data");
#else
- gDataDir = FileNames::MkDir( wxStandardPaths::Get().GetUserDataDir()
);
+ dataDir = wxStandardPaths::Get().GetUserDataDir();
#endif
+
+ gDataDir = FileNames::MkDir(dataDir);
}
}
Index: AudacityApp.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/AudacityApp.cpp,v
retrieving revision 1.169
retrieving revision 1.170
diff -u -d -r1.169 -r1.170
--- AudacityApp.cpp 14 Apr 2007 10:07:53 -0000 1.169
+++ AudacityApp.cpp 15 Apr 2007 12:29:11 -0000 1.170
@@ -899,15 +899,12 @@
presetsFromPrefs = wxT("");
#endif
- #ifdef __WXMSW__
- wxString presetsDefaultLoc = userdatadir + wxT("\\presets");
- #else
- wxString presetsDefaultLoc = userdatadir + wxT("/presets");
- #endif
+ wxString presetsDefaultLoc =
+ wxFileName(userdatadir, wxT("presets")).GetFullPath();
// Stop wxWindows from printing its own error messages (not used ... does
this really do anything?)
wxLogNull logNo;
-
+
// Try temp dir that was stored in prefs first
if (presetsFromPrefs != wxT("")) {
if (wxDirExists(presetsFromPrefs))
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Audacity-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/audacity-cvs