mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-12-29 19:00:35 -07:00
FIX: object params variant crash
Change-Id: Ia67b98c29a0cc97f8479911ffdefb942cb6c751f Jira: none (cherry picked from commit 8bf65c0963d1ee39bba12f67f33177d4ac6d6a60)
This commit is contained in:
parent
2a35173b8c
commit
660d2ee686
4 changed files with 26 additions and 7 deletions
|
|
@ -2829,7 +2829,9 @@ void TabPrintModel::update_model_config()
|
|||
//update();
|
||||
if (!m_null_keys.empty()) {
|
||||
if (m_active_page) {
|
||||
for (auto k : m_null_keys) {
|
||||
auto null_keys = m_null_keys;
|
||||
filter_diff_option(null_keys);
|
||||
for (auto k : null_keys) {
|
||||
auto f = m_active_page->get_field(k);
|
||||
if (f)
|
||||
f->set_value(boost::any(), false);
|
||||
|
|
@ -2862,7 +2864,9 @@ void TabPrintModel::activate_selected_page(std::function<void()> throw_if_cancel
|
|||
{
|
||||
TabPrint::activate_selected_page(throw_if_canceled);
|
||||
if (m_active_page) {
|
||||
for (auto k : m_null_keys) {
|
||||
auto null_keys = m_null_keys;
|
||||
filter_diff_option(null_keys);
|
||||
for (auto k : null_keys) {
|
||||
auto f = m_active_page->get_field(k);
|
||||
if (f)
|
||||
f->set_value(boost::any(), false);
|
||||
|
|
@ -2896,6 +2900,7 @@ void TabPrintModel::on_value_change(const std::string& opt_id, const boost::any&
|
|||
bool set = true; // *m_config->option(k) != *m_prints.get_selected_preset().config.option(k) || inull != m_null_keys.end();
|
||||
auto tab_opt = dynamic_cast<ConfigOptionVectorBase *>(m_config->option(opt_key));
|
||||
static std::map<ConfigOptionType, ConfigOptionVectorBase const *> null_vecs {
|
||||
{coBools, new ConfigOptionBoolsNullable(std::initializer_list<unsigned char>{ConfigOptionBoolsNullable::nil_value()})},
|
||||
{coInts, new ConfigOptionIntsNullable(1, ConfigOptionIntsNullable::nil_value())},
|
||||
{coFloats, new ConfigOptionFloatsNullable(1, ConfigOptionFloatsNullable::nil_value())},
|
||||
{coPercents, new ConfigOptionPercentsNullable(1, ConfigOptionPercentsNullable::nil_value())},
|
||||
|
|
@ -2952,7 +2957,15 @@ void TabPrintModel::on_value_change(const std::string& opt_id, const boost::any&
|
|||
void TabPrintModel::reload_config()
|
||||
{
|
||||
TabPrint::reload_config();
|
||||
auto keys = m_config_manipulation.applying_keys();
|
||||
if (m_active_page) {
|
||||
auto null_keys = m_null_keys;
|
||||
filter_diff_option(null_keys);
|
||||
for (auto k : null_keys) {
|
||||
auto f = m_active_page->get_field(k);
|
||||
if (f) f->set_value(boost::any(), false);
|
||||
}
|
||||
}
|
||||
auto keys = m_config_manipulation.applying_keys();
|
||||
bool super_changed = false;
|
||||
for (auto & k : keys) {
|
||||
if (has_key(k)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue