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 <[email protected]>
---
 qt-ui/models.cpp | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/qt-ui/models.cpp b/qt-ui/models.cpp
index 64a5fd5..e62ea29 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());
                        }
                }
        }
-- 
1.9.1

_______________________________________________
subsurface mailing list
[email protected]
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface

Reply via email to