#include "wx/app.h"
#include "wx/log.h"
#include "wx/intl.h"
+ #include "wx/utils.h"
#endif // WX_PRECOMP
#if wxUSE_DEBUGREPORT
static inline void
HexProperty(wxXmlNode *node, const wxChar *name, unsigned long value)
{
- node->AddProperty(name, wxString::Format(_T("%08x"), value));
+ node->AddProperty(name, wxString::Format(_T("%08lx"), value));
}
static inline void
static inline void
HexElement(wxXmlNode *node, const wxChar *name, unsigned long value)
{
- TextElement(node, name, wxString::Format(_T("%08x"), value));
+ TextElement(node, name, wxString::Format(_T("%08lx"), value));
}
#if wxUSE_STACKWALKER
wxDebugReport::wxDebugReport()
{
// get a temporary directory name
- wxString appname(wxTheApp ? wxTheApp->GetAppName() : _T("wx"));
+ wxString appname = GetReportName();
// we can't use CreateTempFileName() because it creates a file, not a
// directory, so do our best to create a unique name ourselves
wxFileName fn;
fn.AssignTempFileName(appname);
m_dir.Printf(_T("%s%c%s_dbgrpt-%lu-%s"),
- fn.GetPath(), wxFILE_SEP_PATH, appname.c_str(),
+ fn.GetPath().c_str(), wxFILE_SEP_PATH, appname.c_str(),
wxGetProcessId(),
wxDateTime::Now().Format(_T("%Y%m%dT%H%M%S")).c_str());
if ( !m_dir.empty() )
{
- if ( wxRmDir(m_dir) != 0 )
+ if ( wxRmDir(m_dir.fn_str()) != 0 )
{
wxLogSysError(_("Failed to clean up debug report directory \"%s\""),
m_dir.c_str());
wxString wxDebugReport::GetReportName() const
{
- return wxString(wxTheApp ? wxTheApp->GetAppName() : _T("wx"));
+ if(wxTheApp)
+ return wxTheApp->GetAppName();
+
+ return _T("wx");
}
void wxDebugReport::AddFile(const wxString& name, const wxString& description)
#if wxUSE_CRASHREPORT
AddDump(context);
#endif // wxUSE_CRASHREPORT
+
+#if !wxUSE_STACKWALKER && !wxUSE_CRASHREPORT
+ wxUnusedVar(context);
+#endif
}
// ----------------------------------------------------------------------------
if ( !zos.PutNextEntry(ze) )
return false;
- wxFFileInputStream is(wxFileName(fn.GetPath(), name).GetFullPath());
+ wxFileName filename(fn.GetPath(), name);
+ wxFFileInputStream is(filename.GetFullPath());
if ( !is.IsOk() || !zos.Write(is).IsOk() )
return false;
}