From c53442e37edb19f9481f4f0bb7e6b7b7773aea43 Mon Sep 17 00:00:00 2001 From: Miika Turkia Date: Sat, 28 Apr 2018 11:42:44 +0300 Subject: CSV import: parse (unit) style headers Commit fc010456 introduced the units to column headers. Thus the matching of these labels must take the unit into account when doing automatic matching of the header line with our field naming. Signed-off-by: Miika Turkia --- desktop-widgets/divelogimportdialog.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'desktop-widgets/divelogimportdialog.cpp') diff --git a/desktop-widgets/divelogimportdialog.cpp b/desktop-widgets/divelogimportdialog.cpp index f525ec436..84cff0f97 100644 --- a/desktop-widgets/divelogimportdialog.cpp +++ b/desktop-widgets/divelogimportdialog.cpp @@ -100,7 +100,9 @@ int ColumnNameProvider::rowCount(const QModelIndex &parent) const int ColumnNameProvider::mymatch(QString value) const { QString searchString = value.toLower(); - searchString.replace("\"", "").replace(" ", "").replace(".", "").replace("\n",""); + QRegExp re(" \\(.*\\)"); + + searchString.replace("\"", "").replace(re, "").replace(" ", "").replace(".", "").replace("\n",""); for (int i = 0; i < columnNames.count(); i++) { QString name = columnNames.at(i).toLower(); name.replace("\"", "").replace(" ", "").replace(".", "").replace("\n",""); -- cgit v1.2.3-70-g09d2