summaryrefslogtreecommitdiffstats
path: root/qt-ui/completionmodels.cpp
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2015-02-13 23:52:41 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-02-13 23:52:41 -0800
commit56de6b73f67d5ddeec74153303a27866e39279c7 (patch)
tree45040e1fb23c26e12b3002e9381f13717a9eb78d /qt-ui/completionmodels.cpp
parent2843dc38c9e64e87ac1ee84e2cb0147f630ab117 (diff)
parentf81e2c111d9c563a78e62c3bae64bec07c052ec0 (diff)
downloadsubsurface-56de6b73f67d5ddeec74153303a27866e39279c7.tar.gz
Merge branch 'divesites'
This brings in the dive site infrastructure and initial UI work
Diffstat (limited to 'qt-ui/completionmodels.cpp')
-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)