mirror of
https://github.com/cookiengineer/audacity
synced 2025-12-04 15:50:10 +01:00
Fix disk space checking to prevent error message
The error message only happens in debug builds, but the cause of the message still happens in release builds. Basically, the temporary project directory may not yet be created if the person is only monitoring.
This commit is contained in:
@@ -537,14 +537,21 @@ wxString DirManager::GetProjectName()
|
||||
wxLongLong DirManager::GetFreeDiskSpace()
|
||||
{
|
||||
wxLongLong freeSpace = -1;
|
||||
wxString path = projPath;
|
||||
wxFileName path;
|
||||
|
||||
if (projPath == wxT(""))
|
||||
path = mytemp;
|
||||
path.SetPath(projPath.IsEmpty() ? mytemp : projPath);
|
||||
|
||||
// Use the parent directory if the project directory hasn't yet been created
|
||||
if (!path.DirExists())
|
||||
{
|
||||
if (!wxGetDiskSpace(path, NULL, &freeSpace))
|
||||
freeSpace = -1;
|
||||
path.RemoveLastDir();
|
||||
}
|
||||
|
||||
if (!wxGetDiskSpace(path.GetFullPath(), NULL, &freeSpace))
|
||||
{
|
||||
freeSpace = -1;
|
||||
}
|
||||
|
||||
return freeSpace;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user