diff options
author | Anton Lundin <glance@acc.umu.se> | 2014-11-07 20:16:43 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-11-07 13:11:36 -0800 |
commit | 450093df85c38ce33fd23049a77750cf48e03976 (patch) | |
tree | 8b0dd7079189ae8cb4d5ff7ffa40af1a2ce58cb9 | |
parent | df0057d262571182d721d0b79cb5d64b90f834d6 (diff) | |
download | subsurface-450093df85c38ce33fd23049a77750cf48e03976.tar.gz |
Remove leading spaces in buddy tags
The buddy list generated by the buddy tag logic gets separated by
,<space> so this trims away any leading spaces from the buddy name.
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r-- | qt-ui/models.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/qt-ui/models.cpp b/qt-ui/models.cpp index c48d1e4fc..5732e7043 100644 --- a/qt-ui/models.cpp +++ b/qt-ui/models.cpp @@ -2436,8 +2436,9 @@ void BuddyFilterModel::repopulate() for_each_dive (i, dive) { QString persons = QString(dive->buddy) + "," + QString(dive->divemaster); Q_FOREACH(const QString& person, persons.split(',', QString::SkipEmptyParts)){ - if (!list.contains(person)) { - list.append(person); + // Remove any leading spaces + if (!list.contains(person.trimmed())) { + list.append(person.trimmed()); } } } |