From ae9def7f11498ec32a9a1264d8edc37a67beec50 Mon Sep 17 00:00:00 2001 From: filnet Date: Sun, 13 Jan 2013 18:33:07 +0100 Subject: [PATCH 1/2] OP-805 - fixed GCS Options page crash by removing configurations for which an options page could not be created. --- .../plugins/coreplugin/uavgadgetinstancemanager.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/ground/openpilotgcs/src/plugins/coreplugin/uavgadgetinstancemanager.cpp b/ground/openpilotgcs/src/plugins/coreplugin/uavgadgetinstancemanager.cpp index 55dc239a8..3fa7eaf9e 100644 --- a/ground/openpilotgcs/src/plugins/coreplugin/uavgadgetinstancemanager.cpp +++ b/ground/openpilotgcs/src/plugins/coreplugin/uavgadgetinstancemanager.cpp @@ -239,8 +239,9 @@ void UAVGadgetInstanceManager::createOptionsPages() m_pm->removeObject(m_optionsPages.takeLast()); } - foreach (IUAVGadgetConfiguration *config, m_configurations) - { + QMutableListIterator ite(m_configurations); + while (ite.hasNext()) { + IUAVGadgetConfiguration *config = ite.next(); IUAVGadgetFactory *f = factory(config->classId()); IOptionsPage *p = f->createOptionsPage(config); if (p) { @@ -249,6 +250,14 @@ 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(); + } } } From d1236499c177c51c6d2da450bf015de6b1e17c86 Mon Sep 17 00:00:00 2001 From: filnet Date: Sun, 13 Jan 2013 21:53:14 +0100 Subject: [PATCH 2/2] OP-805 - removed uneeded Uploader default configuration. --- .../default_configurations/OpenPilotGCS.xml | 16 ---------------- .../default_configurations/OpenPilotGCS_wide.xml | 16 ---------------- 2 files changed, 32 deletions(-) diff --git a/ground/openpilotgcs/share/openpilotgcs/default_configurations/OpenPilotGCS.xml b/ground/openpilotgcs/share/openpilotgcs/default_configurations/OpenPilotGCS.xml index 9b066072b..7dbaa53c6 100644 --- a/ground/openpilotgcs/share/openpilotgcs/default_configurations/OpenPilotGCS.xml +++ b/ground/openpilotgcs/share/openpilotgcs/default_configurations/OpenPilotGCS.xml @@ -2538,22 +2538,6 @@ - - - - false - 0.0.0 - - - 3 - 0 - 0 - /dev/ttyS0 - 14 - 0 - - - false 1.2.0 diff --git a/ground/openpilotgcs/share/openpilotgcs/default_configurations/OpenPilotGCS_wide.xml b/ground/openpilotgcs/share/openpilotgcs/default_configurations/OpenPilotGCS_wide.xml index a8dd2df63..0f9405f36 100644 --- a/ground/openpilotgcs/share/openpilotgcs/default_configurations/OpenPilotGCS_wide.xml +++ b/ground/openpilotgcs/share/openpilotgcs/default_configurations/OpenPilotGCS_wide.xml @@ -2506,22 +2506,6 @@ - - - - false - 0.0.0 - - - 3 - 0 - 0 - /dev/ttyS0 - 14 - 0 - - - false 1.2.0