do not add files in wxDebugReport::AddFile if copy failed

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65101 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Francesco Montorsi
2010-07-25 11:26:04 +00:00
parent b2025b311a
commit c02f03d563
2 changed files with 9 additions and 5 deletions

View File

@@ -220,9 +220,11 @@ public:
/** /**
Add another file to the report. If @a filename is an absolute path, it Add another file to the report. If @a filename is an absolute path, it
is copied to a file in the debug report directory with the same name. is copied to a file in the debug report directory with the same name.
Otherwise the file should already exist in this directory Otherwise the file will be searched in the temporary directory returned
@a description only exists to be displayed to the user in the report by GetDirectory().
summary shown by wxDebugReportPreview.
The argument @a description only exists to be displayed to the user in
the report summary shown by wxDebugReportPreview.
@see GetDirectory(), AddText() @see GetDirectory(), AddText()
*/ */

View File

@@ -268,8 +268,10 @@ wxDebugReport::AddFile(const wxString& filename, const wxString& description)
// we need to copy the file to the debug report directory: give it the // we need to copy the file to the debug report directory: give it the
// same name there // same name there
name = fn.GetFullName(); name = fn.GetFullName();
wxCopyFile(fn.GetFullPath(),
wxFileName(GetDirectory(), name).GetFullPath()); if (!wxCopyFile(fn.GetFullPath(),
wxFileName(GetDirectory(), name).GetFullPath()))
return;
} }
else // file relative to the report directory else // file relative to the report directory
{ {