From 7e9eede5dcbc886685e146b36f507e962359e4d0 Mon Sep 17 00:00:00 2001 From: Pulak Malhotra <56169176+PulakIIIT@users.noreply.github.com> Date: Thu, 5 Aug 2021 17:31:53 +0530 Subject: [PATCH] Exporting types work now --- src/core/Cutter.cpp | 2 +- src/widgets/TypesWidget.cpp | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/core/Cutter.cpp b/src/core/Cutter.cpp index 57cd7242..bc813792 100644 --- a/src/core/Cutter.cpp +++ b/src/core/Cutter.cpp @@ -3545,7 +3545,7 @@ QList CutterCore::getAllPrimitiveTypes() exp.type = typeObject[RJsonKey::type].toString(); exp.size = (int)typeObject[RJsonKey::size].toVariant().toULongLong(); - exp.category = tr("Primitive"); + exp.category = "Primitive"; primitiveTypes << exp; } diff --git a/src/widgets/TypesWidget.cpp b/src/widgets/TypesWidget.cpp index 91cf9551..1687f205 100644 --- a/src/widgets/TypesWidget.cpp +++ b/src/widgets/TypesWidget.cpp @@ -275,7 +275,12 @@ void TypesWidget::on_actionExport_Types_triggered() return; } QTextStream fileOut(&file); - fileOut << Core()->cmdRaw("tc"); + for (const auto &type : types) { + if (type.category == "Primitive"){ + continue; + } + fileOut << Core()->getTypeAsC(type.type, type.category) << "\n"; + } file.close(); }