mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-07-31 11:20:22 +02:00
* Look for CrashReporter in local and global dirs.
This commit is contained in:
@@ -18,8 +18,11 @@
|
|||||||
|
|
||||||
#include "BreakPad.h"
|
#include "BreakPad.h"
|
||||||
|
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
#include <QCoreApplication>
|
#include <QCoreApplication>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
|
#include <QFileInfo>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#define CRASH_REPORTER_BINARY "CrashReporter"
|
#define CRASH_REPORTER_BINARY "CrashReporter"
|
||||||
@@ -38,8 +41,10 @@ LaunchUploader( const char* dump_dir, const char* minidump_id, void* that, bool
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
const char* crashReporter = static_cast<BreakPad*>(that)->crashReporter();
|
const char* crashReporter = static_cast<BreakPad*>(that)->crashReporter();
|
||||||
pid_t pid = fork();
|
if ( strlen( crashReporter ) == 0 )
|
||||||
|
return false;
|
||||||
|
|
||||||
|
pid_t pid = fork();
|
||||||
if ( pid == -1 ) // fork failed
|
if ( pid == -1 ) // fork failed
|
||||||
return false;
|
return false;
|
||||||
if ( pid == 0 )
|
if ( pid == 0 )
|
||||||
@@ -70,7 +75,14 @@ BreakPad::BreakPad( const QString& path )
|
|||||||
: google_breakpad::ExceptionHandler( path.toStdString(), 0, LaunchUploader, this, true, 0 )
|
: google_breakpad::ExceptionHandler( path.toStdString(), 0, LaunchUploader, this, true, 0 )
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
QString reporter = QString( "%1/%2" ).arg( qApp->applicationDirPath() ).arg( CRASH_REPORTER_BINARY );
|
QString reporter;
|
||||||
|
QString localReporter = QString( "%1/%2" ).arg( qApp->applicationDirPath() ).arg( CRASH_REPORTER_BINARY );
|
||||||
|
QString globalReporter = QString( "%1/%2" ).arg( CMAKE_INSTALL_LIBEXECDIR ).arg( CRASH_REPORTER_BINARY );
|
||||||
|
|
||||||
|
if ( QFileInfo( localReporter ).exists() )
|
||||||
|
reporter = localReporter;
|
||||||
|
else if ( QFileInfo( globalReporter ).exists() )
|
||||||
|
reporter = globalReporter;
|
||||||
|
|
||||||
char* creporter;
|
char* creporter;
|
||||||
std::string sreporter = reporter.toStdString();
|
std::string sreporter = reporter.toStdString();
|
||||||
|
Reference in New Issue
Block a user