mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-07-25 12:04:23 +02:00
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.
47 lines
1,008 B
C++
47 lines
1,008 B
C++
//
|
|
// BakerCLI.h
|
|
// tools/oven/src
|
|
//
|
|
// Created by Robbie Uvanni on 6/6/17.
|
|
// Copyright 2017 High Fidelity, Inc.
|
|
//
|
|
// Distributed under the Apache License, Version 2.0.
|
|
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
|
//
|
|
|
|
#ifndef hifi_BakerCLI_h
|
|
#define hifi_BakerCLI_h
|
|
|
|
#include <QtCore/QObject>
|
|
#include <QDir>
|
|
#include <QUrl>
|
|
|
|
#include <memory>
|
|
|
|
#include "Baker.h"
|
|
#include "OvenCLIApplication.h"
|
|
|
|
static const int OVEN_STATUS_CODE_SUCCESS { 0 };
|
|
static const int OVEN_STATUS_CODE_FAIL { 1 };
|
|
static const int OVEN_STATUS_CODE_ABORT { 2 };
|
|
|
|
static const QString OVEN_ERROR_FILENAME = "errors.txt";
|
|
|
|
class BakerCLI : public QObject {
|
|
Q_OBJECT
|
|
|
|
public:
|
|
BakerCLI(OvenCLIApplication* parent);
|
|
|
|
public slots:
|
|
void bakeFile(QUrl inputUrl, const QString& outputPath, const QString& type = QString::null);
|
|
|
|
private slots:
|
|
void handleFinishedBaker();
|
|
|
|
private:
|
|
QDir _outputPath;
|
|
std::unique_ptr<Baker> _baker;
|
|
};
|
|
|
|
#endif // hifi_BakerCLI_h
|