Cleanup: remove completers from MainTab object

This struct is used to store the completers during construction
of the object. But it is never accessed afterwards. Therefore,
remove it from the object and remove the structure definition
from the header file.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2019-04-13 18:14:50 +02:00 committed by Dirk Hohndel
parent fe61f6b69e
commit 822b88ab3d
2 changed files with 8 additions and 9 deletions

View file

@ -41,6 +41,13 @@
#include <QDesktopServices>
#include <QStringList>
struct Completers {
QCompleter *divemaster;
QCompleter *buddy;
QCompleter *suit;
QCompleter *tags;
};
MainTab::MainTab(QWidget *parent) : QTabWidget(parent),
editMode(NONE),
lastSelectedDive(true),
@ -105,6 +112,7 @@ MainTab::MainTab(QWidget *parent) : QTabWidget(parent),
ui.DiveType->insertItems(0, types);
connect(ui.DiveType, SIGNAL(currentIndexChanged(int)), this, SLOT(divetype_Changed(int)));
Completers completers;
completers.buddy = new QCompleter(&buddyModel, ui.buddy);
completers.divemaster = new QCompleter(&diveMasterModel, ui.divemaster);
completers.suit = new QCompleter(&suitModel, ui.suit);

View file

@ -21,14 +21,6 @@
class ExtraDataModel;
class DivePictureModel;
class QCompleter;
struct Completers {
QCompleter *divemaster;
QCompleter *buddy;
QCompleter *suit;
QCompleter *tags;
};
class TabBase;
class MainTab : public QTabWidget {
@ -96,7 +88,6 @@ private:
DiveMasterCompletionModel diveMasterModel;
SuitCompletionModel suitModel;
TagCompletionModel tagModel;
Completers completers;
bool modified;
bool lastSelectedDive;
int lastTabSelectedDive;