[PATCH v2] Remove leading spaces in buddy tags

Anton Lundin glance at acc.umu.se
Fri Nov 7 00:04:16 PST 2014


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 at acc.umu.se>
---
 qt-ui/models.cpp | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/qt-ui/models.cpp b/qt-ui/models.cpp
index 64a5fd5..4da4ed0 100644
--- a/qt-ui/models.cpp
+++ b/qt-ui/models.cpp
@@ -2436,6 +2436,8 @@ 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)){
+			// Remove any leading spaces
+			persons = person.trimmed();
 			if (!list.contains(person)) {
 				list.append(person);
 			}
-- 
1.9.1



More information about the subsurface mailing list