# HG changeset patch # User Teemu Piippo # Date 1524671715 -10800 # Node ID 4c134708be050bdf3a29701235e4ce20d844a7e2 # Parent 2e7ffaf6239f1eaec74b9d07a9d810db954680f0 some fixes diff -r 2e7ffaf6239f -r 4c134708be05 src/lddocument.cpp --- a/src/lddocument.cpp Thu Apr 05 22:56:37 2018 +0300 +++ b/src/lddocument.cpp Wed Apr 25 18:55:15 2018 +0300 @@ -450,6 +450,7 @@ { if (m_needsRecache) { + this->m_polygonData.clear(); Model model {m_documents}; this->inlineContents(model, true, true); diff -r 2e7ffaf6239f -r 4c134708be05 src/widgets/headeredit.cpp --- a/src/widgets/headeredit.cpp Thu Apr 05 22:56:37 2018 +0300 +++ b/src/widgets/headeredit.cpp Wed Apr 25 18:55:15 2018 +0300 @@ -18,6 +18,7 @@ #include "headeredit.h" #include "ui_headeredit.h" +#include "parser.h" #include "../lddocument.h" #include "../headerhistorymodel.h" @@ -36,6 +37,14 @@ "Wing", "Znap", }; +LDHeader::FileType headerTypeCast(int index) +{ + if (Parser::typeStrings.values().contains(static_cast(index))) + return static_cast(index); + else + return LDHeader::NoHeader; +} + HeaderEdit::HeaderEdit(QWidget* parent) : QWidget {parent}, ui {*new Ui_HeaderEdit}, @@ -96,6 +105,15 @@ } ); connect( + ui.type, + qOverload(&QComboBox::currentIndexChanged), + [&](int index) + { + if (this->hasValidHeader()) + this->m_header->type = headerTypeCast(index + 1); + } + ); + connect( ui.alias, &QCheckBox::stateChanged, [&](int state)