Attempt to detect time format on CSV import

This attempts to detect the time format when initially importing a CSV
file. Well, only the minutes:seconds notation is detected currently.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Miika Turkia 2016-01-31 14:37:58 +02:00 committed by Dirk Hohndel
parent d9072cdefd
commit d6af28cc90

View file

@ -527,6 +527,12 @@ void DiveLogImportDialog::loadFileContents(int value, whatChanged triggeredBy)
} else if (date.contains('/')) { } else if (date.contains('/')) {
ui->DateFormat->setCurrentText("mm/dd/yyyy"); ui->DateFormat->setCurrentText("mm/dd/yyyy");
} }
} else if (foundHeading == QString::fromLatin1("Time") && columns.count() >= count) {
QString time = columns.at(count);
if (time.contains(':')) {
ui->DurationFormat->setCurrentText("Minutes:seconds");
}
} }
} else { } else {
headers.append(""); headers.append("");