mirror of
https://github.com/cookiengineer/audacity
synced 2025-11-21 16:37:12 +01:00
Bug 1220 - OS X: Audacity's temp dir defaults to location that is cleaned up on reboot
Untested on Mac (I don't have one). Might perhaps even fail to compile. But 1220 is a P1. Important enough for our schedule that we clear it now that I am happy enough to risk a 'blind patch'.
This commit is contained in:
@@ -1260,10 +1260,19 @@ bool AudacityApp::OnInit()
|
|||||||
|
|
||||||
#endif //__WXGTK__
|
#endif //__WXGTK__
|
||||||
|
|
||||||
|
// JKC Bug 1220: Use path based on home directory on WXMAC
|
||||||
|
#ifdef __WXMAC__
|
||||||
|
wxFileName tmpFile;
|
||||||
|
tmpFile.AssignHomeDir();
|
||||||
|
wxString tmpDirLoc = tmpFile.GetPath(wxPATH_GET_VOLUME);
|
||||||
|
#else
|
||||||
wxFileName tmpFile;
|
wxFileName tmpFile;
|
||||||
tmpFile.AssignTempFileName(wxT("nn"));
|
tmpFile.AssignTempFileName(wxT("nn"));
|
||||||
wxString tmpDirLoc = tmpFile.GetPath(wxPATH_GET_VOLUME);
|
wxString tmpDirLoc = tmpFile.GetPath(wxPATH_GET_VOLUME);
|
||||||
::wxRemoveFile(tmpFile.GetFullPath());
|
::wxRemoveFile(tmpFile.GetFullPath());
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// On Mac and Windows systems, use the directory which contains Audacity.
|
// On Mac and Windows systems, use the directory which contains Audacity.
|
||||||
#ifdef __WXMSW__
|
#ifdef __WXMSW__
|
||||||
@@ -1291,9 +1300,14 @@ bool AudacityApp::OnInit()
|
|||||||
AddUniquePathToPathList(progPath + wxT("/../"), audacityPathList);
|
AddUniquePathToPathList(progPath + wxT("/../"), audacityPathList);
|
||||||
AddUniquePathToPathList(progPath + wxT("/../Resources"), audacityPathList);
|
AddUniquePathToPathList(progPath + wxT("/../Resources"), audacityPathList);
|
||||||
|
|
||||||
defaultTempDir.Printf(wxT("%s/audacity-%s"),
|
// JKC Bug 1220: Using an actual temp directory for session data on Mac was
|
||||||
tmpDirLoc.c_str(),
|
// wrong because it would get cleared out on a reboot.
|
||||||
wxGetUserId().c_str());
|
defaultTempDir.Printf(wxT("%s/Library/Application/Support/audacity/SessionData"),
|
||||||
|
tmpDirLoc.c_str());
|
||||||
|
|
||||||
|
//defaultTempDir.Printf(wxT("%s/audacity-%s"),
|
||||||
|
// tmpDirLoc.c_str(),
|
||||||
|
// wxGetUserId().c_str());
|
||||||
#endif //__WXMAC__
|
#endif //__WXMAC__
|
||||||
|
|
||||||
// Define languanges for which we have translations, but that are not yet
|
// Define languanges for which we have translations, but that are not yet
|
||||||
|
|||||||
@@ -148,7 +148,7 @@ void DirectoriesPrefs::OnChooseTempDir(wxCommandEvent & e)
|
|||||||
// already)
|
// already)
|
||||||
wxString newDirName;
|
wxString newDirName;
|
||||||
#if defined(__WXMAC__)
|
#if defined(__WXMAC__)
|
||||||
newDirName = wxT("audacity_temp");
|
newDirName = wxT("SessionData");
|
||||||
#elif defined(__WXMSW__)
|
#elif defined(__WXMSW__)
|
||||||
// Clearing Bug 1271 residual issue. Let's NOT have temp in the name.
|
// Clearing Bug 1271 residual issue. Let's NOT have temp in the name.
|
||||||
// [Arguably we should do this for all platforms, not just Windows
|
// [Arguably we should do this for all platforms, not just Windows
|
||||||
|
|||||||
Reference in New Issue
Block a user