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:
commit
4c7919d319
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,3 +1,5 @@
|
||||
# Exclude temporary and system files
|
||||
.DS_Store
|
||||
|
||||
# /flight/
|
||||
/flight/*.pnproj
|
||||
|
@ -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 )
|
||||
|
Loading…
Reference in New Issue
Block a user