Match ₂ to 2 and cylinder to cyl. on CSV import

This improves the column name matching so our own columns are properly
supported.

See #814

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-01-24 17:03:17 +02:00 committed by Dirk Hohndel
parent 8e75243a5b
commit 14f96fc4de

View file

@ -419,6 +419,8 @@ void DiveLogImportDialog::loadFileContents(int value, whatChanged triggeredBy)
Q_FOREACH (QString columnText, currColumns) {
columnText.replace("\"", "");
columnText.replace("number", "#", Qt::CaseInsensitive);
columnText.replace("2", "", Qt::CaseInsensitive);
columnText.replace("cylinder", "cyl.", Qt::CaseInsensitive);
int idx = provider->mymatch(columnText);
if (idx >= 0) {
QString foundHeading = provider->data(provider->index(idx, 0), Qt::DisplayRole).toString();