CSV import: validate column count

We need at least 23 columns when reading in Subsurface CSV.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Miika Turkia 2015-09-06 21:40:13 +03:00 committed by Dirk Hohndel
parent c8e542e5d3
commit c87b9645e7

View file

@ -583,7 +583,7 @@ void DiveLogImportDialog::loadFileContents(int value, whatChanged triggeredBy)
headers.replace(CSVApps[value].setpoint, tr("Sample setpoint")); headers.replace(CSVApps[value].setpoint, tr("Sample setpoint"));
/* Show the Subsurface CSV column headers */ /* Show the Subsurface CSV column headers */
if (value == SUBSURFACE) { if (value == SUBSURFACE && currColumns.count() >= 23) {
headers.replace(0, tr("Dive #")); headers.replace(0, tr("Dive #"));
headers.replace(1, tr("Date")); headers.replace(1, tr("Date"));
headers.replace(2, tr("Time")); headers.replace(2, tr("Time"));