summaryrefslogtreecommitdiffstats
path: root/desktop-widgets/divelogimportdialog.cpp
diff options
context:
space:
mode:
authorGravatar Miika Turkia <miika.turkia@gmail.com>2018-04-28 11:42:44 +0300
committerGravatar Lubomir I. Ivanov <neolit123@gmail.com>2018-05-01 22:42:10 +0300
commitc53442e37edb19f9481f4f0bb7e6b7b7773aea43 (patch)
tree46ca85c5e3371b594bd8b83888ce8fc1f0f8520d /desktop-widgets/divelogimportdialog.cpp
parent9ef90daf77ab520132b9bffd7089b755c1b08440 (diff)
downloadsubsurface-c53442e37edb19f9481f4f0bb7e6b7b7773aea43.tar.gz
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 <miika.turkia@gmail.com>
Diffstat (limited to 'desktop-widgets/divelogimportdialog.cpp')
-rw-r--r--desktop-widgets/divelogimportdialog.cpp4
1 files changed, 3 insertions, 1 deletions
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","");