summaryrefslogtreecommitdiffstats
path: root/qt-ui
diff options
context:
space:
mode:
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)