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>
This commit is contained in:
Miika Turkia 2018-04-28 11:42:44 +03:00 committed by Lubomir I. Ivanov
parent 9ef90daf77
commit c53442e37e

View file

@ -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","");