From a146cd9e2e22c2b7100cb3c635f1e7733e346daf Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Mon, 3 Aug 2020 08:44:34 +0200 Subject: [PATCH] JSON_SETTINGS: add more wxLogTrace() calls. --- common/settings/json_settings.cpp | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/common/settings/json_settings.cpp b/common/settings/json_settings.cpp index c3a39f832d..b4e98f0266 100644 --- a/common/settings/json_settings.cpp +++ b/common/settings/json_settings.cpp @@ -141,9 +141,21 @@ bool JSON_SETTINGS::LoadFromFile( const wxString& aDirectory ) if( backed_up ) { cfg.reset(); - wxCopyFile( temp.GetFullPath(), aPath.GetFullPath() ); - wxRemoveFile( temp.GetFullPath() ); - } + + if( !wxCopyFile( temp.GetFullPath(), aPath.GetFullPath() ) ) + { + wxLogTrace( traceSettings, + "migrate; copy temp file %s to %s failed", + temp.GetFullPath(), aPath.GetFullPath() ); + } + + if( !wxRemoveFile( temp.GetFullPath() ) ) + { + wxLogTrace( traceSettings, + "migrate; failed to remove temp file %s", + temp.GetFullPath() ); + } + } // Either way, we want to clean up the old file afterwards legacy_migrated = true;