Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
VideoLAN
VLMC
Commits
051fa09b
Commit
051fa09b
authored
Mar 31, 2010
by
Hugo Beauzee-Luyssen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Unix Crash handling: Moving stuff to a more appropriate place
parent
64ed8cfe
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
39 deletions
+37
-39
src/Main/vlmc.cpp
src/Main/vlmc.cpp
+36
-0
src/Project/ProjectManager.cpp
src/Project/ProjectManager.cpp
+0
-36
src/Project/ProjectManager.h
src/Project/ProjectManager.h
+1
-3
No files found.
src/Main/vlmc.cpp
View file @
051fa09b
...
...
@@ -29,6 +29,36 @@
int
VLMCmain
(
int
,
char
**
);
#if defined(WITH_CRASHHANDLER) && defined(Q_OS_UNIX)
# ifdef WITH_GUI
# include "project/GuiProjectManager.h"
# ifdef WITH_CRASHHANDLER_GUI
# include "CrashHandler.h"
# endif
# else
# include "ProjectManager.h"
#endif
void
signalHandler
(
int
sig
)
{
signal
(
sig
,
SIG_DFL
);
#ifdef WITH_GUI
GUIProjectManager
::
getInstance
()
->
emergencyBackup
();
#else
ProjectManager
::
getInstance
()
->
emergencyBackup
();
#endif
#ifdef WITH_CRASHHANDLER_GUI
CrashHandler
*
ch
=
new
CrashHandler
(
sig
);
::
exit
(
ch
->
exec
()
);
#else
::
exit
(
1
);
#endif
}
#endif
int
main
(
int
argc
,
char
**
argv
)
{
#ifdef WITH_CRASHHANDLER
...
...
@@ -38,7 +68,13 @@ int main( int argc, char **argv )
if
(
pid
<
0
)
qFatal
(
"Can't fork to launch VLMC. Exiting."
);
if
(
pid
==
0
)
{
signal
(
SIGSEGV
,
signalHandler
);
signal
(
SIGFPE
,
signalHandler
);
signal
(
SIGABRT
,
signalHandler
);
signal
(
SIGILL
,
signalHandler
);
return
VLMCmain
(
argc
,
argv
);
}
else
{
int
status
;
...
...
src/Project/ProjectManager.cpp
View file @
051fa09b
...
...
@@ -22,15 +22,6 @@
#include "config.h"
#ifdef WITH_GUI
# ifdef WITH_CRASHHANDLER_GUI
# include "CrashHandler.h"
# endif
#else
//We shouldn't have to do this.
#undef WITH_CRASHHANDLER_GUI
#endif
#include "Library.h"
#include "MainWorkflow.h"
#include "project/GuiProjectManager.h"
...
...
@@ -45,26 +36,6 @@
#include <errno.h>
#include <signal.h>
#ifdef WITH_CRASHHANDLER
void
ProjectManager
::
signalHandler
(
int
sig
)
{
signal
(
sig
,
SIG_DFL
);
#ifdef WITH_GUI
GUIProjectManager
::
getInstance
()
->
emergencyBackup
();
#else
ProjectManager
::
getInstance
()
->
emergencyBackup
();
#endif
#ifdef WITH_CRASHHANDLER_GUI
CrashHandler
*
ch
=
new
CrashHandler
(
sig
);
::
exit
(
ch
->
exec
()
);
#else
::
exit
(
1
);
#endif
}
#endif
const
QString
ProjectManager
::
unNamedProject
=
tr
(
"<Unnamed project>"
);
const
QString
ProjectManager
::
unSavedProject
=
tr
(
"<Unsaved project>"
);
...
...
@@ -73,13 +44,6 @@ ProjectManager::ProjectManager() : m_projectFile( NULL ), m_needSave( false )
QSettings
s
;
m_recentsProjects
=
s
.
value
(
"RecentsProjects"
).
toStringList
();
#ifdef WITH_CRASHHANDLER
signal
(
SIGSEGV
,
ProjectManager
::
signalHandler
);
signal
(
SIGFPE
,
ProjectManager
::
signalHandler
);
signal
(
SIGABRT
,
ProjectManager
::
signalHandler
);
signal
(
SIGILL
,
ProjectManager
::
signalHandler
);
#endif
VLMC_CREATE_PROJECT_DOUBLE
(
"video/VLMCOutputFPS"
,
29.97
,
"Output video FPS"
,
"Frame Per Second used when previewing and rendering the project"
);
VLMC_CREATE_PROJECT_INT
(
"video/VideoProjectWidth"
,
480
,
"Video width"
,
"Width resolution of the output video"
);
VLMC_CREATE_PROJECT_INT
(
"video/VideoProjectHeight"
,
300
,
"Video height"
,
"Height resolution of the output video"
);
...
...
src/Project/ProjectManager.h
View file @
051fa09b
...
...
@@ -50,8 +50,7 @@ public:
virtual
bool
closeProject
();
virtual
void
saveProject
(
bool
saveAs
=
false
);
bool
loadEmergencyBackup
();
static
void
signalHandler
(
int
sig
);
void
emergencyBackup
();
protected:
/**
...
...
@@ -59,7 +58,6 @@ protected:
* It's only purpose it to write the project for very specific cases.
*/
void
__saveProject
(
const
QString
&
fileName
);
void
emergencyBackup
();
static
bool
isBackupFile
(
const
QString
&
projectFile
);
void
appendToRecentProject
(
const
QString
&
projectName
);
/**
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment