mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Remove location completion model
This is a functional but hard to expand model for the dive sites. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
b8ae4c50b4
commit
324b6182aa
2 changed files with 0 additions and 21 deletions
|
@ -42,19 +42,6 @@ CREATE_CSV_UPDATE_METHOD(BuddyCompletionModel, buddy);
|
||||||
CREATE_CSV_UPDATE_METHOD(DiveMasterCompletionModel, divemaster);
|
CREATE_CSV_UPDATE_METHOD(DiveMasterCompletionModel, divemaster);
|
||||||
CREATE_UPDATE_METHOD(SuitCompletionModel, suit);
|
CREATE_UPDATE_METHOD(SuitCompletionModel, suit);
|
||||||
|
|
||||||
void LocationCompletionModel::updateModel()
|
|
||||||
{
|
|
||||||
QStringList list;
|
|
||||||
struct dive_site *ds;
|
|
||||||
int i = 0;
|
|
||||||
for_each_dive_site(i, ds) {
|
|
||||||
if (!list.contains(ds->name))
|
|
||||||
list.append(ds->name);
|
|
||||||
}
|
|
||||||
std::sort(list.begin(), list.end());
|
|
||||||
setStringList(list);
|
|
||||||
}
|
|
||||||
|
|
||||||
void TagCompletionModel::updateModel()
|
void TagCompletionModel::updateModel()
|
||||||
{
|
{
|
||||||
if (g_tag_list == NULL)
|
if (g_tag_list == NULL)
|
||||||
|
|
|
@ -100,8 +100,6 @@ MainTab::MainTab(QWidget *parent) : QTabWidget(parent),
|
||||||
connect(ui.cylinders->view(), SIGNAL(clicked(QModelIndex)), this, SLOT(editCylinderWidget(QModelIndex)));
|
connect(ui.cylinders->view(), SIGNAL(clicked(QModelIndex)), this, SLOT(editCylinderWidget(QModelIndex)));
|
||||||
connect(ui.weights->view(), SIGNAL(clicked(QModelIndex)), this, SLOT(editWeightWidget(QModelIndex)));
|
connect(ui.weights->view(), SIGNAL(clicked(QModelIndex)), this, SLOT(editWeightWidget(QModelIndex)));
|
||||||
|
|
||||||
LocationCompletionModel *locationCompletion = new LocationCompletionModel();
|
|
||||||
ui.location->setCompleter(new QCompleter(locationCompletion));
|
|
||||||
ui.location->completer()->setCaseSensitivity(Qt::CaseInsensitive);
|
ui.location->completer()->setCaseSensitivity(Qt::CaseInsensitive);
|
||||||
ui.location->completer()->setCompletionMode(QCompleter::PopupCompletion);
|
ui.location->completer()->setCompletionMode(QCompleter::PopupCompletion);
|
||||||
|
|
||||||
|
@ -470,9 +468,6 @@ void MainTab::updateDiveInfo(bool clear)
|
||||||
struct dive *prevd;
|
struct dive *prevd;
|
||||||
char buf[1024];
|
char buf[1024];
|
||||||
|
|
||||||
LocationCompletionModel *m = qobject_cast<LocationCompletionModel*>(ui.location->completer()->model());
|
|
||||||
m->updateModel();
|
|
||||||
|
|
||||||
process_selected_dives();
|
process_selected_dives();
|
||||||
process_all_dives(&displayed_dive, &prevd);
|
process_all_dives(&displayed_dive, &prevd);
|
||||||
|
|
||||||
|
@ -749,7 +744,6 @@ void MainTab::reload()
|
||||||
{
|
{
|
||||||
suitModel.updateModel();
|
suitModel.updateModel();
|
||||||
buddyModel.updateModel();
|
buddyModel.updateModel();
|
||||||
locationModel.updateModel();
|
|
||||||
diveMasterModel.updateModel();
|
diveMasterModel.updateModel();
|
||||||
tagModel.updateModel();
|
tagModel.updateModel();
|
||||||
}
|
}
|
||||||
|
@ -1363,8 +1357,6 @@ void MainTab::on_location_editingFinished()
|
||||||
markChangedWidget(ui.location);
|
markChangedWidget(ui.location);
|
||||||
|
|
||||||
LocationInformationModel::instance()->update();
|
LocationInformationModel::instance()->update();
|
||||||
LocationCompletionModel *m = qobject_cast<LocationCompletionModel*>(ui.location->completer()->model());
|
|
||||||
m->updateModel();
|
|
||||||
emit diveSiteChanged(uuid);
|
emit diveSiteChanged(uuid);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue