From af66ad9b6dcb331faf2073904c6c48813eb46c26 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Fri, 11 Sep 2015 11:10:36 -0700 Subject: [PATCH] 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 --- qt-ui/divelogimportdialog.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qt-ui/divelogimportdialog.cpp b/qt-ui/divelogimportdialog.cpp index c21a6a18e..025d181d1 100644 --- a/qt-ui/divelogimportdialog.cpp +++ b/qt-ui/divelogimportdialog.cpp @@ -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);