aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2015-01-08 13:44:51 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-01-08 13:44:51 -0800
commitd7762f8fbee8ec30fcba59278732f0649d788e89 (patch)
treea797e1d91405a21f644ca64c647c938602f4d697
parent562f88d2b73646f704ccad13fd56f9c2e635f0f9 (diff)
downloadsubsurface-d7762f8fbee8ec30fcba59278732f0649d788e89.tar.gz
No need for a new variable
We already have provider in a local variable. The lookup and "model" variable is redundant. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--qt-ui/divelogimportdialog.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/qt-ui/divelogimportdialog.cpp b/qt-ui/divelogimportdialog.cpp
index 4aa1cceb2..18020c9f1 100644
--- a/qt-ui/divelogimportdialog.cpp
+++ b/qt-ui/divelogimportdialog.cpp
@@ -398,13 +398,12 @@ void DiveLogImportDialog::loadFileContents(int value, whatChanged triggeredBy)
if (triggeredBy == INITIAL || (triggeredBy == KNOWNTYPES && value == 0) || triggeredBy == SEPARATOR) {
// now try and guess the columns
Q_FOREACH (QString columnText, currColumns) {
- ColumnNameProvider *model = (ColumnNameProvider *)ui->avaliableColumns->model();
columnText.replace("\"", "");
columnText.replace("number", "#", Qt::CaseInsensitive);
- int idx = model->mymatch(columnText);
+ int idx = provider->mymatch(columnText);
if (idx >= 0) {
- QString foundHeading = model->data(model->index(idx, 0), Qt::DisplayRole).toString();
- model->removeRow(idx);
+ QString foundHeading = provider->data(provider->index(idx, 0), Qt::DisplayRole).toString();
+ provider->removeRow(idx);
headers.append(foundHeading);
matchedSome = true;
} else {