AssetExport: Notify parser failure

Change-Id: I76ed8b423c91b4ba3d5287153016ea6f1a820c8a
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
This commit is contained in:
Vikas Pachdha
2020-06-26 20:03:22 +02:00
parent cc7e542825
commit fbb1fb3bf2
2 changed files with 8 additions and 1 deletions

View File

@@ -25,6 +25,7 @@
#include "componentexporter.h"
#include "assetexporter.h"
#include "assetexportpluginconstants.h"
#include "exportnotification.h"
#include "parsers/modelnodeparser.h"
#include "model.h"
@@ -113,6 +114,9 @@ QJsonObject Component::nodeToJson(const ModelNode &node)
node.model()->rewriterView()->writeAuxiliaryData();
}
jsonObject = parser->json(*this);
} else {
ExportNotification::addError(tr("Error exporting component %1. Parser unavailable.")
.arg(node.id()));
}
QJsonArray children;

View File

@@ -24,8 +24,9 @@
****************************************************************************/
#pragma once
#include <QJsonObject>
#include <QByteArrayList>
#include <QCoreApplication>
#include <QJsonObject>
#include <memory>
@@ -67,6 +68,8 @@ protected:
class Component
{
Q_DECLARE_TR_FUNCTIONS(Component);
public:
Component(AssetExporter& exporter, const ModelNode &rootNode);