mirror of
				https://github.com/cookiengineer/audacity
				synced 2025-11-04 08:04:06 +01:00 
			
		
		
		
	Bug 2610 - Backup Project only fails when it has actually run out of disk space (unlike Save Project)
This may not be a complete fix...needs more testing.
This commit is contained in:
		@@ -292,6 +292,25 @@ bool ProjectFileManager::DoSave(const FilePath & fileName, const bool fromSaveAs
 | 
				
			|||||||
            }
 | 
					            }
 | 
				
			||||||
         }
 | 
					         }
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      wxULongLong fileSize = wxFileName::GetSize(projectFileIO.GetFileName());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      wxDiskspaceSize_t freeSpace;
 | 
				
			||||||
 | 
					      if (wxGetDiskSpace(FileNames::AbbreviatePath(fileName), NULL, &freeSpace))
 | 
				
			||||||
 | 
					      {
 | 
				
			||||||
 | 
					         if (freeSpace.GetValue() <= fileSize.GetValue())
 | 
				
			||||||
 | 
					         {
 | 
				
			||||||
 | 
					            ShowErrorDialog(
 | 
				
			||||||
 | 
					               &window,
 | 
				
			||||||
 | 
					               XO("Insufficient Disk Space"),
 | 
				
			||||||
 | 
					               XO("The project size exceeds the available free space on the target disk.\n\n"
 | 
				
			||||||
 | 
					                  "Please select a different disk with more free space."),
 | 
				
			||||||
 | 
					               "Error:_Disk_full_or_not_writable"
 | 
				
			||||||
 | 
					               );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            return false;
 | 
				
			||||||
 | 
					         }
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
   }
 | 
					   }
 | 
				
			||||||
   // End of confirmations
 | 
					   // End of confirmations
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -614,9 +633,28 @@ bool ProjectFileManager::SaveCopy(const FilePath &fileName /* = wxT("") */)
 | 
				
			|||||||
         continue;
 | 
					         continue;
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      wxULongLong fileSize = wxFileName::GetSize(projectFileIO.GetFileName());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      wxDiskspaceSize_t freeSpace;
 | 
				
			||||||
 | 
					      if (wxGetDiskSpace(FileNames::AbbreviatePath(filename.GetFullPath()), NULL, &freeSpace))
 | 
				
			||||||
 | 
					      {
 | 
				
			||||||
 | 
					         if (freeSpace.GetValue() <= fileSize.GetValue())
 | 
				
			||||||
 | 
					         {
 | 
				
			||||||
 | 
					            ShowErrorDialog(
 | 
				
			||||||
 | 
					               &window,
 | 
				
			||||||
 | 
					               XO("Insufficient Disk Space"),
 | 
				
			||||||
 | 
					               XO("The project size exceeds the available free space on the target disk.\n\n"
 | 
				
			||||||
 | 
					                  "Please select a different disk with more free space."),
 | 
				
			||||||
 | 
					               "Error:_Unsuitable_drive"
 | 
				
			||||||
 | 
					               );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            continue;
 | 
				
			||||||
 | 
					         }
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      if (FileNames::IsOnFATFileSystem(filename.GetFullPath()))
 | 
					      if (FileNames::IsOnFATFileSystem(filename.GetFullPath()))
 | 
				
			||||||
      {
 | 
					      {
 | 
				
			||||||
         if (wxFileName::GetSize(projectFileIO.GetFileName()) > UINT32_MAX)
 | 
					         if (fileSize > UINT32_MAX)
 | 
				
			||||||
         {
 | 
					         {
 | 
				
			||||||
            ShowErrorDialog(
 | 
					            ShowErrorDialog(
 | 
				
			||||||
               &window,
 | 
					               &window,
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user