aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--qt-ui/completionmodels.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/qt-ui/completionmodels.cpp b/qt-ui/completionmodels.cpp
index ed1699a92..c4a4eeb8d 100644
--- a/qt-ui/completionmodels.cpp
+++ b/qt-ui/completionmodels.cpp
@@ -32,7 +32,20 @@ void Class::updateModel() \
setStringList(list); \
}
-CREATE_UPDATE_METHOD(BuddyCompletionModel, buddy);
+void BuddyCompletionModel::updateModel()
+{
+ QSet<QString> set;
+ struct dive* dive;
+ int i = 0;
+ for_each_dive(i, dive){
+ QString buddy(dive->buddy);
+ foreach (const QString &value, buddy.split(",", QString::SkipEmptyParts)) {
+ set.insert(value.trimmed());
+ }
+ }
+ setStringList(set.toList());
+}
+
CREATE_UPDATE_METHOD(DiveMasterCompletionModel, divemaster);
CREATE_UPDATE_METHOD(LocationCompletionModel, location);
CREATE_UPDATE_METHOD(SuitCompletionModel, suit);