diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2015-02-13 23:52:41 -0800 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-02-13 23:52:41 -0800 |
commit | 56de6b73f67d5ddeec74153303a27866e39279c7 (patch) | |
tree | 45040e1fb23c26e12b3002e9381f13717a9eb78d /qt-ui/completionmodels.cpp | |
parent | 2843dc38c9e64e87ac1ee84e2cb0147f630ab117 (diff) | |
parent | f81e2c111d9c563a78e62c3bae64bec07c052ec0 (diff) | |
download | subsurface-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.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) |