mirror of
https://github.com/cookiengineer/audacity
synced 2025-10-20 17:41:13 +02:00
Crashreporting
This commit is contained in:
51
crashreports/BreakpadConfigurer.cpp
Normal file
51
crashreports/BreakpadConfigurer.cpp
Normal file
@@ -0,0 +1,51 @@
|
||||
/*!********************************************************************
|
||||
*
|
||||
Audacity: A Digital Audio Editor
|
||||
|
||||
BreakpadConfigurer.cpp
|
||||
|
||||
Vitaly Sverchinsky
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
#include "BreakpadConfigurer.h"
|
||||
|
||||
#if defined(WIN32)
|
||||
#include "internal/win32/CrashReportContext.h"
|
||||
#else
|
||||
#include "internal/unix/CrashReportContext.h"
|
||||
#endif
|
||||
|
||||
BreakpadConfigurer& BreakpadConfigurer::SetDatabasePathUTF8(const std::string& pathUTF8)
|
||||
{
|
||||
mDatabasePathUTF8 = pathUTF8;
|
||||
return *this;
|
||||
}
|
||||
|
||||
BreakpadConfigurer& BreakpadConfigurer::SetReportURL(const std::string& reportURL)
|
||||
{
|
||||
mReportURL = reportURL;
|
||||
return *this;
|
||||
}
|
||||
|
||||
BreakpadConfigurer& BreakpadConfigurer::SetParameters(const std::map<std::string, std::string>& parameters)
|
||||
{
|
||||
mParameters = parameters;
|
||||
return *this;
|
||||
}
|
||||
|
||||
BreakpadConfigurer& BreakpadConfigurer::SetSenderPathUTF8(const std::string& pathUTF8)
|
||||
{
|
||||
mSenderPathUTF8 = pathUTF8;
|
||||
return *this;
|
||||
}
|
||||
|
||||
void BreakpadConfigurer::Start()
|
||||
{
|
||||
static CrashReportContext context{};
|
||||
bool ok = context.SetSenderPathUTF8(mSenderPathUTF8);
|
||||
ok = ok && context.SetReportURL(mReportURL);
|
||||
ok = ok && context.SetParameters(mParameters);
|
||||
if (ok)
|
||||
context.StartHandler(mDatabasePathUTF8);
|
||||
}
|
||||
Reference in New Issue
Block a user