summaryrefslogtreecommitdiffstats
path: root/qt-ui
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2015-09-11 11:10:36 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-09-11 11:10:36 -0700
commitaf66ad9b6dcb331faf2073904c6c48813eb46c26 (patch)
tree770670dfc2c8153b0e42d4d11ee61e55c90f71c9 /qt-ui
parentc41810e5a54a6437830defc39d8f41cb2ebbcb98 (diff)
downloadsubsurface-af66ad9b6dcb331faf2073904c6c48813eb46c26.tar.gz
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>
Diffstat (limited to 'qt-ui')
-rw-r--r--qt-ui/divelogimportdialog.cpp2
1 files changed, 1 insertions, 1 deletions
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);