diff options
author | Tomaz Canabrava <tomaz.canabrava@intel.com> | 2014-11-01 22:48:18 -0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-11-01 22:01:33 -0700 |
commit | 4e9aff047e1c28899a9dd41fec3e60bb77a0527e (patch) | |
tree | c257731d9853485506a8ba0e0948fa145c0b10bd /qt-ui/models.cpp | |
parent | 1f4b40732391971fc117aa069009263ae59ab154 (diff) | |
download | subsurface-4e9aff047e1c28899a9dd41fec3e60bb77a0527e.tar.gz |
Show single buddies instead on the filter.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/models.cpp')
-rw-r--r-- | qt-ui/models.cpp | 12 |
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); |