diff --git a/src/lay/layTechnologyController.cc b/src/lay/layTechnologyController.cc index f4b753c9d..6f0b26c4f 100644 --- a/src/lay/layTechnologyController.cc +++ b/src/lay/layTechnologyController.cc @@ -284,9 +284,14 @@ TechnologyController::update_current_technology () action.set_title (title); } - size_t it = 0; - for (lay::Technologies::const_iterator t = lay::Technologies::instance ()->begin (); t != lay::Technologies::instance ()->end () && it < m_tech_actions.size (); ++t, ++it) { - m_tech_actions[it].set_checked (t->name () == m_current_technology); + std::map tech_by_name; + for (lay::Technologies::const_iterator t = lay::Technologies::instance ()->begin (); t != lay::Technologies::instance ()->end (); ++t) { + tech_by_name.insert (std::make_pair (t->name (), t.operator-> ())); + } + + int it = 0; + for (std::map::const_iterator t = tech_by_name.begin (); t != tech_by_name.end (); ++t, ++it) { + m_tech_actions[it].set_checked (t->second->name () == m_current_technology); } } @@ -323,17 +328,22 @@ TechnologyController::update_menu () m_tech_actions.clear (); + std::map tech_by_name; + for (lay::Technologies::const_iterator t = lay::Technologies::instance ()->begin (); t != lay::Technologies::instance ()->end (); ++t) { + tech_by_name.insert (std::make_pair (t->name (), t.operator-> ())); + } + int it = 0; - for (lay::Technologies::const_iterator t = lay::Technologies::instance ()->begin (); t != lay::Technologies::instance ()->end (); ++t, ++it) { + for (std::map::const_iterator t = tech_by_name.begin (); t != tech_by_name.end (); ++t, ++it) { - std::string title = tech_string_from_name (t->name ()); + std::string title = tech_string_from_name (t->first); - m_tech_actions.push_back (pr->create_config_action ("", cfg_initial_technology, t->name ())); + m_tech_actions.push_back (pr->create_config_action ("", cfg_initial_technology, t->first)); m_tech_actions.back ().set_title (title); // setting the title here avoids interpretation of '(...)' etc. m_tech_actions.back ().set_checkable (true); - m_tech_actions.back ().set_checked (t->name () == m_current_technology); - for (std::vector::const_iterator t = tech_group.begin (); t != tech_group.end (); ++t) { - pr->menu ()->insert_item (*t + ".end", "technology_" + tl::to_string (it), m_tech_actions.back ()); + m_tech_actions.back ().set_checked (t->first == m_current_technology); + for (std::vector::const_iterator tg = tech_group.begin (); tg != tech_group.end (); ++tg) { + pr->menu ()->insert_item (*tg + ".end", "technology_" + tl::to_string (it), m_tech_actions.back ()); } } @@ -353,7 +363,7 @@ TechnologyController::show_editor () // determine the technology files that need to be deleted and delete them std::set files_before; for (lay::Technologies::const_iterator t = new_tech.begin (); t != new_tech.end (); ++t) { - if (! ! t->tech_file_path ().empty () && ! t->is_persisted ()) { + if (! t->tech_file_path ().empty () && ! t->is_persisted ()) { files_before.insert (t->tech_file_path ()); } } diff --git a/src/laybasic/layAbstractMenu.cc b/src/laybasic/layAbstractMenu.cc index c0516fa87..3c62f6bb9 100644 --- a/src/laybasic/layAbstractMenu.cc +++ b/src/laybasic/layAbstractMenu.cc @@ -635,7 +635,6 @@ ConfigureAction::triggered () } m_pr->config_set (m_cname, m_cvalue); - m_pr->config_end (); } void diff --git a/src/laybasic/layTechnology.cc b/src/laybasic/layTechnology.cc index 5cc9434e7..09e596bdd 100644 --- a/src/laybasic/layTechnology.cc +++ b/src/laybasic/layTechnology.cc @@ -256,7 +256,8 @@ Technology::Technology (const Technology &d) m_explicit_base_path (d.m_explicit_base_path), m_default_base_path (d.m_default_base_path), m_load_layout_options (d.m_load_layout_options), m_save_layout_options (d.m_save_layout_options), - m_lyp_path (d.m_lyp_path), m_add_other_layers (d.m_add_other_layers), m_persisted (d.m_persisted) + m_lyp_path (d.m_lyp_path), m_add_other_layers (d.m_add_other_layers), m_persisted (d.m_persisted), + m_readonly (d.m_readonly), m_lyt_file (d.m_lyt_file) { for (std::vector ::const_iterator c = d.m_components.begin (); c != d.m_components.end (); ++c) { m_components.push_back ((*c)->clone ()); @@ -277,6 +278,8 @@ Technology &Technology::operator= (const Technology &d) m_lyp_path = d.m_lyp_path; m_add_other_layers = d.m_add_other_layers; m_persisted = d.m_persisted; + m_readonly = d.m_readonly; + m_lyt_file = d.m_lyt_file; for (std::vector ::const_iterator c = m_components.begin (); c != m_components.end (); ++c) { delete *c; @@ -400,7 +403,8 @@ Technology::load (const std::string &fn) // use the tech file's path as the default base path std::string lyt_file = tl::to_string (QFileInfo (tl::to_qstring (fn)).absoluteDir ().path ()); set_default_base_path (lyt_file); - set_tech_file_path (lyt_file); + + set_tech_file_path (fn); } void