mirror of
https://github.com/overte-org/overte.git
synced 2025-08-10 09:08:37 +02:00
fix version not being preserved
This commit is contained in:
parent
2a7ef5c5bb
commit
98a7e4e711
2 changed files with 6 additions and 10 deletions
|
@ -15,7 +15,6 @@
|
||||||
#include <QtCore/QEventLoop>
|
#include <QtCore/QEventLoop>
|
||||||
#include <QtCore/QFile>
|
#include <QtCore/QFile>
|
||||||
#include <QtCore/QFileInfo>
|
#include <QtCore/QFileInfo>
|
||||||
#include <QtCore/QJsonDocument>
|
|
||||||
#include <QtCore/QJsonObject>
|
#include <QtCore/QJsonObject>
|
||||||
|
|
||||||
#include "Gzip.h"
|
#include "Gzip.h"
|
||||||
|
@ -132,10 +131,10 @@ void DomainBaker::loadLocalFile() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// read the file contents to a JSON document
|
// read the file contents to a JSON document
|
||||||
auto jsonDocument = QJsonDocument::fromJson(fileContents);
|
_json = QJsonDocument::fromJson(fileContents);
|
||||||
|
|
||||||
// grab the entities object from the root JSON object
|
// grab the entities object from the root JSON object
|
||||||
_entities = jsonDocument.object()[ENTITIES_OBJECT_KEY].toArray();
|
_entities = _json.object()[ENTITIES_OBJECT_KEY].toArray();
|
||||||
|
|
||||||
if (_entities.isEmpty()) {
|
if (_entities.isEmpty()) {
|
||||||
// add an error to our list stating that the models file was empty
|
// add an error to our list stating that the models file was empty
|
||||||
|
@ -749,15 +748,10 @@ void DomainBaker::writeNewEntitiesFile() {
|
||||||
// time to write out a main models.json.gz file
|
// time to write out a main models.json.gz file
|
||||||
|
|
||||||
// first setup a document with the entities array below the entities key
|
// first setup a document with the entities array below the entities key
|
||||||
QJsonDocument entitiesDocument;
|
_json.object()[ENTITIES_OBJECT_KEY] = _entities;
|
||||||
|
|
||||||
QJsonObject rootObject;
|
|
||||||
rootObject[ENTITIES_OBJECT_KEY] = _entities;
|
|
||||||
|
|
||||||
entitiesDocument.setObject(rootObject);
|
|
||||||
|
|
||||||
// turn that QJsonDocument into a byte array ready for compression
|
// turn that QJsonDocument into a byte array ready for compression
|
||||||
QByteArray jsonByteArray = entitiesDocument.toJson();
|
QByteArray jsonByteArray = _json.toJson();
|
||||||
|
|
||||||
// compress the json byte array using gzip
|
// compress the json byte array using gzip
|
||||||
QByteArray compressedJson;
|
QByteArray compressedJson;
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
#ifndef hifi_DomainBaker_h
|
#ifndef hifi_DomainBaker_h
|
||||||
#define hifi_DomainBaker_h
|
#define hifi_DomainBaker_h
|
||||||
|
|
||||||
|
#include <QtCore/QJsonDocument>
|
||||||
#include <QtCore/QJsonArray>
|
#include <QtCore/QJsonArray>
|
||||||
#include <QtCore/QObject>
|
#include <QtCore/QObject>
|
||||||
#include <QtCore/QUrl>
|
#include <QtCore/QUrl>
|
||||||
|
@ -59,6 +60,7 @@ private:
|
||||||
QString _originalOutputPath;
|
QString _originalOutputPath;
|
||||||
QUrl _destinationPath;
|
QUrl _destinationPath;
|
||||||
|
|
||||||
|
QJsonDocument _json;
|
||||||
QJsonArray _entities;
|
QJsonArray _entities;
|
||||||
|
|
||||||
QHash<QUrl, QSharedPointer<ModelBaker>> _modelBakers;
|
QHash<QUrl, QSharedPointer<ModelBaker>> _modelBakers;
|
||||||
|
|
Loading…
Reference in a new issue