From 68706c24c9803eafbf4c83f18f39677b2c922b86 Mon Sep 17 00:00:00 2001 From: Paul Licameli Date: Tue, 17 Oct 2017 20:53:46 -0400 Subject: [PATCH] Improve the message for exhaustion of file storage on Windows --- src/FileException.cpp | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/src/FileException.cpp b/src/FileException.cpp index 771318080..3810bbcc4 100644 --- a/src/FileException.cpp +++ b/src/FileException.cpp @@ -50,15 +50,24 @@ _("Audacity successfully wrote a file in %s but failed to rename it as %s."); default: break; } - wxString target = fileName.GetVolume(); - if (target.empty()) { - // Shorten the path, arbitrarily to 3 components - auto path = fileName; - path.SetFullName(wxString{}); - while(path.GetDirCount() > 3) - path.RemoveLastDir(); - target = path.GetFullPath(); - } + wxString target; + +#ifdef __WXMSW__ + + // Drive letter plus colon + target = fileName.GetVolume() + wxT(":"); + +#else + + // Shorten the path, arbitrarily to 3 components + auto path = fileName; + path.SetFullName(wxString{}); + while(path.GetDirCount() > 3) + path.RemoveLastDir(); + target = path.GetFullPath(); + +#endif + return wxString::Format( format, target, renameTarget.GetFullName() ); }