From 4e9aff047e1c28899a9dd41fec3e60bb77a0527e Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Sat, 1 Nov 2014 22:48:18 -0200 Subject: Show single buddies instead on the filter. Signed-off-by: Tomaz Canabrava Signed-off-by: Dirk Hohndel --- qt-ui/models.cpp | 12 +++++------- 1 file 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); -- cgit v1.2.3-70-g09d2