diff --git a/ground/openpilotgcs/src/plugins/coreplugin/uavgadgetinstancemanager.cpp b/ground/openpilotgcs/src/plugins/coreplugin/uavgadgetinstancemanager.cpp index a20612c59..3393dc4b5 100644 --- a/ground/openpilotgcs/src/plugins/coreplugin/uavgadgetinstancemanager.cpp +++ b/ground/openpilotgcs/src/plugins/coreplugin/uavgadgetinstancemanager.cpp @@ -239,9 +239,8 @@ void UAVGadgetInstanceManager::createOptionsPages() m_pm->removeObject(m_optionsPages.takeLast()); } - QMutableListIterator ite(m_configurations); - while (ite.hasNext()) { - IUAVGadgetConfiguration *config = ite.next(); + foreach (IUAVGadgetConfiguration *config, m_configurations) + { IUAVGadgetFactory *f = factory(config->classId()); IOptionsPage *p = f->createOptionsPage(config); if (p) { @@ -250,14 +249,6 @@ void UAVGadgetInstanceManager::createOptionsPages() m_optionsPages.append(page); m_pm->addObject(page); } - else { - qWarning() - << "UAVGadgetInstanceManager::createOptionsPages - failed to create options page for configuration " - + config->classId() + ":" + config->name() + ", configuration will be removed."; - // The m_optionsPages list and m_configurations list must be in synch otherwise nasty issues happen later - // so if we fail to create an options page we must remove the associated configuration - ite.remove(); - } } }