1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2026-08-12 06:23:34 -04:00

Handle less columns being supplied than we have.

This commit is contained in:
Jon Beniston
2026-07-31 15:47:58 +01:00
parent e03dbb3e3c
commit d6ddad8b83
+6 -2
View File
@@ -21,6 +21,8 @@
#include <QNetworkReply>
#include <QBuffer>
#include <algorithm>
#include "SWGFeatureSettings.h"
#include "feature/featureset.h"
@@ -279,8 +281,9 @@ void AIS::webapiUpdateFeatureSettings(
if (featureSettingsKeys.contains("vesselColumnIndexes"))
{
const QList<int> *indexes = response.getAisSettings()->getVesselColumnIndexes();
int count = std::min(AIS_VESSEL_COLUMNS, (int)indexes->size());
for (int i = 0; i < AIS_VESSEL_COLUMNS; i++) {
for (int i = 0; i < count; i++) {
settings.m_vesselColumnIndexes[i] = (*indexes)[i];
}
}
@@ -288,8 +291,9 @@ void AIS::webapiUpdateFeatureSettings(
if (featureSettingsKeys.contains("vesselColumnSizes"))
{
const QList<int> *indexes = response.getAisSettings()->getVesselColumnSizes();
int count = std::min(AIS_VESSEL_COLUMNS, (int)indexes->size());
for (int i = 0; i < AIS_VESSEL_COLUMNS; i++) {
for (int i = 0; i < count; i++) {
settings.m_vesselColumnSizes[i] = (*indexes)[i];
}
}