Commit 7f43851e authored by Don Gagne's avatar Don Gagne

Merge pull request #2523 from DonLakeFlyer/DefaultCompId

Fix default comp id detection
parents a8fbcbab 94a0e98f
......@@ -335,12 +335,18 @@ void ParameterLoader::_determineDefaultComponentId(void)
// the set of parameters. Better than nothing!
_defaultComponentId = -1;
int largestCompParamCount = 0;
foreach(int componentId, _mapParameterName2Variant.keys()) {
if (_mapParameterName2Variant[componentId].count() > _defaultComponentId) {
int compParamCount = _mapParameterName2Variant[componentId].count();
if (compParamCount > largestCompParamCount) {
largestCompParamCount = compParamCount;
_defaultComponentId = componentId;
}
}
Q_ASSERT(_defaultComponentId != -1);
if (_defaultComponentId == -1) {
qWarning() << "All parameters missing, unable to determine default componet id";
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment