From df7d7d498118c85b2bee40af5242852770c11e43 Mon Sep 17 00:00:00 2001 From: Lakshman Date: Wed, 26 Mar 2014 15:09:01 -0500 Subject: Fix redundant spaces in info panel Remove redundant spaces from dive master and buddy list fields. Ticket also mentions about similar space behaviour in tag field, which I couldn't reproduce. Fixes #476 Signed-off-by: Lakshman Anumolu Signed-off-by: Dirk Hohndel --- qt-ui/maintab.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/qt-ui/maintab.cpp b/qt-ui/maintab.cpp index aea676de2..9ff5e9f31 100644 --- a/qt-ui/maintab.cpp +++ b/qt-ui/maintab.cpp @@ -853,14 +853,20 @@ void markChangedWidget(QWidget *w) void MainTab::on_buddy_textChanged() { - QString text = ui.buddy->toPlainText().split(",", QString::SkipEmptyParts).join(", "); + QStringList text_list = ui.buddy->toPlainText().split(",", QString::SkipEmptyParts); + for (int i = 0; i < text_list.size(); i++) + text_list[i] = text_list[i].trimmed(); + QString text = text_list.join(", "); EDIT_SELECTED_DIVES(EDIT_TEXT(mydive->buddy, text)); markChangedWidget(ui.buddy); } void MainTab::on_divemaster_textChanged() { - QString text = ui.divemaster->toPlainText().split(",", QString::SkipEmptyParts).join(", "); + QStringList text_list = ui.divemaster->toPlainText().split(",", QString::SkipEmptyParts); + for (int i = 0; i < text_list.size(); i++) + text_list[i] = text_list[i].trimmed(); + QString text = text_list.join(", "); EDIT_SELECTED_DIVES(EDIT_TEXT(mydive->divemaster, text)); markChangedWidget(ui.divemaster); } -- cgit v1.2.3-70-g09d2