summaryrefslogtreecommitdiffstats
path: root/qt-ui
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2015-02-12 01:28:41 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-02-12 11:19:27 -0800
commitf8b63e1bb6e282cd0e7368bbfcf2c572a4ba507e (patch)
tree6d37f36063dc3b06dab85efc68abb739ec167f87 /qt-ui
parent801e584029688eca38d35542e8ab3d644833231b (diff)
downloadsubsurface-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>
Diffstat (limited to 'qt-ui')
-rw-r--r--qt-ui/completionmodels.cpp14
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)