1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-12-01 09:24:10 +01:00

Merge remote-tracking branch 'origin/msmith/OP-597' into next

This commit is contained in:
James Cotton 2011-12-10 14:11:11 -06:00
commit 4c7919d319
2 changed files with 10 additions and 0 deletions

2
.gitignore vendored
View File

@ -1,3 +1,5 @@
# Exclude temporary and system files
.DS_Store
# /flight/
/flight/*.pnproj

View File

@ -111,6 +111,11 @@ int UAVObjectParser::getNumBytes(int objIndex)
}
}
bool fieldTypeLessThan(const FieldInfo* f1, const FieldInfo* f2)
{
return f1->numBytes > f2->numBytes;
}
/**
* Parse supplied XML file
* @param xml The xml text
@ -200,6 +205,9 @@ QString UAVObjectParser::parseXML(QString& xml, QString& filename)
// Get next element
childNode = childNode.nextSibling();
}
// Sort all fields according to size
qStableSort(info->fields.begin(), info->fields.end(), fieldTypeLessThan);
// Make sure that required elements were found
if ( !accessFound )