More fixes around Python exit codes

This commit is contained in:
Ian Rees
2016-03-27 13:01:04 +13:00
parent b86e14afff
commit bc71c6e64b
5 changed files with 23 additions and 20 deletions

View File

@@ -54,14 +54,13 @@
#include <Base/Console.h>
#include <Base/Exception.h>
#include <Base/Interpreter.h>
#include <App/Application.h>
using namespace Gui;
GUIApplication::GUIApplication(int & argc, char ** argv, int exitcode)
: GUIApplicationNativeEventAware(argc, argv), systemExit(exitcode)
GUIApplication::GUIApplication(int & argc, char ** argv)
: GUIApplicationNativeEventAware(argc, argv)
{
}
@@ -82,8 +81,9 @@ bool GUIApplication::notify (QObject * receiver, QEvent * event)
else
return QApplication::notify(receiver, event);
}
catch (const Base::SystemExitException&) {
qApp->exit(systemExit);
catch (const Base::SystemExitException &e) {
caughtException.reset(new Base::SystemExitException(e));
qApp->exit(e.getExitCode());
return true;
}
catch (const Base::Exception& e) {
@@ -225,8 +225,8 @@ public:
bool running;
};
GUISingleApplication::GUISingleApplication(int & argc, char ** argv, int exitcode)
: GUIApplication(argc, argv, exitcode),
GUISingleApplication::GUISingleApplication(int & argc, char ** argv)
: GUIApplication(argc, argv),
d_ptr(new Private(this))
{
d_ptr->setupConnection();