diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2015-02-12 01:28:41 -0800 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-02-12 11:19:27 -0800 |
commit | f8b63e1bb6e282cd0e7368bbfcf2c572a4ba507e (patch) | |
tree | 6d37f36063dc3b06dab85efc68abb739ec167f87 | |
parent | 801e584029688eca38d35542e8ab3d644833231b (diff) | |
download | subsurface-f8b63e1bb6e282cd0e7368bbfcf2c572a4ba507e.tar.gz |
Update completion model for dive site names
This way the drop down works again.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r-- | qt-ui/completionmodels.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/qt-ui/completionmodels.cpp b/qt-ui/completionmodels.cpp index fd3cc7504..f2e70afd1 100644 --- a/qt-ui/completionmodels.cpp +++ b/qt-ui/completionmodels.cpp @@ -40,9 +40,21 @@ CREATE_CSV_UPDATE_METHOD(BuddyCompletionModel, buddy); CREATE_CSV_UPDATE_METHOD(DiveMasterCompletionModel, divemaster); -CREATE_UPDATE_METHOD(LocationCompletionModel, location); 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() { if (g_tag_list == NULL) |