From 252dba93120da45233550b7459977e68c44badd9 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 125c8c15..7bdb698b 100644 --- a/src/core/Cutter.cpp +++ b/src/core/Cutter.cpp @@ -3601,7 +3601,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(); }