mirror of
https://github.com/AleziaKurdis/overte.git
synced 2025-04-16 07:39:11 +02:00
Fix baker CLI not correctly exiting on failure
We previusly were exiting while still inside of the QApplication ctor, before the event loop had been started. This fixes that by queueing up the baking to occur after the ctor has completed.
This commit is contained in:
parent
6ed89fb9cc
commit
5448099a93
3 changed files with 6 additions and 1 deletions
|
@ -63,6 +63,7 @@ void BakerCLI::bakeFile(QUrl inputUrl, const QString& outputPath, const QString&
|
|||
} else {
|
||||
qCDebug(model_baking) << "Failed to determine baker type for file" << inputUrl;
|
||||
QCoreApplication::exit(OVEN_STATUS_CODE_FAIL);
|
||||
return;
|
||||
}
|
||||
|
||||
// invoke the bake method on the baker thread
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
|
||||
#include <QtCore/QObject>
|
||||
#include <QDir>
|
||||
#include <QUrl>
|
||||
|
||||
#include <memory>
|
||||
|
||||
|
@ -31,6 +32,8 @@ class BakerCLI : public QObject {
|
|||
|
||||
public:
|
||||
BakerCLI(OvenCLIApplication* parent);
|
||||
|
||||
public slots:
|
||||
void bakeFile(QUrl inputUrl, const QString& outputPath, const QString& type = QString::null);
|
||||
|
||||
private slots:
|
||||
|
|
|
@ -40,7 +40,8 @@ OvenCLIApplication::OvenCLIApplication(int argc, char* argv[]) :
|
|||
QUrl inputUrl(QDir::fromNativeSeparators(parser.value(CLI_INPUT_PARAMETER)));
|
||||
QUrl outputUrl(QDir::fromNativeSeparators(parser.value(CLI_OUTPUT_PARAMETER)));
|
||||
QString type = parser.isSet(CLI_TYPE_PARAMETER) ? parser.value(CLI_TYPE_PARAMETER) : QString::null;
|
||||
cli->bakeFile(inputUrl, outputUrl.toString(), type);
|
||||
QMetaObject::invokeMethod(cli, "bakeFile", Qt::QueuedConnection, Q_ARG(QUrl, inputUrl),
|
||||
Q_ARG(QString, outputUrl.toString()), Q_ARG(QString, type));
|
||||
} else {
|
||||
parser.showHelp();
|
||||
QCoreApplication::quit();
|
||||
|
|
Loading…
Reference in a new issue