summaryrefslogtreecommitdiffstats
path: root/qt-ui/models.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'qt-ui/models.cpp')
-rw-r--r--qt-ui/models.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/qt-ui/models.cpp b/qt-ui/models.cpp
index 89afb1187..808b52574 100644
--- a/qt-ui/models.cpp
+++ b/qt-ui/models.cpp
@@ -2417,13 +2417,11 @@ void BuddyFilterModel::repopulate()
struct dive *dive;
int i = 0;
for_each_dive (i, dive) {
- QString buddy(dive->buddy);
- QString divemaster(dive->divemaster);
- if (!buddy.isEmpty() && !list.contains(buddy)) {
- list.append(buddy);
- }
- if (!divemaster.isEmpty() && !list.contains(divemaster)) {
- list.append(divemaster);
+ QString persons = QString(dive->buddy) + "," + QString(dive->divemaster);
+ Q_FOREACH(const QString& person, persons.split(',', QString::SkipEmptyParts)){
+ if (!list.contains(person)) {
+ list.append(person);
+ }
}
}
qSort(list);