1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-17 02:52:12 +01:00

iOP-803 redid spurious commit in order to avoid undoing OP-805 (need to be

more carefull or sleep more...)
This commit is contained in:
Philippe Renon 2013-02-18 22:28:09 +01:00
parent d03db9c6d1
commit adc9c008c4

View File

@ -239,8 +239,9 @@ void UAVGadgetInstanceManager::createOptionsPages()
m_pm->removeObject(m_optionsPages.takeLast());
}
foreach (IUAVGadgetConfiguration *config, m_configurations)
{
QMutableListIterator<IUAVGadgetConfiguration*> 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();
}
}
}