Commit eef1de6c authored by Hugo Beauzee-Luyssen's avatar Hugo Beauzee-Luyssen

Adding support for WITH_CRASHHANDLER

parent cca9a321
......@@ -45,7 +45,8 @@ ENDIF(WIN32)
#SET (WITH_LIBVLC FALSE CACHE BOOL "Compile LibVLC in VLMC")
SET(WITH_CRASHBUTTON FALSE CACHE BOOL "Enable the crash button")
SET(WITH_CRASHHANDLER_GUI TRUE CACHE BOOL "Enable the crash handler GUI")
SET(WITH_CRASHHANDLER_GUI TRUE CACHE BOOL "Enable the crash handler GUI (with backtrace and restart capabilities)")
SET(WITH_CRASHHANDLER TRUE CACHE BOOL "Enable the crash handler")
FIND_PACKAGE(LIBVLC)
IF (NOT LIBVLC_FOUND)
......
#ifndef CONFIG_H
#define CONFIG_H
/* With crash handler */
/* With crash button (tools->crash) */
#cmakedefine WITH_CRASHBUTTON
/* With crash handler */
#cmakedefine WITH_CRASHHANDLER
/* With crash handler GUI */
#cmakedefine WITH_CRASHHANDLER_GUI
......
......@@ -21,9 +21,11 @@
*****************************************************************************/
#include "config.h"
#ifdef WITH_CRASHHANDLER_GUI
#include "CrashHandler.h"
#include "CrashHandler.h"
#endif
#include "Library.h"
#include "MainWorkflow.h"
#include "ProjectManager.h"
......@@ -38,6 +40,7 @@
#include <errno.h>
#include <signal.h>
#ifdef WITH_CRASHHANDLER
void ProjectManager::signalHandler( int sig )
{
signal( sig, SIG_DFL );
......@@ -51,6 +54,7 @@ void ProjectManager::signalHandler( int sig )
::exit( 1 );
#endif
}
#endif
const QString ProjectManager::unNamedProject = tr( "<Unnamed project>" );
const QString ProjectManager::unSavedProject = tr( "<Unsaved project>" );
......@@ -61,10 +65,12 @@ ProjectManager::ProjectManager() : m_projectFile( NULL ), m_needSave( false )
m_recentsProjects = s.value( "RecentsProjects" ).toStringList();
m_projectName = ProjectManager::unSavedProject;
#ifdef WITH_CRASHHANDLER
signal( SIGSEGV, ProjectManager::signalHandler );
signal( SIGFPE, ProjectManager::signalHandler );
signal( SIGABRT, ProjectManager::signalHandler );
signal( SIGILL, ProjectManager::signalHandler );
#endif
connect( this, SIGNAL( projectClosed() ), Library::getInstance(), SLOT( clear() ) );
connect( this, SIGNAL( projectClosed() ), MainWorkflow::getInstance(), SLOT( clear() ) );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment