aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorConfuSomu2023-06-10 19:20:20 -0400
committerConfuSomu2023-06-10 19:20:20 -0400
commitcb70783e64d3571dd1de7dd10da6529489c0e603 (patch)
tree178049d07fe05a513b3c45d8e23a5349340b7300 /src
parentda6afaedc1bce08ee78b3f8f780ab72ce1f54b6f (diff)
downloadActorViewer-cb70783e64d3571dd1de7dd10da6529489c0e603.tar
ActorViewer-cb70783e64d3571dd1de7dd10da6529489c0e603.tar.gz
ActorViewer-cb70783e64d3571dd1de7dd10da6529489c0e603.zip
Exit with exit codes depending on command line
Diffstat (limited to 'src')
-rw-r--r--src/mainwindow.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index 363dcc0..ec2026e 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -11,6 +11,7 @@
#include <QMimeData>
#include <QCommandLineParser>
#include <QMessageBox>
+#include <cstdlib>
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent)
@@ -27,13 +28,13 @@ MainWindow::~MainWindow()
void MainWindow::act_command_line(CommandLineParsedOptions &options, QCommandLineParser &parser) {
switch (options.result) {
case CommandLineError:
- QMessageBox::critical(this, tr("Command line"), tr("The passed command line is incorrect and will be ignored.\nMore information: %1").arg(options.error_message));
+ QMessageBox::critical(this, tr("Command line"), tr("The passed command line is incorrect and will be ignored.\nMore information: %1").arg(options.error_message)); exit(EXIT_FAILURE);
break;
case CommandLineHelpRequested:
- QMessageBox::information(this, QGuiApplication::applicationDisplayName(), "<pre>" + parser.helpText() + "</pre>"); exit(0);
+ QMessageBox::information(this, QGuiApplication::applicationDisplayName(), "<pre>" + parser.helpText() + "</pre>"); exit(EXIT_SUCCESS);
break;
case CommandLineVersionRequested:
- on_actionAbout_triggered(true); exit(0);
+ on_actionAbout_triggered(true); exit(EXIT_SUCCESS);
break;
case CommandLineOk:
if (!options.outbox_filename.isEmpty())