CSV import: strip whitespace from column names before matching

In a user provided sample the last column name included "\r\n" which
prevented us from automatically matching that column.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2015-09-11 11:10:36 -07:00
parent c41810e5a5
commit af66ad9b6d

View file

@ -507,7 +507,7 @@ void DiveLogImportDialog::loadFileContents(int value, whatChanged triggeredBy)
columnText.replace("2", "", Qt::CaseInsensitive);
columnText.replace("cylinder", "cyl.", Qt::CaseInsensitive);
}
int idx = provider->mymatch(columnText);
int idx = provider->mymatch(columnText.trimmed());
if (idx >= 0) {
QString foundHeading = provider->data(provider->index(idx, 0), Qt::DisplayRole).toString();
provider->removeRow(idx);