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>
This commit is contained in:
Anton Lundin 2014-11-07 20:16:43 +01:00 committed by Dirk Hohndel
parent df0057d262
commit 450093df85

View file

@ -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());
}
}
}